File based datastore
Project description
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 python-file-datastore==0.1
Additional Installation
pip install cachetools
Make sure you have python 3
Usage:
>>> from python-file-datastore import datastore_invoke
General Instructions:
>>> print(datastore_invoke(0)
Operation Not FoundOperation_name 1 - Create (--client --key --ttl(optional) --value) | 2 - Read (--client --key) | 3 - Delete (--client --key) | 4 - Reset (--client)
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
Reset Operation - Delete Entire file
>>> print(datastore_invoke(4, client = "hunch" ))
File removed!!!! - hunch
Project details
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
File details
Details for the file pythonfiledatastore-1.0.tar.gz
.
File metadata
- Download URL: pythonfiledatastore-1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff5c63f6462fcfe126bdef91fa6c8b55e275d3ef1191d1f4851921b3998988e9 |
|
MD5 | d5965432c84fafecd280c3e5bc7522a1 |
|
BLAKE2b-256 | a4423443f2d392ff6c2e99a8e4a7bc7e4da3295dfc109506c2e6d24b5d4aa0ba |
File details
Details for the file pythonfiledatastore-1.0-py2-none-any.whl
.
File metadata
- Download URL: pythonfiledatastore-1.0-py2-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 2
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdf6ff8620b01a056bcca59c23e1b081416fb82b758e3540f1b59deb0d2004d3 |
|
MD5 | 717a648f8a7768fd046a65c8b472d252 |
|
BLAKE2b-256 | d886202def019d5aa82781f5287e688aa6239b61bd8c241c99c81dda1db1a2cf |