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.0a7.tar.gz (46.9 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.0a7-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: omnidict-1.0.0a7.tar.gz
  • Upload date:
  • Size: 46.9 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.0a7.tar.gz
Algorithm Hash digest
SHA256 6f50683532fd1968544bf0874499079920631f3d0fd16eaa79d73f4941d24ef5
MD5 382b04658c72e90d848b49ddac7aae5b
BLAKE2b-256 bc6a2658eeaeaa2db3c49187e4863ff02276ff88978b391b944449f23f55b0dd

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: omnidict-1.0.0a7-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.0a7-py3-none-any.whl
Algorithm Hash digest
SHA256 3e0104d926e180e985f3d0111bebc94d264c74c529ab8f756571de5e9f787440
MD5 8d22228cffcb64887cca4cf2bd1abea8
BLAKE2b-256 5eac4c251b431dbd0349be1faa908edc5f5b644a60bbbddebf1c485f84cb9ea3

See more details on using hashes here.

Provenance

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