Skip to main content

A Faker provider that generates data based on SQL Alchemy column types.

Project description

SQLAlchemy Faker is a provider for the Faker library that helps populate ORM models with dummy data. Creating a new instance of a model can be as simple as calling fake.sqlalchemy_model(SomeModel).

Installation

The recommend way to install SQLAlchemy Faker is with pip:

pip install faker_sqlalchemy

Example

Say you have some model declared using SQLAlchemy’s ORM.

>>> class SomeModel(Base):
...     __tablename__ = "some_model"
...
...     id = Column(Integer, primary_key=True)
...
...     value = Column(String)

And, you want to easily generate some data,

>>> from faker_sqlalchemy import SqlAlchemyProvider
>>>
>>> fake = Faker()
>>> fake.add_provider(SqlAlchemyProvider)
>>>
>>> instance = fake.sqlalchemy_model(SomeModel)

Use instance as desired.

>>> print(instance.value)
RNvnAvOpyEVAoNGnVZQU

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

faker_sqlalchemy-0.9.220807.post1552.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file faker_sqlalchemy-0.9.220807.post1552.tar.gz.

File metadata

File hashes

Hashes for faker_sqlalchemy-0.9.220807.post1552.tar.gz
Algorithm Hash digest
SHA256 f33d17da5432af56e836f3116f31385cc7a1ab8fd9c16d4cee16a30e0a16768b
MD5 3803a7a8f882cb3838725e2e8fdd40da
BLAKE2b-256 661b08a6fde5fbe798bc89f92e11e3ba453f6a7b0c274ed35ee1c632dd524d5f

See more details on using hashes here.

File details

Details for the file faker_sqlalchemy-0.9.220807.post1552-py3-none-any.whl.

File metadata

File hashes

Hashes for faker_sqlalchemy-0.9.220807.post1552-py3-none-any.whl
Algorithm Hash digest
SHA256 ebc2acc4eeb6afbcb9a07ca690ac352a1ad3316649079fecbbd4ec2526224513
MD5 457b8b12d88123f38b35948d0c7ae2f2
BLAKE2b-256 61e2a819dbdeb098b2b69d4f907cf882a1038ba0674165df477608a62dcdcf5c

See more details on using hashes here.

Supported by

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