fooster-db
fooster-db is a human-readable, magic database implemented in Python. The database presents a dictionary of first column value to entry and each entry is represented by an object where each column is an attribute. If any attribute of the entry is changed, the database file is automatically updated to represent it. The database is formatted in a human-readable table and can store JSON-serializable data structures. This project is not designed for large amounts of data or when speed is a priority, but when you need, for example, an easy way to store text data or metadata.
Usage
Below is an example for a user database that demonstrates all features of the module.
import fooster.db
users = fooster.db.Database('users.db', ['username', 'password', 'favorite_number', 'admin', 'friends'])
print('Users:')
for user in users:
print(user)
print()
users['test1'] = users.Entry(password='supersecretpassword', favorite_number=None, admin=False, friends=['olduser'])
users['test2'] = fooster.db.Entry('test3', 'correcthorsebatterystaple', 7, False, ['alice', 'bob'])
admin_user = users.add('admin', 'admin|nimda', 1337, True, [])
print('Length: {}\n'.format(len(users)))
test1_user = users['test1']
test1_user.favorite_number = 1
print('User: {} ({}) - {}\n'.format(test1_user.username, test1_user.favorite_number, ', '.join(test1_user.friends)))
test2_user = users.get('test2')
test2_user.admin = True
print('User: {} ({}) - {}\n'.format(test2_user.username, test2_user.favorite_number, ', '.join(test2_user.friends)))
admin_user.friends.append(test2_user.username)
print('Users:')
for user in users:
print(user)
print()
del users['test1']
for user in users:
user.admin = False
print('Usernames:')
for username in users.keys():
print(username)
print()
print('User Dict: {}\n'.format(dict(users['test2'])))
print('User Test: {}\n'.format('test2' in users))
print('User Values: {}\n'.format(users.values()))
users.remove('admin')
print('Users:')
for user in users.values():
print(user)
print()
print('Database:\n')
with open('users.db', 'r') as file:
print(file.read())
Metadata
Release files for fooster-db 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fooster-db-0.10.0.tar.gz | 6.1 kB | Without provenance | Details for fooster-db-0.10.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fooster_db-0.10.0-py3-none-any.whl | Python 3 | none | any | Details for fooster_db-0.10.0-py3-none-any.whl |
Total release size: 12.7 kB
Release files / fooster-db-0.10.0.tar.gz
| Download URL | fooster-db-0.10.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55135c29854c6c1cadb6f579590784887a91e11031528bd8c8e51cb7f7394cb3
|
|
BLAKE2b-256 checksum How to use checksums |
7c7d5ea0a405ca99f9c8c5475dc4ae5a8599c651fa751df22b7aad30ca4a0680
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
|
Release files / fooster_db-0.10.0-py3-none-any.whl
| Download URL | fooster_db-0.10.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0de1b77113851d1dab433465ce673bfdf7e3cf179920acfc173ab24548d3136a
|
|
BLAKE2b-256 checksum How to use checksums |
9d651d0d0684dc9398911d7051e6761c353add7e342beb844f6d8c4d88561688
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
|
Security for fooster-db 0.10.0
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.