Skip to main content
# NesDict

[![Build Status](https://travis-ci.org/Kargathia/nesdict.svg?branch=master)](https://travis-ci.org/Kargathia/nesdict)

Intended to add easy-to-use lookup syntax to Python's builtin `dict()`, removing the need to chain `[]` operators or `.get()` calls.

Example:

```python
from nesdict import NesDict

xdata = NesDict({
'path': {
'to': {
'nested': {
'value': 'stuff',
'thing': 'more stuff',
'number': 42
},
'something': 'else'
}
}
})

xdata['/path/to/nested/value'] == 'stuff'

xdata.search('/path/to/nested/*') == [
('/path/to/nested/value', 'stuff'),
('/path/to/nested/thing', 'more stuff'),
('/path/to/nested/number', 42)
]

xdata.values() == ['stuff', 'more stuff', 42, 'else']
```

It also supports setting new values using the same syntax:

```python
xdata['/path/less/traveled/by'] = 'all the difference'

xdata['/path'] == {
'to': {
'nested': {
'value': 'stuff',
'thing': 'more stuff',
'number': 42
},
'something': 'else'
},
'less': {
'traveled': {
'by': 'all the difference'
}
}
}
```

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nesdict-0.3.0.tar.gz (11.8 kB view details)

Uploaded Source

File details

Details for the file nesdict-0.3.0.tar.gz.

File metadata

  • Download URL: nesdict-0.3.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for nesdict-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7aebb458a6c14b528c54d15925fa4428445404ccd860ec291645859bcca5f32a
MD5 077bd187eb885e6b2b7ca9323d0d00d0
BLAKE2b-256 90a731510e46de74f16aa942fae30f4614c08113d5e8eff3097c3f3ef5eb37f6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 file

0.2.0

1 file

0.1

1 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