[](https://pypi.org/project/faker_sqlalchemy/) [](https://pypi.org/project/faker_sqlalchemy/) [](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
Release files for faker_sqlalchemy 0.10.220807
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| faker_sqlalchemy-0.10.220807.tar.gz | 9.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| faker_sqlalchemy-0.10.220807-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.3 kB
Release files / faker_sqlalchemy-0.10.220807.tar.gz
| Download URL | faker_sqlalchemy-0.10.220807.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
98c43d65261b1b33f349ca7747f0e98b2152cc758e59faa11e3fd78fe4e91966
|
|
BLAKE2b-256 checksum How to use checksums |
c1612c309486e52f2de6d39e5159c8c2add80212296ed929923125585af87007
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|
Release files / faker_sqlalchemy-0.10.220807-py3-none-any.whl
| Download URL | faker_sqlalchemy-0.10.220807-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8c9cf7f8205ec1b93d8dbb76775d57d67c1fce630086237aa2c576c68c96574
|
|
BLAKE2b-256 checksum How to use checksums |
57960c699ae1539169eb03367d8877fca65dd2487b256d66e12ce6d1c532050f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|