Skip to main content

No project description provided

Project description

Introduction

This library allows you to access blobs via Pythonic dict-like interface. Note that due to the nature of blob, not all dict methods are implemented. Therefore, it is not a subclass of MutableMapping type.

Supported Blob Dict Methods

Specifically, for a blob dict d, the following methods are available:

  • len(d)
  • key in d
  • d.get(key, default)
  • d[key]
  • for key in d:
  • d.pop(key, default)
  • del d[key]
  • d[key] = blob

Supported Blob Dict Types

There are different blob dict implementations:

  • InMemoryBlobDict for in-memory storage, with optional TTL
  • PathBlobDict for specified folder on file system as storage, with relative file path as key
    • It supports local file systems via PathLib
      • Ideally use provided LocalPath class (which is a subclass of Path) for full support
    • It also supports cloud file systems (like AWS S3 (and competible Cloudflare R2), Azure Blob Storage, and Google Cloud Storage) via CloudPathLib
  • GitBlobDict for specified Git repo on file system as storage, with relative file path as key
    • It auto commits any add/update/delete
    • It auto syncs with remote if enabled
    • Optionally, key can be tuple where the second part is version:
      • str for version at specified commit/tag, like HEAD~2
      • int for relative version (same way of Python sequence index) of file, like 0 for first version and -2 for previous version
      • datetime for latest version before specified date/time
      • timedelta for latest version of specified duration before now
  • VulkeyBlobDict for Vulkey/Redis-based storage, with optional TTL
  • Specially, MultiReplicaBlobDict for utilizing multiple blob dicts underneath
    • For example, you can use in-memory or local file system blob dict as cache layer, while any cloud file system blob dict as storage

Supported Blob Types

There as many types of blobs with following class hierarchy relationship:

  • BytesBlob for any data
    • StrBlob for any string
      • JsonDictBlob for any JSON dict object
      • JsonModelBlob for any Pydantic model object
    • AudioBlob for any SoundFile audio data
    • ImageBlob for any PIL/Pillow image data
    • VideoBlob for any MoviePy video clip data

Ultimately, all data are persisted as bytes.

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

blob_dict-0.1.15.tar.gz (120.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blob_dict-0.1.15-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file blob_dict-0.1.15.tar.gz.

File metadata

  • Download URL: blob_dict-0.1.15.tar.gz
  • Upload date:
  • Size: 120.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for blob_dict-0.1.15.tar.gz
Algorithm Hash digest
SHA256 ab0bd161a14bd01847fa6a6a420d2fb00addb016ba2aeafd2f4140fd658e5d8a
MD5 6529408dbf2439d4fbe3d6eab9afeb33
BLAKE2b-256 c8f1abf57da67aea657795380a63c06761551ba732b4f6a619a1b7d361ce89db

See more details on using hashes here.

File details

Details for the file blob_dict-0.1.15-py3-none-any.whl.

File metadata

  • Download URL: blob_dict-0.1.15-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for blob_dict-0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 2d06c2cfba66774c1cbc311fd3636c8fa31461e2e53c55b5e8eb7d744b798f7a
MD5 60b72758b326378ff871af6a5b258c6a
BLAKE2b-256 2a3146c6833c6e1c4810b368bd0a40b2b8864fd4dfb04e48ec579b3e55b46e76

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page