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

Uploaded Python 3

File details

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

File metadata

  • Download URL: omnidict-1.0.0a6.tar.gz
  • Upload date:
  • Size: 46.8 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.0a6.tar.gz
Algorithm Hash digest
SHA256 9f5a084df1495fd403315ef537f19579673c8cf6df9d760a48cd0e27ba0e3c86
MD5 684d6c04e2e7c81031b24a2ac7cd2532
BLAKE2b-256 e032a9088672c280ec33e96ba24cccf8e447cb05107559375ba72a72399a8fd7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: omnidict-1.0.0a6-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.0a6-py3-none-any.whl
Algorithm Hash digest
SHA256 17861e159e9a5ca90d76694738ef5476921dde4c94ffe6e981d390fcda0589a2
MD5 2dbc1fd2b14cf8df2b5f32488401cf3c
BLAKE2b-256 6786ab4b340cc34d2407b9e7a923d5966c27659185452ae04a90a4e24ec4a5ba

See more details on using hashes here.

Provenance

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