A lightweight library to attach and extract metadata from Python classes and functions.
Project description
datadesclib 📊
A lightweight Python library to attach metadata to classes and functions using decorators and extract them into structured JSON/dictionary formats.
Features
- Zero Dependencies: Uses only Python standard library (
inspect,json, etc.). - Type Hint Support: Automatically detects type annotations.
- Docstring Fallback: Uses docstrings as descriptions if no explicit metadata is provided.
- Flexible: Works with classes, methods, and global functions.
Installation
pip install datadesclib
Quick Start
1. Annotate your code
Use the @meta decorator to attach any custom information to your classes or functions.
from datadesclib import meta
@meta(author="Lukas", version="1.0", tags=["internal", "database"])
class UserData:
name: str
age: int = 25
@meta(description="Saves the user to the DB")
def save(self):
pass
2. Extract Metadata
You can extract information from a single object or parse an entire Python file.
Extract from object:
from datadesclib import extract
info = extract(UserData)
print(info)
Parse a whole file to JSON:
from datadesclib import parser
json_data = parser("my_script.py")
print(json_data)
License
CC0 1.0 Universal (Public Domain)
Copyright (c) 2026 FZJ-ICE-2
Developers: Celine Körner, Patrick Kuckertz, Johannes Jamroszczyk, Titan Hartono, Jann Weinand
About Us
We are the Institute of Climate and Energy Systems (ICE) - Jülich Systems Analysis belonging to the Forschungszentrum Jülich. Our interdisciplinary department's research is focusing on energy-related process and systems analyses. Data searches and system simulations are used to determine energy and mass balances, as well as to evaluate performance, emissions and costs of energy systems. The results are used for performing comparative assessment studies between the various systems. Our current priorities include the development of energy strategies, in accordance with the German Federal Government’s greenhouse gas reduction targets, by designing new infrastructures for sustainable and secure energy supply chains and by conducting cost analysis studies for integrating new technologies into future energy market frameworks.Acknowledgements
The authors would like to thank the German Federal Government, the German State Governments, and the Joint Science Conference (GWK) for their funding and support as part of the NFDI4Ing consortium. Funded by the German Research Foundation (DFG) - project number: 442146713.
This work was also supported by the Helmholtz Association under the program "Energy System Design".
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 datadesclib-0.1.1.tar.gz.
File metadata
- Download URL: datadesclib-0.1.1.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35e32671655ae521d4e8d7aaa25a0abef451b5ad5cf4d6ca2d91d1b1b71588ce
|
|
| MD5 |
0485a3036415711078ed3c83f4b8c5ec
|
|
| BLAKE2b-256 |
8048b60812ec1e174ef760967bfc1dfcaa9f8570fc0e40879a1fd1635039a442
|
File details
Details for the file datadesclib-0.1.1-py3-none-any.whl.
File metadata
- Download URL: datadesclib-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6788822ac687f932c2afa6faf34ade35216e04a474275fe9c003bf0087d04aa
|
|
| MD5 |
653af99f269c5ab173fe91e89ef61032
|
|
| BLAKE2b-256 |
0a0488cae9dbc3247e294c923fc9bb55deae92fc961a011fc0e3f1b3cf36e6ef
|