Skip to main content

Slovar

Slovar is named dicts on steroids (cheesy!) with extra functionalities (lots of them). Widely used in prf, jobs and datasets.

Some of more prominent features are:

  1. flattening/unflattening

  2. rich extracting

  3. subsetting

  4. typecasting/type converting

  5. dot notation access

  6. update/merge

Setting up & testing

mkvirtualenv slovar_test #or any other way of venv
pip install -r requirements.test
pytest
pytest benchmarks/

Examples:

In [1]: from slovar import slovar

In [2]: d = slovar({'a':1, 'b': 2, 'c.c1': '11'})

In [3]: d
Out[3]: {'a': 1, 'b': 2, 'c.c1': '11'}

In [4]: d.unflat()
Out[4]: {'a': 1, 'b': 2, 'c': {'c1': '11'}}

In [5]: d.unflat().extract('c.c1')
Out[5]: {'c': {'c1': '11'}}

In [9]: d.unflat().extract('c').c.asint('c1')
Out[9]: 11


In [10]: d
Out[10]: {'a': 1, 'b': 2, 'c.c1': '11'}

In [11]: dd = d.unflat()

In [12]: dd.c.c1
Out[12]: '11'

In [14]: dd.flat() == d
Out[14]: True

Release files for slovar 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for slovar 1.0.2
File Size Uploaded
slovar-1.0.2.tar.gz 19.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for slovar 1.0.2
File Interpreter ABI Platform
slovar-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 42.9 kB

Release files / slovar-1.0.2.tar.gz

Download URL slovar-1.0.2.tar.gz
Size 19.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3e42bb91a7b31f6b17380400c7a18a7280891a16eeeab268e72a9976a1bf77ea
BLAKE2b-256 checksum
How to use checksums
9a0a22c33b320951976fcd5fa487a653233f6548cbac618bef73d1835481729c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.6

Release files / slovar-1.0.2-py3-none-any.whl

Download URL slovar-1.0.2-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd86c713265a738f68cf1ba690b2184c53ad00ae601bd3145e1a8e7ab17cc18a
BLAKE2b-256 checksum
How to use checksums
9b13d51c6ac775a277b5987e14b3300f56d864c6b06847abcd1abaa1af4f66af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.6

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page