EASYDEV documentation¶
contributions: | Please join https://github.com/cokelaer/easydev |
---|---|
source: | Please use https://github.com/cokelaer/easydev |
issues: | Please use https://github.com/cokelaer/easydev/issues |
Python version supported: | |
2.6, 2.7, 3.3, 3.4, 3.5 |
Motivation¶
The package easydev provides miscellaneous functions and files that are repeatidly used in other Python packages.
Some functions are very simple such as the swapdict()
,
which inverts the keys/values in a dictionary (assuming unique keys):
>>> from easydev import swapdict
>>> d = {'a':1, 'b':2}
>>> inv = swapdict(d)
>>> inv
{1: 'a', 2: 'b'}
The swapdict is just one functions amongst many others but belongs to the simple
functions. Other functions such as the progress bar (progressbar
) are more
complex and easydev should be very useful in speeding up development. Another example is
the AttrDict()
function: it makes the keys of a dictionary accessible as attributes. Meaning that you can get or set the values quickly as follows:
>>> from easydev import AttrDict
>>> d = AttrDic(**{'a':1, 'b':2})
>>> d.a
1
>>> d.a = 10
>>> d.a
10
Another example is the multicore
module that provides
a simple tool to perform a multi-core analysis in Python. Note, however,
that specialised library would surely cover more aspects. Yet, in a few lines
of code many applications would work out of the box with this code:
from easydev.multicore import MultiProcessing
mp = MultiProcessing(maxcpu=4)
mp.add_job(test_func, 2)
mp.add_job(test_func, 1)
mp.run()
There are many such functions in easydev and the best would be to have a look at the User guide for more examples and the Reference Guide guide for an exhaustuve list of tools available.
There are also a few applications installed with easydev. One is the browse application that is equivalent to open under Mac. The interest is that it is multi-platform.
Note also that easydev was starting a few years ago and that some functionalities did not exists back then but do now in e.g. standard modules of Python.
Installation¶
Of course, you will need to install Python (linux and mac users should have it installed already). We recommend also to install ipython, which provides a more flexible shell alternative to the python shell itself.
One specificity of easydev is be a pure Python package. However we depend on a few simple packages namely, colorama (for terminal colors under windwos), pexpect and profiler (optional). They are pure Python packages though and therefore the following command should install easydev out of the box using the PyPi command:
pip install easydev --upgrade
Contributions¶
For contributions or bug reports, please see easydev on github.