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.0.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

Scoro-1.0.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file Scoro-1.0.0.tar.gz.

File metadata

  • Download URL: Scoro-1.0.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.6

File hashes

Hashes for Scoro-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6482d733338720669159d5371796bf0adfc1c3826877f527195aeff49cac250b
MD5 a102cf51b87ceb928c6f41d9757a5cc9
BLAKE2b-256 6b75fda2cc80b42c077074620f54e0fd2b6a701ca352aead6bd32e0da7f2620d

See more details on using hashes here.

File details

Details for the file Scoro-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: Scoro-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.6

File hashes

Hashes for Scoro-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ea99f7a32745ef04ffb4af2074f5056fca47b9993211c99de01e835e8a580da
MD5 7e3260bf65065f29420f32693ae9c930
BLAKE2b-256 fc0b34f6fd0f31511f3acf298d4baf4f2bfb3c2845edeb172766cb933c783430

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