Skip to main content

pymemdb

CircleCI codecov

will soon be available with

pip install pymemdb

Description

Very simple RDMBS that is supposed to serve as a drop-in replacement for a conventional DB during build-up. It is very fast, completely written in python und relies heavily on dictionaries. It features a to_sqlite export method - more DBs will follow.

Usage

Insert into a table

from pymemdb import Table

table = Table()
row1 = dict(firstname="John", lastname="Smith")
row2 = dict(firstname="Jane", lastname="Smith")
row3 = dict(firstname="John", lastname="Doe")

for row in [row1, row2, row3]:
    table.insert(row)

iterate over the entire table

print(list(table.all()))

[{'id': 0, 'firstname': 'John', 'lastname': 'Smith'},
 {'id': 1, 'firstname': 'Jane', 'lastname': 'Smith'},
 {'id': 2, 'firstname': 'John', 'lastname': 'Doe'}]

update rows

table.update(where={"firstname": "Jane"}, firstname="Joanne")
print(list(table.all()))

[{'id': 0, 'firstname': 'John', 'lastname': 'Smith'},
 {'id': 1, 'firstname': 'Joanne', 'lastname': 'Smith'},
 {'id': 2, 'firstname': 'John', 'lastname': 'Doe'}]

search for rows

print(list(table.find(firstname="John")))

[{'id': 0, 'firstname': 'John', 'lastname': 'Smith'},
{'id': 2, 'firstname': 'John', 'lastname': 'Doe'}]

search for values in iterable

print(list(table.find(firstname=["John", "Joanne"])))

[{'id': 0, 'firstname': 'John', 'lastname': 'Smith'},
{'id': 1, 'firstname': 'Joanne', 'lastname': 'Smith'},
{'id': 2, 'firstname': 'John', 'lastname': 'Doe'}]

delete rows

table.delete(firstname="John", lastname="Smith")
print(list(table.all()))

[{'id': 1, 'firstname': 'Joanne', 'lastname': 'Smith'},
 {'id': 2, 'firstname': 'John', 'lastname': 'Doe'}]

Metadata

Release files for pymemdb 1.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pymemdb 1.4.3
File Size Uploaded Provenance
pymemdb-1.4.3.tar.gz 11.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pymemdb 1.4.3
File Interpreter ABI Platform
pymemdb-1.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 18.9 kB

Release files / pymemdb-1.4.3.tar.gz

Download URL pymemdb-1.4.3.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5320351d3a2da16cc7f7b27a0844bdbbbae0ea40f7bbe57a108528ce49d93b80
BLAKE2b-256 checksum
How to use checksums
253758f2d772c1958eddedca136bd88fa2795bea71eb87ba2f9d741b774de3a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.24.0

Release files / pymemdb-1.4.3-py3-none-any.whl

Download URL pymemdb-1.4.3-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df7e8b17cea4291624109e884f624b04e909f0bd33b9397c2fceac35c89dce53
BLAKE2b-256 checksum
How to use checksums
105241a9100f0d55a21eacfcfc10c5d00c29e58e94c4996e41cc43bdd4098fb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.24.0

Security for pymemdb 1.4.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page