Skip to main content

SQLAlchemy Flattener

This tool allows you to have the DX of defining test data with the ORM - nested as deeply as you like - then recursively flattening that data to either python dicts for bulk inserts, or just raw SQL insert statements for maximum seeding speed between tests.

Works really well in conjunction with polyfactory

Usage

$ sqlflat --help

usage: sqlflat [-h] [--format {dict,sql}] instances order output

Flatten SQLAlchemy ORM instances.

positional arguments:
  instances            The module namespace containing the model instances, e.g. `foo.bar.instance_list`
  order                The module namespace containing a sequence of table insert ordering.
  output               The output file path to write the flattened data to.

options:
  -h, --help           show this help message and exit
  --format {dict,sql}  The format to write the data in.

Where insertion_ordering_list is a list of model classes or sqlalchemy.Table instances, but not declarative model instances. Take a look at the examples directory.

Metadata

Release files for sqlalchemy-flattener 0.5.0

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

Source distribution (sdist)

Source distribution for sqlalchemy-flattener 0.5.0
File Size Uploaded Provenance
sqlalchemy_flattener-0.5.0.tar.gz 29.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlalchemy-flattener 0.5.0
File Interpreter ABI Platform
sqlalchemy_flattener-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 35.6 kB

Release files / sqlalchemy_flattener-0.5.0.tar.gz

Download URL sqlalchemy_flattener-0.5.0.tar.gz
Size 29.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e2936f16ada95fdd016fc8ff763e01516ad6624b8fed1999dd85a22b8847dd3c
BLAKE2b-256 checksum
How to use checksums
fa41d38daee12c67a1f59265a72e766dd4723cf4f5fefc1bd1ce5dbbcbd8556d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.14

Release files / sqlalchemy_flattener-0.5.0-py3-none-any.whl

Download URL sqlalchemy_flattener-0.5.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf15da25c0ff259726dcb66969f9c94f5bdbfa92e9dce730c3ddff4525d5d8ba
BLAKE2b-256 checksum
How to use checksums
e982702fc2fb4b15efe4f7c137dcbd881e463d6329c50f0ffac4e95ca185db47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.14

Security for sqlalchemy-flattener 0.5.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.

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