Simple PYTHON file distribution library.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
filedistribution
.gitignore
.travis.yml
CHANGES.txt
MANIFEST.in
README.rst
setup.py

README.rst

Simple PYTHON file distribution library.

Travis CI Status

Description:

Simple library that allows organize distribution of files within hex based tree.

Install FileDistribution package:

$ pip install FileDistribution

Example of usage:

from file_distribution import FileDistribution

fd = FileDistribution("/tmp/storage")

# default extensions
database_id = 1
fd.hex_path(database_id)
fd.rename_from("/tmp/upload/file1.txt")
path = fd.get_path() # saved file path

# set all extensions to .pdf
database_id = 256
fd.set_extension(".pdf")
fd.hex_path(database_id)
fd.rename_from("/tmp/upload/file2.txt")
path = fd.get_path() # saved file path

Files should be stored in /tmp/storage/01.dat and /tmp/storage/01/00.pdf