No project description provided
Project description
directoryshard
Shard filenames into subdirectories.
A large number of files in a single directory can make operations such as listing or browsing cumbersome. Splitting files into subdirectories alleviates this.
API
Two methods are provided:
def shardprefix(filename: str) -> str:
"""Return a 2 character alphanumeric string by deterministically hashing filename"""
def sharded(filepath: Path) -> Path:
"""Return path sharded into subdirectory"""
Class
ShardedDirectory provides getting file paths from a directory:
sharded_tmp = ShardedDirectory('/tmp)
print(sharded_tmp.filepath('python'))
return /tmp/ep.python.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
directoryshard-1.0.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for directoryshard-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 798197bb89e7bbc145d0fc5822b20abcee7a55a5bb06a2ddd26715d0ea9646f0 |
|
MD5 | 9e9c0c9c306d341a1ce0905832983373 |
|
BLAKE2b-256 | a1dbe2d3f3583e1d25d48f33d1fad304f236b208421e21785925bcaea106894b |