Skip to main content

filevault: manage a hash directory tree and files

Project description

filevault

filevault is a class for managing a hash directory tree of files on a filesystem.

A Vault will:

  • Create a hash directory tree of custom depth

  • Spread out files to keep CLI snappy when traversing the tree

  • Scale to hundreds of thousands of files

  • Obfuscate directory paths and filenames

how to install

Setuptools:

easy_install filevault

Pip:

pip install filevault

how to use

How to create a default Vault object:

from filevault import Vault

v = Vault()

You may (and should) customize the Vault instance. Here are the arguments:

vaultpath

Where should the tree be created? Defaults to ‘vault’ in pwd.

depth

How deep should the tree span? Defaults to 3 directories deep.

salt

Add a custom salt for a unique and more secure tree, defaults to ‘changeme’

Another custom example:

from filevault import Vault

v = Vault( vaultpath="/tmp/for-test", depth=2, salt="sugar" )

Now that we have a Vault object named v, we may review its two methods:

create_filename( seed, ext=’’, absolute=False )

Create a valid vault filename seeded with input. Optional extension. Relative path from vaultpath by default unless absolute is True.

create_random_filename( ext=’’, absolute=False )

Create a valid vault filename seeded with random input. Optional extension. Relative path from vaultpath by default unless absolute is True.

Here is a full example:

# import Vault class
from filevault import Vault

# create vault object named v, with custom path, depth, and salt
v = Vault( vaultpath="/tmp/for-test", depth=2, salt="sugar" )

# print a valid vault filename with extension
print v.create_filename( "my-first-file", ".png" )

# result:
# 3/9/3993817d4f9b3867c6db29b23c9d2ff9bb8a87d89426002adbb6ed34289d9e32.png

print v.create_filename( "my-first-file", ".png" )

# Same result:
# 3/9/3993817d4f9b3867c6db29b23c9d2ff9bb8a87d89426002adbb6ed34289d9e32.png

# print a valid vault absolute filename with extension
print v.create_filename( "my-first-file", ".png", absolute=True )

# result:
# /tmp/for-test/3/9/3993817d4f9b3867c6db29b23c9d2ff9bb8a87d89426002adbb6ed34289d9e32.png


# print a random valid vault filename without extension
v.create_random_filename()

# result:
# 6/1/6169d6ee0ac0bc63ab667fb94d9cc747df0c03596ac43e24a51b3517d74bdc42

how may I thank you?

Check out my webpage to screenshot service and give me some feedback, tips, or advice. Every little bit of help counts.

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

filevault-0.1.2.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

filevault-0.1.2-py2.7.egg (3.9 kB view details)

Uploaded Source

File details

Details for the file filevault-0.1.2.tar.gz.

File metadata

  • Download URL: filevault-0.1.2.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for filevault-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bf2cacd23c585f9587e3df242e8ae77a2c7e481fecffea31a529a834ff5bddcd
MD5 a23c447e726465903c08660efe96137c
BLAKE2b-256 b7bae6fcb84b66d11564c1f254f04b217f5a9a42c5698cf7c8a3c79283e9af21

See more details on using hashes here.

File details

Details for the file filevault-0.1.2-py2.7.egg.

File metadata

File hashes

Hashes for filevault-0.1.2-py2.7.egg
Algorithm Hash digest
SHA256 a832efc66bd8087003ee685de5cac751ca5eda326860f8b6b19792e5e9511bfa
MD5 3f1fac5db227335483a45a25057a5abc
BLAKE2b-256 82d526981382001bc5ee7f8cc24a15d6f5443e519629991c4b2ebc9a91350d15

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