A simple in-memory encrypted ORM for SQLite3
Project description
PyCyphORM
A simple in-memory encrypted ORM for SQLite3.
The database lives in memory while in use and is persisted to disk as a gzipped, Fernet-encrypted blob. Keys are derived from a password and salt with PBKDF2-HMAC-SHA256.
Install
pip install PyCyphORM
CLI
Generate a .pyorm config (random salt + password) in the current directory:
pyorm --init 1
Decrypt an encrypted database file to <file>.decoded.db:
pyorm --decrypt path/to/db
Library usage
from pyorm import ORM, load_config
cnf = load_config(".pyorm")
orm = ORM("users.db", cnf["PASSWORD"], cnf["SALT"], {
"users": {
"id": "INTEGER PRIMARY KEY AUTOINCREMENT",
"name": "TEXT NOT NULL",
"email": "TEXT NOT NULL",
"age": "INT NOT NULL",
}
})
users = orm.model("users")
users.insert({"name": "Alice", "email": "alice@example.com", "age": 30})
users.update({"name": "Alice"}, {"age": 31})
print(users.find())
print(users.first({"name": "Alice"}))
users.delete({"name": "Alice"})
orm.save()
orm.save() writes the encrypted snapshot back to disk. Without it, changes
remain in memory only.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycyphorm-26.5.25.tar.gz.
File metadata
- Download URL: pycyphorm-26.5.25.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b419ec8cadfc5532d2a18c764ab43bc3b45489841f1d1dbaea16b3ea857ada7
|
|
| MD5 |
8b27442cc8e0657cf7b2d6a8a5c6f9bb
|
|
| BLAKE2b-256 |
f513899cac5347ed5ea31565c17b5f10ce3e5ec4007d48261cce504f980af980
|
Provenance
The following attestation bundles were made for pycyphorm-26.5.25.tar.gz:
Publisher:
publish.yml on jafrmartins/PyCyphORM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pycyphorm-26.5.25.tar.gz -
Subject digest:
7b419ec8cadfc5532d2a18c764ab43bc3b45489841f1d1dbaea16b3ea857ada7 - Sigstore transparency entry: 1625293986
- Sigstore integration time:
-
Permalink:
jafrmartins/PyCyphORM@3ca27b146669a8422822d72a5e4f3f4babb29bfd -
Branch / Tag:
refs/tags/26.5.25 - Owner: https://github.com/jafrmartins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3ca27b146669a8422822d72a5e4f3f4babb29bfd -
Trigger Event:
push
-
Statement type:
File details
Details for the file pycyphorm-26.5.25-py3-none-any.whl.
File metadata
- Download URL: pycyphorm-26.5.25-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
315cd8763e9b8f14ed310d89a076d825b76dc54b95081fda16338463bc610607
|
|
| MD5 |
99b68ff43a040ccde15cee9357895b98
|
|
| BLAKE2b-256 |
3043916bc83ded04a30b7524b06d4a9a118be9a97e4ff5a61040387298ef337f
|
Provenance
The following attestation bundles were made for pycyphorm-26.5.25-py3-none-any.whl:
Publisher:
publish.yml on jafrmartins/PyCyphORM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pycyphorm-26.5.25-py3-none-any.whl -
Subject digest:
315cd8763e9b8f14ed310d89a076d825b76dc54b95081fda16338463bc610607 - Sigstore transparency entry: 1625294033
- Sigstore integration time:
-
Permalink:
jafrmartins/PyCyphORM@3ca27b146669a8422822d72a5e4f3f4babb29bfd -
Branch / Tag:
refs/tags/26.5.25 - Owner: https://github.com/jafrmartins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3ca27b146669a8422822d72a5e4f3f4babb29bfd -
Trigger Event:
push
-
Statement type: