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.0a4.tar.gz (46.5 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.0a4-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: omnidict-1.0.0a4.tar.gz
  • Upload date:
  • Size: 46.5 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.0a4.tar.gz
Algorithm Hash digest
SHA256 662b7e9686e37193d3df4bd78a351bc080bffdf35e6e2c8669d3f6b8961f7cba
MD5 3911824587ce85b670defb28db88647b
BLAKE2b-256 f0af39e6c696fb89ed45c8e6d0d31bee9f911b561d85c44e7c6067c4b7e8de7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnidict-1.0.0a4.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.0a4-py3-none-any.whl.

File metadata

  • Download URL: omnidict-1.0.0a4-py3-none-any.whl
  • Upload date:
  • Size: 32.0 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.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 de88d0bd35f17759e574c6eac4c0c78563d94fcc2e83eb25c9657726892565b0
MD5 05b778b53955eb2224d32e2a97f67b81
BLAKE2b-256 774baac6255ff837d909d9cd0bfb0c9cf3416167e2da0b5ad1f3d346ec6e77d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for omnidict-1.0.0a4-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