File: index.rst

package info (click to toggle)
python-easydev 0.13.3%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 636 kB
  • sloc: python: 1,904; makefile: 116; javascript: 49
file content (75 lines) | stat: -rw-r--r-- 2,320 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#############################
EASYDEV documentation
#############################


.. raw:: html

    <div style="width:40%">
    <a href="https://pypi.python.org/pypi/easydev"> <img src="https://badge.fury.io/py/easydev.svg"></a>

    <a href="https://github.com/cokelaer/easydev/actions/workflows/ci.yml"> <img src="https://github.com/cokelaer/easydev/actions/workflows/ci.yml/badge.svg"></a>

    <a href="https://coveralls.io/github/cokelaer/easydev?branch=master"> <img src="https://coveralls.io/repos/github/cokelaer/easydev/badge.svg?branch=master"></a>
    </div>


:documentation: http://easydev-python.readthedocs.io/en/latest/
: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:     3.7, 3.8, 3.9



Motivation
=============


The package `easydev <http://pypi.python.org/pypi/easydev/>`_ provides
miscellaneous functions that are often used in other Python packages.
**easydev** should help developers in speeding up their own developments.

Some functions are very simple such as the :func:`~easydev.tools.swapdict`,
which inverts the keys/values in a dictionary (assuming unique keys):

.. doctest::

    >>> from easydev import swapdict
    >>> d = {'a': 1, 'b': 2}
    >>> inv = swapdict(d)
    >>> inv
    {1: 'a', 2: 'b'}

Other functions such as the progress bar (:mod:`~easydev.progressbar`) are more
complex.

Another example is the :func:`~easydev.tools.AttrDict` function: it makes the keys of a dictionary
accessible as attributes. Meaning that you can get or set the values quickly as
follows:

.. doctest::

    >>> from easydev import AttrDict
    >>> d = AttrDict(**{'a': 1, 'b': 2})
    >>> d.a
    1
    >>> d.a = 10
    >>> d.a
    10

There are many such functions in **easydev** and the best is to have a
look at the :ref:`quickstart` section for more examples and the :ref:`ref_guide` guide for an
exhaustive list of tools available.

Note also that **easydev** was starting a few years ago and that some
functionalities did not exist back then. Some functionalities available in
easydev may now exist in standard modules of Python.

.. toctree::
    :maxdepth: 2
    :numbered:

    installation
    quickstart
    references