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).
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
Release files for faker_sqlalchemy 0.9.220807.post1554
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.9.220807.post1554.tar.gz | 9.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| faker_sqlalchemy-0.9.220807.post1554-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.7 kB
Release files / faker_sqlalchemy-0.9.220807.post1554.tar.gz
| Download URL | faker_sqlalchemy-0.9.220807.post1554.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a7a1382669e7dcc17246332b0f2c8d1aebd246b67c6789818b2bc09a1b254e1
|
|
BLAKE2b-256 checksum How to use checksums |
160c5c8f88c310778616f7a35abff2b827bb7d2118c10c5f92d110008d5648c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|
Release files / faker_sqlalchemy-0.9.220807.post1554-py3-none-any.whl
| Download URL | faker_sqlalchemy-0.9.220807.post1554-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85fa250c9a24307d3d97741d8d67a6a5eb97b9ba961b87647f9688de682d185d
|
|
BLAKE2b-256 checksum How to use checksums |
4971d86065f0611ffad6c8aff5d89f9c78db95e176346146696892c548e4b124
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.28.1
|