Runtime Access for Class Attribute Docstrings
Project description
RACAD
RACAD stands for Runtime Access for Class Attribute Docstrings. This is the source code accompanying my blogpost (not online yet).
You can copy this code into your own project or use it as a library.
Usage
Given a class defined as follows:
class MyClass:
a: int = 5
"""This is the docstring of a."""
to get the attribute docstring of one attribute of a class by its name, use:
from racad import get_attribute_docstring
get_attribute_docstring(MyClass, 'a')
# Output: 'This is the docstring of a.'
alternatively, to get all docstrings of all attributes of a class, use:
from racad import get_attribute_docstrings
get_attribute_docstrings(MyClass)
# Output: {'a': 'This is the docstring of a.'}
Limitation
Requires source code access via the inspect module.
E.g. does not work if the class has been defined in a REPL.
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 racad-0.1.0.tar.gz.
File metadata
- Download URL: racad-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9207d2377570e96d942d533c033a6604394e60d67dcae8df3546b59b46cb6649
|
|
| MD5 |
7038ec3074dc434466c2dd65937d1cb8
|
|
| BLAKE2b-256 |
003d8dc70b527587599dd4138b96bedc8dab7db2c5395ca3fbd3805827947a35
|
Provenance
The following attestation bundles were made for racad-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on Lucas-Steinmann/racad
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
racad-0.1.0.tar.gz -
Subject digest:
9207d2377570e96d942d533c033a6604394e60d67dcae8df3546b59b46cb6649 - Sigstore transparency entry: 150806716
- Sigstore integration time:
-
Permalink:
Lucas-Steinmann/racad@1ac69b1df96346025cf805bd840fac39cc715943 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Lucas-Steinmann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@1ac69b1df96346025cf805bd840fac39cc715943 -
Trigger Event:
release
-
Statement type:
File details
Details for the file racad-0.1.0-py3-none-any.whl.
File metadata
- Download URL: racad-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
651b3f651228957d6a1082f4eca6af18f3d7e6b644a7b3536a94a966594f0429
|
|
| MD5 |
b2c15a53cdd4676bcd37c356cb2cc439
|
|
| BLAKE2b-256 |
7d4957fd4888a8f4d47c602101d556919c72d2c33459c0a028703a7834ca520e
|
Provenance
The following attestation bundles were made for racad-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on Lucas-Steinmann/racad
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
racad-0.1.0-py3-none-any.whl -
Subject digest:
651b3f651228957d6a1082f4eca6af18f3d7e6b644a7b3536a94a966594f0429 - Sigstore transparency entry: 150806717
- Sigstore integration time:
-
Permalink:
Lucas-Steinmann/racad@1ac69b1df96346025cf805bd840fac39cc715943 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Lucas-Steinmann
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@1ac69b1df96346025cf805bd840fac39cc715943 -
Trigger Event:
release
-
Statement type: