wardrobe is a Python project about datastructures to manage contexts. It currently provides one class: StackedDict.
StackedDict is a dictionary-like object with additional methods to save the current state (commit) and restore it (reset).
Example:
>>> from wardrobe import StackedDict
>>> clark = StackedDict(top='blue bodysuit', bottom='red underpants',
... sex_appeal=True)
>>> clark['bottom']
'red underpants'
>>> clark['friend'] = 'Lois'
>>> dict(clark) == {'top': 'blue bodysuit',
... 'bottom': 'red underpants',
... 'friend': 'Lois',
... 'sex_appeal': True}
True
>>> clark.commit() # doctest: +ELLIPSIS
<wardrobe.stackeddict.StackedDict object at 0x...>
>>> clark.update({'top': 'shirt', 'bottom': 'jeans', 'head': 'glasses'})
>>> del clark['sex_appeal']
>>> dict(clark) == {'top': 'shirt',
... 'bottom': 'jeans',
... 'head': 'glasses',
... 'friend': 'Lois'}
True
>>> clark.reset() # doctest: +ELLIPSIS
<wardrobe.stackeddict.StackedDict object at 0x...>
>>> dict(clark) == {'top': 'blue bodysuit',
... 'bottom': 'red underpants',
... 'friend': 'Lois',
... 'sex_appeal': True}
True
wardrobe.StackedDict is useful to create context objects, like Django’s django.template.context:Context objects.
Ressources
online documentation: http://wardrobe.readthedocs.org
PyPI page: http://pypi.python.org/pypi/wardrobe
code repository: https://github.com/benoitbryon/wardrobe
bugtracker: https://github.com/benoitbryon/wardrobe/issues
Metadata
Release files for wardrobe 0.1
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 |
|---|---|---|---|---|
| wardrobe-0.1.zip | 11.6 kB | Without provenance | Details for wardrobe-0.1.zip |
Release files / wardrobe-0.1.zip
| Download URL | wardrobe-0.1.zip |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58dc8ea04287e6c5ef64e7ded7f145105b8830ca75081a2c9109f4c07b55f4ac
|
|
BLAKE2b-256 checksum How to use checksums |
25f3214f411f8dc639ea8fbfd4ae2c9cc25f43fa43ef618ab34318c3699da1f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for wardrobe 0.1
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.