SkillAgentSearch skills...

Vortaroj

A Python dict that speaks many languages

Install / Use

/learn @turicas/Vortaroj
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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

View on GitHub
GitHub Stars7
CategoryDevelopment
Updated8y ago
Forks0

Languages

Python

Security Score

55/100

Audited on Mar 5, 2018

No findings