Skip to main content

exdrf-gen-al2at

exdrf-gen-al2at is an exdrf-gen plugin that generates attrs-based Python modules from an ExDataset built from your SQLAlchemy declarative models. Output is driven by Jinja2 templates under al2at_templates/ and the composite tree in exdrf_gen.fs_support (TopDir, CategDir, ResFile, …).

Python 3.12.2+ is required.

What it generates

Layout under the output directory:

  • Root __init__.py, api.py
  • Per category: {category}/__init__.py, {category}/api.py
  • Per resource: {category}/{resource}.py from c/m.py.j2

Templates receive out_module, db_module, type_to_attrs, and standard dataset/resource context from exdrf-gen (see the exdrf-gen README for fs_support and preserve markers).

Dependencies

Declared in pyproject.toml for this package:

  • attrs

You also need (same environment as your SQLAlchemy models):

  • exdrf-gen — shared CLI, Jinja environment, fs_support
  • exdrf-al — GetDataset and dataset_from_sqlalchemy for the DATASET argument
  • click — used by the CLI

Install the plugin package in editable or release form alongside those dependencies.

Command-line usage

The command is registered on the shared exdrf_gen Click group. With exdrf-gen installed:

exdrf-gen al2at DATASET OUT-PATH OUT-MODULE DB-MODULE

Same entry point via python -m exdrf_gen (loads plugins, then the CLI):

python -m exdrf_gen al2at DATASET OUT-PATH OUT-MODULE DB-MODULE

Arguments:

  • DATASET — module.path:Symbol pointing to your SQLAlchemy declarative Base (or equivalent). Resolved by exdrf_al.click_support.GetDataset.
  • OUT-PATH — output directory (created as needed). Override with env var EXDRF_AL2AT_PATH.
  • OUT-MODULE — Python package name for generated imports.
  • DB-MODULE — module where SQLAlchemy model classes live (passed into templates).

Global options on the root group include --debug.

Python API

from exdrf_gen_al2at.creator import generate_attrs_from_alchemy
from exdrf_gen.jinja_support import jinja_env

generate_attrs_from_alchemy(
    d_set=dataset,
    out_path="/path/to/out",
    out_module="my_app.generated",
    db_module="my_app.db.models",
    env=jinja_env,
)

Plugin registration

This package registers:

[project.entry-points.'exdrf.plugins']
exdrf_gen = 'exdrf_gen_al2at'

Importing exdrf_gen_al2at calls install_plugin with the template directory so jinja_env can resolve al2at_templates.

See also

  • exdrf-gen — README.md (plugins, Jinja, fs_support)

Metadata

Release files for exdrf-gen-al2at 0.1.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for exdrf-gen-al2at 0.1.18
File Size Uploaded Provenance Actions
exdrf_gen_al2at-0.1.18.tar.gz 5.3 kB Without provenance Details for exdrf_gen_al2at-0.1.18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for exdrf-gen-al2at 0.1.18
File Interpreter ABI Platform Actions
exdrf_gen_al2at-0.1.18-py3-none-any.whl Python 3 none any Details for exdrf_gen_al2at-0.1.18-py3-none-any.whl

Total release size: 11.2 kB

Release files / exdrf_gen_al2at-0.1.18.tar.gz

Download URL exdrf_gen_al2at-0.1.18.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
54de97fc39baff38103d7888f414461583c43404b866b112c77db6378f36f4b7
BLAKE2b-256 checksum
How to use checksums
b0323cb4bcb9a9128f66a258404719bf797c5932d16b772e64825f9a82c0779a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / exdrf_gen_al2at-0.1.18-py3-none-any.whl

Download URL exdrf_gen_al2at-0.1.18-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbd0ee438a0985fc57f0c8d7c70c7012431df9b6738203b83c349bc4c81a7364
BLAKE2b-256 checksum
How to use checksums
9ce56cc4c7167037024a5b808f15d26c58bb9125c31d2d61af64e6635293e76a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Security for exdrf-gen-al2at 0.1.18

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page