Skip to main content

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

Project description

[![PyPI](https://img.shields.io/pypi/v/faker_sqlalchemy)](https://pypi.org/project/faker_sqlalchemy/) [![Supported Python versions](https://img.shields.io/pypi/pyversions/faker_sqlalchemy.svg)](https://pypi.org/project/faker_sqlalchemy/) [![Documentation](https://readthedocs.org/projects/faker-sqlalchemy/badge/?version=latest)](https://faker-sqlalchemy.readthedocs.io/en/latest/?badge=latest)

SQLAlchemy Faker is a provider for the Faker library that helps populate SQLAlchemh 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

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

Uploaded Source

Built Distribution

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

faker_sqlalchemy-0.10.220807-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file faker_sqlalchemy-0.10.220807.tar.gz.

File metadata

  • Download URL: faker_sqlalchemy-0.10.220807.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for faker_sqlalchemy-0.10.220807.tar.gz
Algorithm Hash digest
SHA256 98c43d65261b1b33f349ca7747f0e98b2152cc758e59faa11e3fd78fe4e91966
MD5 1ab97548dc1ec52839184174efe33896
BLAKE2b-256 c1612c309486e52f2de6d39e5159c8c2add80212296ed929923125585af87007

See more details on using hashes here.

File details

Details for the file faker_sqlalchemy-0.10.220807-py3-none-any.whl.

File metadata

File hashes

Hashes for faker_sqlalchemy-0.10.220807-py3-none-any.whl
Algorithm Hash digest
SHA256 c8c9cf7f8205ec1b93d8dbb76775d57d67c1fce630086237aa2c576c68c96574
MD5 d0fbb4d996f363720b1235e65aa0e62c
BLAKE2b-256 57960c699ae1539169eb03367d8877fca65dd2487b256d66e12ce6d1c532050f

See more details on using hashes here.

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