Skip to main content

A file based index system, keeps a log of folder contents

Project description

Scoro

Hello everyone! Scoro is a Python library for handling data by their file titles. Scoro handles and creates files based on user defined attributes while tracking those with similar attributes.

If you had a recipe folder, you could track the recipes based on type of dish, main ingredient, rating, etc. If you were working with a folder of books, you could track the author, title, year, rating, if you have read, etc. There would then be a text file log that contains each entry of that type.

Following our dessert recipe library example: A log would track each dish, main ingredient, and rating. If we were bakers, a log of dishes might look like this:

;cake
;custard
;parfait
pie
;syrup
tarte

Each dessert recipe stored would look have this format and look like this:

dessert-type_main-ingredient_rating.ext
pie_blueberry_3.txt
## a three start blueberry pie recipe

Notice in the log example above, some entries have a ; check in front while some do not. Those that are checked with a ; are not selected and those that do not have a check are selected. This is a handy feature of Scoro in that you could select all recipes of only a type, ingredient, and rating. If you wanted only the highest stars; you could set your ratings log up to look like:

;1
;2
3

This would only gather 3 / 3 star recipes. To gather the recipes, you would need to use the pull command. Pulling will return the file locations for each recipe or transfer all the files to an desired output location.

Installation

Use the package manager pip to install Scoro.

pip install Scoro

Usage

For usage within your own programs, here is a quick usage:

# Creates the object
p1 = scoro.Scoro()

# Adds logs
p1.add_log("dessert_type", "main_ingredient", "stars")

# Making a bunch of dishes. Content could be what you want!
desserts = ["cake", "pie"]
main_ingredient = ["blueberry", "apple", "Strawberry"]
stars = [1, 2, 3]

for entry in zip(desserts, main_ingredients, stars):
    recipe = "Recipe"
    p1.create(entry, content=recipe)
    
# Unchecks all three stars
p1.uncheck("3", log="stars")

# Pulls all the three star recipes 
p1.pull()

# Prints all recipes found
p1.post()


But, if you want to get creative, then here is the full docs:

import Scoro

# Initializes scoro
scoro_example = scoro.Scoro()

## Or with all possible options
## Storage - Path of Storage
## logs - Path of logs folder
## output - Path of output folder
## titles - Adds logs from title of string or list of strings
## reset - Reset all logs
## close - Autosettles (leave on)
## send - Sets pull to auto move files to output folder
scoro_example = scoro.Scoro(storage="./storage/", logs="./logs/", output="./output/",
                 titles=None, reset=False, close=True, send=False)


# Adds a log(s)
## title - string or list of strings for logs to add
scoro_example.add_log(title)

# Deletes a log
## title - string or list of strings for logs to delete
scoro_example.delete_log(title)

# Returns a dictionary of the log content
## title - string for log to return
scoro_example.get_log_content(title)

# Prints the contents of all logs
scoro_example.post()

# Creates a new file in storage based on your inputs
## Attributes - a list of terms for the filename (term1_term2_term-n)
## Content - The text within the document
## Extension - Default .txt
scoro_example.create(attributes, content, extention="txt")

# Pulls
## match - If you want the pull content to match only exactly what is unchecked
## send - If you want to pull content to your output folder
## output - Path of alternative output folder
scoro_example.pull(match=False, send=False, output="")

# Check / Unchecks a term
## Terms - String or list of strings to (un)check
## log - Optional specified log
scoro_example.check(terms, log="")
scoro_example.uncheck(terms, log="")

# Reset all logs
scoro_example.reset()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scoro-1.1.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

scoro-1.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file scoro-1.1.0.tar.gz.

File metadata

  • Download URL: scoro-1.1.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for scoro-1.1.0.tar.gz
Algorithm Hash digest
SHA256 448c355cd9329ba04b7faa6e306a3265968c53f23ccd6745cdb8e992c6291d11
MD5 2271a52e0ae5aafe5896a15f2bc8b3d4
BLAKE2b-256 1269cd065ae68762fed9c33bce9f6b1515a4d51454ac5a6d911fa11cff9c058b

See more details on using hashes here.

File details

Details for the file scoro-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: scoro-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for scoro-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97d2cb5beef11bb0173b74dba741d7fbef4a71c41e4d1af0bcac6c9b801216fb
MD5 9ed86d478ca33c48fbc20bd62df8022b
BLAKE2b-256 fccd692cd1853580c0f6a9d045b28707d04009ec9d35dcba71cc5bdb878ca71d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page