Skip to main content

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==1.0

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

pythonfiledatastore-1.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

pythonfiledatastore-1.1-py2-none-any.whl (6.4 kB view details)

Uploaded Python 2

File details

Details for the file pythonfiledatastore-1.1.tar.gz.

File metadata

  • Download URL: pythonfiledatastore-1.1.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

Hashes for pythonfiledatastore-1.1.tar.gz
Algorithm Hash digest
SHA256 8b9a0bbbc5953c231937c04101dca8919f6b7dc5679224f00dc2cd43b6773485
MD5 c7b0064f2facd1bd450fb2bb417ec494
BLAKE2b-256 67d7ed01df5a736276683497dc6268a9d1e4bfa928fa4840ff6a8f457f0c6f4f

See more details on using hashes here.

File details

Details for the file pythonfiledatastore-1.1-py2-none-any.whl.

File metadata

  • Download URL: pythonfiledatastore-1.1-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

Hashes for pythonfiledatastore-1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 ad2625b73299f087845ed175643d1789fdc0f10654ef78baf96781a7abdb0504
MD5 ce1d1117aa5861f5de45cc38451d5331
BLAKE2b-256 54ac1ea630341882128b78c7eea06cf3260daf7c030ec6ea5c47dfd6fbff1945

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page