Skip to content

turicas/vortaroj

Repository files navigation

vortaroj - a Python dict that speaks many languages

vortaroj logo

One of the reasons Python is a great programming language is the availability of high level data structures, such as lists, tuples, sets and dictionaries.

In special, pythonistas are hash addicted: we like dictionaries and use it a lot. But sometimes, having an in-memory dict is not sufficient: we want it persistent or acessible through other machines. Solutions for this kind of problem are available, like Memcache, MemcacheDB, Riak, Redis and other key-value databases (actually, sometimes we use NoSQL and even relational databases for this job). However, generally the interface is changed, so we need to change for the dead simple Python dict interface to something different/weird.

vortaroj came to solve this problem: it has a dict-like interface to many backends; it's like an ORM to key-value databases.

How to install

Since we don't have a release yet, you should download the code and execute:

python setup.py install

As soon as we have a release, it'll be available at PyPI.

How to use

Using vortaroj is as simple: choose a backend, instantiate a class and use it like a Python dict, like below:

>>> # choose a backend and instantiate:
>>> from vortaroj import MongoDict
>>> my_dict = MongoDict(host='127.0.0.1', port=27017)

>>> # use like a regular dict:
>>> my_dict['python'] = 42
>>> print(my_dict['python'])
42
>>> del my_dict['python']
>>> print(my_dict['python'])

Why the name "vortaroj"?

"Vortaroj" means "dictionaries" in Esperanto - a language created not to be the first language of somebody, but to be the second language of everyone.

The original name was "vortaro" but as the domain vortaro.org was taken by somebody else, @andrebco suggested the plural "vortaroj".

License

vortaroj is licensed under GNU General Public License version 3.

Related Links

About

A Python dict that speaks many languages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published