Skip to main content

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

This version

1.0

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 details)

Uploaded Source

Built Distribution

directoryshard-1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file directoryshard-1.0.tar.gz.

File metadata

  • Download URL: directoryshard-1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/65.6.3 requests-toolbelt/0.8.0 tqdm/4.64.1 CPython/3.8.10

File hashes

Hashes for directoryshard-1.0.tar.gz
Algorithm Hash digest
SHA256 12d9c4120326f3832d992670eeea14e6251ad816ee6d828428c0052471b196bc
MD5 665f1b5560969d72f17937fb7d671edc
BLAKE2b-256 2f87b5a700ad99c3e1e598b6b7da1c776e42c644c8d8af2ecde823469aca6f71

See more details on using hashes here.

File details

Details for the file directoryshard-1.0-py3-none-any.whl.

File metadata

  • Download URL: directoryshard-1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/65.6.3 requests-toolbelt/0.8.0 tqdm/4.64.1 CPython/3.8.10

File hashes

Hashes for directoryshard-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 798197bb89e7bbc145d0fc5822b20abcee7a55a5bb06a2ddd26715d0ea9646f0
MD5 9e9c0c9c306d341a1ce0905832983373
BLAKE2b-256 a1dbe2d3f3583e1d25d48f33d1fad304f236b208421e21785925bcaea106894b

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