Py-Simple-DB
Install:
pip install PySimpleDB
Load:
from PySimpleDB import DataBase
mydb = DataBase("simple.bd")
mydb_unique = DataBase("unique.bd", unique="user")
You can use a database in which the unique key will be a number, or specify your own name for the unique key, which will need to be transmitted
Add row:
This command automatically saves the state of the database.
mydb.add(name="Hello", last_name="world", gender="male") # any values
mydb_unique.add(user="User1", name="Hello world", gender="male") # any values
# ^ unique key
Make sure you are passing in a unique key for the appropriate database.
As in this example, the unique key is the "user" argument specified during initialization.
Find:
Returns the id of the first matched element, or an array of ids.
id_first = mydb.find(name="Hello") # 0
id_array = mydb.find_all(gender="male") # [0...]
id_first_unique = mydb_unique.find(gender="male") # "User1"
id_array_unique = mydb_unique.find_all(gender="male") # ["User1"...]
Get row:
Returns value by id.
mydb.get(id_first) # {"name": "Hello", "last_name": "world", "gender": "male"}
mydb_unique.get(id_first_unique) # {"name": "Hello world", "gender": "male"}
Delete row:
This command automatically saves the state of the database.
mydb.delete(id_first)
mydb_unique.delete(id_first_unique)
Save:
mydb.save()
Get All Data:
Allows you to get the whole database.
mydb.get_all()
or
mydb.data
You can also see usage examples here
Release files for PySimpleDB 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| PySimpleDB-0.2.1.tar.gz | 2.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| PySimpleDB-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:5.3 kB
Release files / PySimpleDB-0.2.1.tar.gz
| Download URL | PySimpleDB-0.2.1.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a95ae2c5d6a304d8b5718a9391a3fb40a90df34afb597ce0cdb96eebb2f9ce0a
|
|
BLAKE2b-256 checksum How to use checksums |
7fa99cf752f5948d82285fabe1c5bf6064b228947efd66c129a399d9b52f2d72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / PySimpleDB-0.2.1-py3-none-any.whl
| Download URL | PySimpleDB-0.2.1-py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9de2109ac05c03e98a3ba7c79811565ece765995ebccc19d70ccc55fe4039b4
|
|
BLAKE2b-256 checksum How to use checksums |
7398e9807ced3f40ab9c3be4cca676b9d4ec60e5c7422a627062b76436cccd1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|