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