Skip to main content

A library to handle persistent memory

Project description

membank

Python library for storing data in persistent memory (sqlite, postgresql, berkeley db)

goals

Provide interface to database storage that automates heavy lifting of database setup, migration, table definition, query construction.

quick intro

add items to persistent storage

from typing import NamedTuple

from membank import LoadMemory

class Dog(NamedTuple):
    breed: str
    color: str = "black"
    weight: float = 0

memory = LoadMemory() # defaults to sqlite memory
memory.put.dog(Dog('Puli')) # stores object into database
dog = memory.get.dog() # retrieves first object found as namedtuple
assert dog.breed == 'Puli'

retrieve those after

memory = LoadMemory() # to make this work in new process, don't use sqlite memory
dog = memory.get.dog()
assert dog.color == 'black'

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

membank-0.2.5.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

membank-0.2.5-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file membank-0.2.5.tar.gz.

File metadata

  • Download URL: membank-0.2.5.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for membank-0.2.5.tar.gz
Algorithm Hash digest
SHA256 60c9f96e84b04000f6d8a688c45f5d59b6c21a3ac062a65072cfdd41ed0c34a7
MD5 73aafe26636956306d52eaccb042286f
BLAKE2b-256 4c0bb1d9dab57d7f600bde64713af89d95864eeb7f6d417d3150bf6a38732a02

See more details on using hashes here.

File details

Details for the file membank-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: membank-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for membank-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0cde8dc92aa93114fec9a09ab3be3ec13561e48ddabb5a7dfb0e8dba0bd2d748
MD5 3ff01801b72ab44eb3bf4956189520d2
BLAKE2b-256 67ba5a032f3f2f5cdbb0f07de48ab0327ebb101ee707965f83fe56c0fb745a3f

See more details on using hashes here.

Supported by

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