Metadata-Version: 2.1
Name: faker_sqlalchemy
Version: 0.9.220807.post1554
Summary: A Faker provider that generates data based on SQL Alchemy column types.
Author-email: The Magnificant Nick <send-me-spam@yahoo.com>
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Testing :: Unit
Classifier: Topic :: Software Development :: Testing :: Mocking
Classifier: Topic :: Utilities
Requires-Dist: faker >=10.0
Requires-Dist: sqlalchemy >=1.3,<2.0
Requires-Dist: sphinx ; extra == "doc"
Requires-Dist: sphinx-rtd-theme ; extra == "doc"
Requires-Dist: black ; extra == "test"
Requires-Dist: tox >=4.0.b2 ; extra == "test"
Project-URL: Documentation, https://faker-sqlalchemy.readthedocs.io/en/latest/
Project-URL: Homepage, https://github.com/nickswebsite/faker-sqlalchemy
Project-URL: Source, https://github.com/nickswebsite/faker-sqlalchemy
Provides-Extra: doc
Provides-Extra: test

Fakers for SQLAlchemy
=====================

`SQLAlchemy Faker <https://faker-sqlalchemy.readthedocs.io/en/latest/>`_ is a provider for the
`Faker <https://github.com/joke2k/faker>`_ library that helps populate `SQLAlchemh ORM <https://www.sqlalchemy.org/>`_
models with dummy data. Creating a new instance of a model can be as simple as calling
``fake.sqlalchemy_model(SomeModel)``.

xxx

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

