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.post1551.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for faker_sqlalchemy-0.9.220807.post1551.tar.gz
Algorithm Hash digest
SHA256 42d76cf1f5683af640921a1b91ff1a460fc2aa20e2e108c66421dcd88e6041fe
MD5 8a98834519cfed912d72448c1f0e5ba4
BLAKE2b-256 898e291229326e86918cced9cec59ca8af1e7aaff9d3635ab7c8b30dca665d47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for faker_sqlalchemy-0.9.220807.post1551-py3-none-any.whl
Algorithm Hash digest
SHA256 929fae7638ff0d94f6e3bb60e73b63033e133bb5640d5af23805c7a3b413d5c6
MD5 4b1673388fca4a750a4d17b49dde350d
BLAKE2b-256 090ac122755ef0fd0e7b40f1dd062786389932a06ca588f1b92ad22bdce2e445

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