struct-tools
Printing dicts (and objects) legibly: keys aligned, arrays summarized,
nested reprs indented. Plus attribute (dot) access.
aligned: render key-value pairs with the keys aligned, summarizing arrays and indenting nestedreprs to their key.AlignedDict: a dict printed byaligned.DotDict: the same, plus attribute (dot) style access.AlignedRepr: provides__repr__(for subclassing) viaaligned.get0: the first value of a dict.
TODO
- Put DotDict and AlignedDict each in their own module
Changes in 0.3.0
The printing was replaced by the (much smaller) repr written for
MiniRes, which now shares it.
Consequently:
- The package is now only about printing dicts (plus dot access): the
dict/list utilities --
intersect,complement,prodct,transpsand thetranspose_*family,deep_getattr,deep_hasattr,flexcomp-- are gone. They originated in, and are already vendored by, DAPPER (dapper/tools/struct.py). 595 -> 190 lines. alignedandAlignedReprare new;NicePrintis an alias of the latter.printoptsis gone barindent;MIN_LINEWIDTHtoo.- Keys are no longer quoted,
__str__is no longer distinct from__repr__, and the line width is fixed (70) rather than the terminal's, so that output is reproducible. - Recursion is guarded by the stdlib's
reprlib.recursive_repr(...), rather than by hand. - numpy stays an optional, lazy dependency: arrays are summarized if it is already imported, and it is never imported on its account.
See alternatives:
- https://github.com/mewwts/addict
- https://github.com/ducdetronquito/scalpl
- https://github.com/srevenant/dictlib
- https://pypi.org/project/dict/
- https://pypi.org/project/dicty/
- https://pypi.org/project/print-dict/
- https://pypi.org/project/dictionaries/
- https://github.com/wolever/pprintpp
Answer SO.com questions: https://www.google.com/search?q=python+aligned+dict&oq=python+aligned+dict
Metadata
Release files for struct-tools 0.3.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 |
|---|---|---|---|---|
| struct_tools-0.3.0.tar.gz | 4.6 kB | Without provenance | Details for struct_tools-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| struct_tools-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for struct_tools-0.3.0-py3-none-any.whl |
Total release size: 9.6 kB
Release files / struct_tools-0.3.0.tar.gz
| Download URL | struct_tools-0.3.0.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c5a8cd299194b4d5e2d2a34945e213c9dfebdc0dfd023b8c56e32e084b996b8b
|
|
BLAKE2b-256 checksum How to use checksums |
199c1f4cbf78133841d8b3c4a8dcf05bd07a3a49d7a108de86d81eebd0a1679e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / struct_tools-0.3.0-py3-none-any.whl
| Download URL | struct_tools-0.3.0-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92ce7f4f8828e4b96f233b9b3521f98e3e69f3212d85e9c61625ed15998ddeec
|
|
BLAKE2b-256 checksum How to use checksums |
6dfa19b8b52485183eaa5458071de377a5f0e4a3f2e29d217ad3dff328e9ce7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for struct-tools 0.3.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.