Skip to main content

Common interface for many key-value storages

Project description

Omnidict

Opinionated interface for many key/value repositories:

I am kind of tired of having to do small changes when I move from Dictionary, to Redis, to Shelve or whatever key/value storage I am using. This is an interface heavily inspired by builtin shelve module to make all those mapping repositories behave the same way:

  • Get item: storage['key'] returns the value associated to 'key' and raises a KeyError if 'key' is not defined. storage.get('key') behaves the same way but returns default() when 'key' is not defined.

  • Set item: storage['key'] = val associates val to 'key' and raises a KeyError if 'key' already has a value associated. storage.set('key', val) behaves the same way but overwrites association if it already exists.

  • Delete item: del storage['key'] deletes 'key' and raises a KeyError if 'key' is not defined. storage.delete('key') behaves the same way but does nothing when 'key' is not defined.

  • Expiration: You can define expire_seconds parameter to make your associations expire. Expiration time is refreshed every time you access a key.

  • Encryption: You can define a passphrase parameter to encrypt your values using symmetric encryption.

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

omnidict-1.0.0a8.tar.gz (47.1 kB view details)

Uploaded Source

Built Distribution

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

omnidict-1.0.0a8-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file omnidict-1.0.0a8.tar.gz.

File metadata

  • Download URL: omnidict-1.0.0a8.tar.gz
  • Upload date:
  • Size: 47.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for omnidict-1.0.0a8.tar.gz
Algorithm Hash digest
SHA256 ddb5f0670c953007bf9d2ae595e0fad08b7f0f4e94dd726570fa6f2087c9d807
MD5 5e4b2fd12723f8097a30153f91aa824b
BLAKE2b-256 d14e4c5f8cd55e96c54b51f7d9fc96995424cc090d885dd33cd3ade7d5ad2a54

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnidict-1.0.0a8.tar.gz:

Publisher: publish-to-pypi.yaml on santibreo/omnidict

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file omnidict-1.0.0a8-py3-none-any.whl.

File metadata

  • Download URL: omnidict-1.0.0a8-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for omnidict-1.0.0a8-py3-none-any.whl
Algorithm Hash digest
SHA256 b087f16ea751bfdf601b4a4327210a8032b7764da4af4a1fcaadcfb0fd9111bf
MD5 66244c4f98a12fe621f5f9098024ae08
BLAKE2b-256 54df85ba1e78cf0b033d5b1eff568fcf6e4fd3a438ab44d06692f54732f9d91c

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnidict-1.0.0a8-py3-none-any.whl:

Publisher: publish-to-pypi.yaml on santibreo/omnidict

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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