Skip to content

darwinwilmut/Freshwork-Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Data Store

A File based key-value Data Store

About The Project

A File based key-value data store that can be used in your project to store data in key value pairs in json file in your local machine. The Data_Store is very light weight and can be used in a small or medium level projects. The Time to live property is a great feature if you don't want the data to be stored permanently. It destroys the data automatically after the time has expired.

Built With

Features

  • File stored as json
  • Time to Live

Getting Started

To get a local copy up and running follow these simple steps.

Installation

  1. Clone the repo
    git clone https://github.com/darwinwilmut/Freshwork-Assignment.git

Usage

  1. Copy the Data_store package folder into your project.

  2. Import the Data_Store module into your python file

    from Main_code import * 
  3. path can be set manually or path will be set default to current working Directory with file name "Sample.json"

    set_path('Your path')   
  4. Create data in Data_store.

     # the key must be string
     # it takes key and value as the parameter
     create('key',value)
    
     # the default time to live value is 0 which means None.
     # you can set time to live property
     # it takes integer value (seconds) as the parameter
     set_delay(seconds)
  5. Read data from store.

    # it takes key as the parameter
     read('key')
  6. Delete data in store.

     # it takes key as the parameter 
     delete('key')

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages