Code Monkey home page Code Monkey logo

pyjsonlog's Introduction

Abstract

A python package implementing a filesystem based store of JSON datastructures, where older versions are never deleted.

Travis-CI says https://travis-ci.org/uucidl/pyjsonlog.svg?branch=master

Why should I use json-log-store?

When developing a python-based application or command line tool, you can use this file store to store your data.

Iterating on the solution or creating composite solutions made of multiple tools can then be done with the confidence you will not lose any data.

Application area

  • Python applications
  • Data can be serialized as JSON
  • Mostly reads, few writes

Using

import os
from jsonlog import DataStore, DataStoreFS

root_dir = "<somewhere on your filesystem>"
os.makedirs(root_dir)
ds = DataStore(DataStoreFS(root_dir))

# put first version in the store
os.makedirs(os.path.join(root_dir, 'my-item'))
ds.put('item', 'my-item', dict(version=0))

# read and update the item
item = ds.get('my-item')
item['info'] = 'Hello, World'
ds.put('item', 'my-item', item)

Then you should be able to see in <root_dir>/my-item/:

item-1.json
item-2.json

Contributing

Here are the steps to follow to get a working development environment:

Create a virtual environment and activate it

$ virtualenv venv
$ . venv/bin/activate

Install development dependencies

$ pip install -r requirements.txt dev_requirements.txt

With the virtual environment active, test your changes before submitting:

$ nosetests -s tests

License

see LICENSE

pyjsonlog's People

Contributors

uucidl avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.