DataStore
Introduction
File-based key-value data store that supports the basic CRD (create, read, and delete) operations. This data store is meant to be used as a local storage for one single process on one laptop.
Installation
pip install pythonfiledatastore
Usage:
>>> from pythonfiledatastore import datastore_invoke
General Instructions:
>>> print(datastore_invoke(0))
Operation Not Found
1 for Create (--client --key --ttl(optional) --value --filepath(optional))
2 for Read (--client --key --filepath(optional))
3 for Delete (--client --key --filepath(optional))
4 for Reset (--client --filepath(optional))
Create Operation with file path
>>> print(datastore_invoke(1, client = "hunch" , key = "employee_data", value = '{"employee":"siam"}', filepath = "/Users/user_name/Desktop/"))
Create Operation Done
Create Operation
>>> print(datastore_invoke(1, client = "hunch" , key = "employee_data", value = '{"employee":"siam"}'))
Create Operation Done
Create Operation with Time to Live feature
>>> print(datastore_invoke(1, client = "hunch" , key = "employee_data_temp", value = '{"employee":"ragoish"}', ttl = 30 ))
Create Operation Done
Read Operation
>>> print(datastore_invoke(2, client = "hunch" , key = "employee_data"))
For key | employee_data | value - {'employee': 'siam'}
Read Operation TTL Expired
>>> print(datastore_invoke(2, client = "hunch" , key = "employee_data_temp"))
Error Status : TTL Value for the Key - employee_data_temp expired for the client - hunch
Delete Operation
>>> print(datastore_invoke(3, client = "hunch" , key = "employee_data"))
Error Status : For key | employee_data | value - is deleted
Delete Operation TTL Expired
>>> print(datastore_invoke(3, client = "hunch" , key = "employee_data_temp"))
Error Status : TTL Value for the Key - employee_data_temp expired for the client - hunch
Note: After Delete Option if the client storage file is empty, A forced reset operation is performed
Reset Operation - Delete Entire file
>>> print(datastore_invoke(4, client = "hunch" ))
File removed!!!! - hunch
Release files for pythonfiledatastore 1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pythonfiledatastore-1.5.tar.gz | 5.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pythonfiledatastore-1.5-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 12.0 kB
Release files / pythonfiledatastore-1.5.tar.gz
| Download URL | pythonfiledatastore-1.5.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0cd138c99295b7fbcc14c28524d84e18b8dc2758ff2ee3040dbbf5f24b7839e3
|
|
BLAKE2b-256 checksum How to use checksums |
b047b7d6eb4b9ff3fe65978f8138ea2acd98bf9ca5988082fb9588afac13261e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|
Release files / pythonfiledatastore-1.5-py2-none-any.whl
| Download URL | pythonfiledatastore-1.5-py2-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
fc28c49bbf5ecd239a98c7408eebf0d87977162e5b68eeb61ac3eefbe0f236cb
|
|
BLAKE2b-256 checksum How to use checksums |
fbb18ba0f8c125e878c3db1135c035f8a99a3c02d601cdc3e1de19d614d53c27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3
|