Multiple access patterns for key-value reference
Project description
attmap
Key-value Mapping supporting nesting and attribute-style access.
Note: This package is no longer actively developed. Consider using plain dicts or dataclasses for new projects.
Originally designed for the pepkit family projects.
Install
pip install attmap
Class hierarchy
AttMapLike(abstract base)AttMap— dict-backed mapping with dot notation accessOrdAttMap— insertion-ordered (extendsOrderedDict)PathExAttMap— expands environment variables in path-like string valuesEchoAttMap— returns the key itself when a value is not set
Customizing subclasses
Excluding keys from text representation
Override _excl_from_repr in a subclass:
def _excl_from_repr(self, k, cls):
protected = ["reserved_metadata", "REZKEY"]
return k in protected
Excluding class name from repr
Override __repr__ using the exclude_class_list argument to _render:
def __repr__(self):
return self._render(
self._simplify_keyvalue(self._data_for_repr(), self._new_empty_basic_map),
exclude_class_list="YacAttMap",
)
Excluding classes from to_dict conversion
Override _excl_classes_from_todict:
def _excl_classes_from_todict(self):
return (pandas.DataFrame, ClassToExclude)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file attmap-0.14.0.tar.gz.
File metadata
- Download URL: attmap-0.14.0.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea9538fadc0d4c17f467f3a6ec508eb18460a16fb2a641c855ad5fdc2ae2b3be
|
|
| MD5 |
7233cd2361f105ed0a9e2faf932d24da
|
|
| BLAKE2b-256 |
157f6c92a6d49976ee58522a43d2d19e43f1b17cf4343c300b0d5fa7ea15adfd
|
Provenance
The following attestation bundles were made for attmap-0.14.0.tar.gz:
Publisher:
python-publish.yml on pepkit/attmap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
attmap-0.14.0.tar.gz -
Subject digest:
ea9538fadc0d4c17f467f3a6ec508eb18460a16fb2a641c855ad5fdc2ae2b3be - Sigstore transparency entry: 1180522144
- Sigstore integration time:
-
Permalink:
pepkit/attmap@d352170b5a15f72dbc1bac81f4f861f0a95e642e -
Branch / Tag:
refs/tags/v0.14.0 - Owner: https://github.com/pepkit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d352170b5a15f72dbc1bac81f4f861f0a95e642e -
Trigger Event:
release
-
Statement type:
File details
Details for the file attmap-0.14.0-py3-none-any.whl.
File metadata
- Download URL: attmap-0.14.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6899b57149228f35571873db591637c662eadbf9570496c168b8e3daaf36914d
|
|
| MD5 |
c114f2c2b2de1daf41bdc1024f09fab7
|
|
| BLAKE2b-256 |
aac2340a273067a82e6bcaf25781655c5bc9ea23063869c23bc898bd7944fc44
|
Provenance
The following attestation bundles were made for attmap-0.14.0-py3-none-any.whl:
Publisher:
python-publish.yml on pepkit/attmap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
attmap-0.14.0-py3-none-any.whl -
Subject digest:
6899b57149228f35571873db591637c662eadbf9570496c168b8e3daaf36914d - Sigstore transparency entry: 1180522153
- Sigstore integration time:
-
Permalink:
pepkit/attmap@d352170b5a15f72dbc1bac81f4f861f0a95e642e -
Branch / Tag:
refs/tags/v0.14.0 - Owner: https://github.com/pepkit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d352170b5a15f72dbc1bac81f4f861f0a95e642e -
Trigger Event:
release
-
Statement type: