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.2.tar.gz (29.8 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.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: factory_boy_sqlalchemy-0.0.2.tar.gz
  • Upload date:
  • Size: 29.8 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.2.tar.gz
Algorithm Hash digest
SHA256 79389ca42936ea438668e854dde89064381baafc2b32e8b936a71e77dc5eb3fe
MD5 493892589c164c913416946df1f890a2
BLAKE2b-256 249781e03e64f8e20a7212617c4d99a0e96f7c05d1b449bed1d38765bd3a8007

See more details on using hashes here.

Provenance

The following attestation bundles were made for factory_boy_sqlalchemy-0.0.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for factory_boy_sqlalchemy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 53ab73970a1c405238f7448b2d348dfd2fc9ac8ae3755be97b68839848569593
MD5 cda6448af73fbd2c58c5187105a30526
BLAKE2b-256 6092fb87826dde1b2914a578dd97cd5b083260aed140b5c3fd314b7bed4048c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for factory_boy_sqlalchemy-0.0.2-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