attribute_dict
A subclass of dict that allows object-style access to its entries.
Installation
pipenv install attribute_dict
Usage
from attribute_dict import AttributeDict
sample_dict = AttributeDict({'foo': 'bar'})
sample_dict # => AttributeDict({'foo': 'bar'})
# The object is just subclassed from dict, and has all of the standard functions
isinstance(sample_dict, dict) # => True
# Create a new AttributeDict by "stacking" iterables
# Each iterable will overwrite keys in the previous one (kwargs are processed last!)
sample_dict = AttributeDict({'foo': 'foo'}, {'foo': 'ba', 'bar': 'foo'}, {'foo': 'bar'}, {'foobar': 'bar'}, foobar='foo')
# => AttributeDict({'foo': 'bar', 'bar': 'foo', 'foobar': 'foo'})
# Create a new AttributeDict by shallow-copying an existing one
new_sample_dict = sample_dict.copy()
new_sample_dict # => AttributeDict({'foo': 'bar', 'bar': 'foo', 'foobar': 'foo'})
isinstance(new_sample_dict, AttributeDict) # => True
# NOTE: Child values are NOT processed!
sample_dict = AttributeDict({'foo': iterable_two})
sample_dict # => AttributeDict({'foo': {'foo': 'ba', 'bar': 'foo'}})
sample_dict.foo # => {'foo': 'ba', 'bar': 'foo'}
sample_dict.__class__.__name__ # => 'AttributeDict'
sample_dict.foo.__class__.__name__ # => 'dict'
Tests
Tests use nose2. Clone the Github project. Install dev dependencies, and run tests using the nose2 command.
pipenv install --dev
pipenv shell
nose2
Metadata
Release files for attribute-dict 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| attribute_dict-1.0.0.tar.gz | 4.9 kB | Without provenance | Details for attribute_dict-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| attribute_dict-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for attribute_dict-1.0.0-py3-none-any.whl |
Total release size: 12.0 kB
Release files / attribute_dict-1.0.0.tar.gz
| Download URL | attribute_dict-1.0.0.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd6c646a3803a0c2350e44c6e0cd193460d7fca18944675633d4882c1f0ab509
|
|
BLAKE2b-256 checksum How to use checksums |
1275f80f88f1c3deb460122685dd149bd26ee56d18463ea0f49c01c7f2fc9256
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.1
|
Release files / attribute_dict-1.0.0-py3-none-any.whl
| Download URL | attribute_dict-1.0.0-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
205971dd6d418a0d03514bdf296099d6eb31795a9ac3189c5a646227f67074e7
|
|
BLAKE2b-256 checksum How to use checksums |
006373959ef6c40cd9f674bceb3c9d6087182ff57e58fc16c7568884757e0570
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.1
|
Security for attribute-dict 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.