@@ -21,21 +21,19 @@ Dot Wiz
21
21
:alt: Updates
22
22
23
23
24
- A ``dict `` subclass that is *easy * to create, and supports *fast * dot access notation.
24
+ A `blazing fast `_ ``dict `` subclass that enables *dot access * notation via Python
25
+ attribute style. Nested ``dict `` and ``list `` values are automatically
26
+ transformed as well.
25
27
26
28
* Documentation: https://dotwiz.readthedocs.io.
27
29
28
- Installation
29
- ------------
30
-
31
- The Dot Wiz library is available `on PyPI `_, and can be installed with ``pip ``:
30
+ Install
31
+ -------
32
32
33
- .. code-block :: shell
33
+ .. code-block :: console
34
34
35
35
$ pip install dotwiz
36
36
37
- The ``dotwiz `` library officially supports **Python 3.6 ** or higher.
38
-
39
37
Usage
40
38
-----
41
39
@@ -63,11 +61,15 @@ creating a ``DotWiz`` object:
63
61
64
62
from dotwiz import make_dot_wiz
65
63
66
- dw = make_dot_wiz({'hello, world!': 123}, AnyKey='value', isActive=True)
64
+ dw = make_dot_wiz([('hello, world!', 123), ('easy: as~ pie?', True)],
65
+ AnyKey='value')
66
+
67
+ print(dw)
68
+ #> DotWiz(AnyKey='value', hello, world!=123, easy: as~ pie?=True)
67
69
68
70
assert dw['hello, world!'] == 123
71
+ assert dw['easy: as~ pie?']
69
72
assert dw.AnyKey == 'value'
70
- assert dw.isActive
71
73
72
74
Features
73
75
--------
@@ -83,8 +85,9 @@ Using a *dot-access* approach such as ``DotWiz`` can be up
83
85
to **100x ** faster than with `make_dataclass `_ from the ``dataclasses `` module.
84
86
85
87
It's also about *5x * faster to create a ``DotWiz `` from a ``dict `` object
86
- as compared to other libraries such as ``prodict ``, and up to *2x * faster
87
- in general to access keys by *dot * access.
88
+ as compared to other libraries such as ``prodict `` -- or close to **15x ** faster
89
+ than creating a `Box `_ -- and up to *10x * faster in general to access keys
90
+ by *dot * access -- or almost **30x ** faster than accessing keys from a `DotMap `_!
88
91
89
92
Contributing
90
93
------------
@@ -99,11 +102,14 @@ Credits
99
102
100
103
This package was created with Cookiecutter _ and the `rnag/cookiecutter-pypackage `_ project template.
101
104
105
+ .. _blazing fast : https://dotwiz.readthedocs.io/en/latest/benchmarks.html#results
102
106
.. _Read The Docs : https://dotwiz.readthedocs.io
103
107
.. _Installation : https://dotwiz.readthedocs.io/en/latest/installation.html
104
108
.. _on PyPI : https://pypi.org/project/dotwiz/
105
109
.. _make_dataclass : https://docs.python.org/3/library/dataclasses.html#dataclasses.make_dataclass
106
110
.. _benchmark : https://github.com/rnag/dotwiz/tree/main/benchmarks
111
+ .. _Box : https://github.com/cdgriffith/Box/wiki/Quick-Start
112
+ .. _DotMap : https://pypi.org/project/dotmap
107
113
.. _`Contributing` : https://dotwiz.readthedocs.io/en/latest/contributing.html
108
114
.. _`open an issue` : https://github.com/rnag/dotwiz/issues
109
115
.. _Cookiecutter : https://github.com/cookiecutter/cookiecutter
0 commit comments