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 pythonfiledatastore
Usage:
>>> from pythonfiledatastore 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
Close
Hashes for pythonfiledatastore-1.4-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97d8c7325bc94bcd5994b95774b73f676bb2b325ccbd84be18e942cfd3fa25ab |
|
MD5 | 07a486bf41f022c238dba07091c5d5b8 |
|
BLAKE2b-256 | f017e609db56a9e8b095cc7548f01e27b504a82c4ac2146b564eda1efba181ed |