ctx
ctx - A minimal but opinionated dict/object combo (like Bunch).
Requirements
The ctx module should work with all versions of Python.
Features
The ctx module provides the Ctx class which is a subclass of the python ‘dict’ object.
Ctx modifies ‘dict’ in the following ways:
1 The dictionary items can be read or set using attribute access notation.
‘ctx.a’ is identical to ‘ctx[“a”]’ and ‘ctx.a = 5’ is identical to ‘ctx[“a”] = 5’
2 The objects attributes can be read using item access notation.
‘ctx[“__doc__”]’ is identical to ‘ctx.__doc__’
3 The objects attributes can not be set under any circumstances.
4 The dictionary can not have a key with the same name as an objects attribute.
‘ctx.name’ and ‘ctx[“name”]’ are resolved using the following three steps.
if the object has an attribute ‘name’ then return the attribute.
b) if the dictionary has a key ‘name’ then return the value associated with the key.
raise LookupError.
‘ctx.name = 5’ and ‘ctx[“name”] = 5’
If name is an attribute of the class then raise AttributeError.
set the dictionary item as usual.
Installation
You can install this package using pip with the following command.
pip install ctx
Support
To report any bugs, or ask any question, please visit
https://github.com/figlief/ctx/issues.
Resources
Here is a list of useful links about this project.
Changelog on GitHub <https://github.com/figlief/ctx/blob/master/History.rst>
Metadata
Release files for ctxpy 0.1.3
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 |
|---|---|---|---|---|
| ctxpy-0.1.3.tar.gz | 3.3 kB | Without provenance | Details for ctxpy-0.1.3.tar.gz |
Release files / ctxpy-0.1.3.tar.gz
| Download URL | ctxpy-0.1.3.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
848d72da7a4647effba4292ff76754280d704a594d3f5c58fb9c292d1377f50c
|
|
BLAKE2b-256 checksum How to use checksums |
093174891e138076b5116dd7a8ffb6dcfd721ed011048e827bd6540b306c026f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.10
|
Security for ctxpy 0.1.3
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.