Skip to main content

More convinient use of factory boy with sqlalchemy models

Project description

factory-boy-sqlalchemy

Why this package was created?

Most of factory-boy sqlalchemy packages, puts session in meta, so the factory is bound to session during creation.

In this package two helper functions are provided: make_async_sqlalchemy_factory and make_sync_sqlalchemy_factory, which takes session less factory and bind to the session - it allows to use the same factory with async and sync session

Example

import factory
from sqlalchemy.orm import DeclarativeBase

class Base(DeclarativeBase):
    ...

class User(Base):
    id_ = factory.Faker("name") 
    order = factory.Faker("between", from_=1, to=151)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

factory_boy_sqlalchemy-0.0.1.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

factory_boy_sqlalchemy-0.0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file factory_boy_sqlalchemy-0.0.1.tar.gz.

File metadata

  • Download URL: factory_boy_sqlalchemy-0.0.1.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for factory_boy_sqlalchemy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e9b4d714f3a9f3ad2c021bb466cc40363c877c37bdc122446d14fc2f5342fc5e
MD5 1c6ef667be226af7031606f6b2d73a07
BLAKE2b-256 a77a1d32a0be583a3a3ee4eea8ebb8cc0fc6e2e27555df3e7b8bf3aceddd6c06

See more details on using hashes here.

Provenance

The following attestation bundles were made for factory_boy_sqlalchemy-0.0.1.tar.gz:

Publisher: publish.yml on dswistowski/factory-boy-sqlalchemy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file factory_boy_sqlalchemy-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for factory_boy_sqlalchemy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a23a52575f35a13c869e164cc9842f0b2513bf5e61e34d896446b66b30778f47
MD5 7cd1d11734120866d9b3fcaa53de0590
BLAKE2b-256 52e43858dcf5e531a818ce24474f96e13d75c33a66042e49d8f117c68962d5eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for factory_boy_sqlalchemy-0.0.1-py3-none-any.whl:

Publisher: publish.yml on dswistowski/factory-boy-sqlalchemy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page