Skip to content

fschuch/file_storehouse

Repository files navigation

File-Storehouse

Test and build Code style: black python PyPI Version

Main Features

File-Storehouse is a lightweight Python package that aims to facilitate the management of files in bulk quantity.

There are four key points that are combined to achieving such a goal:

  • Mapping Interface - The file managers are leveraged by the Mapping and MutableMapping interfaces, which means that everything can be done using a friendly dict-like interface. For instance:

    # Store data to a file:
    file_manager[id] = file_content
    # Retrine data from a file
    file_content = file_manager[id]
    # Delete a file
    del file_manager[id]
    # Loop through all files
    for id, content in file_manager.items():
        pass
    # and many more...
  • Engine - Choose the engine (or back-end) your file managers are connected to:

    • S3 buckets, powered by boto3;
    • Local filesystem and more are planned.
  • Key Mapping - Customize a two-way key mapping between the dict-like keys and the files' location at the engines according to the business rules of your application.

  • Transformations - Configure a chained operation to convert the files back and forward between your Python code and the storage. The supported operations are:

    • Encode/decode bytes and strings;
    • Dump/load Json files;
    • Compress/decompress tarballs and more transformations are planned.

Example

Please, take a look at the user story used for testing.

Copyright and License

© 2022 Felipe N. Schuch. All content is under MIT License.