Code Monkey home page Code Monkey logo

rodict's Introduction

RoDict

A python package for accessing internal keys of a dictionary easily. RoDict internally stores the data as a dictionary.

Any internal keys of a dictionary by using a key by separating the nested keys using a separator. Default separator is __ (two underscores).

For example consider the following dictionary:

data = {
	'a' : {
		'b': {
			'c': 10
		}
	}
}

Accessing value of key 'c' in the above dictionary:

Without RoDict

>>> data = data['a']
>>> data = data['b']
>>> data = data['c']
>>> print data

With RoDict

>>> from rodict import RoDict
>>> r = RoDict(store=data)
>>> print r['a__b__c']

Not only for getting values, setting values for a key in dict can be done using the same syntax.

Where can it be used:

Right now I'm using this package for maintaining/updating configuration files in json where values need to be dynamically updating during runtime.

Installation:

For contribution:

$ git clone [email protected]:Prashant-Surya/rodict.git
$ cd rodict
$ python setup.py develop

Just for using it as a package:

$ git clone [email protected]:Prashant-Surya/rodict.git
$ cd rodict
$ python setup.py install

Contribution:

  1. For contributing to the RoDict create a fork from this repo.
  2. Work on a feature branch.
  3. Raise a Pull Request to the master branch of this repo.

rodict's People

Contributors

prashant-surya avatar

Watchers

James Cloos 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.