A Faker provider that generates data based on SQL Alchemy column types.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file faker_sqlalchemy-0.9.220807.post1550.tar.gz
.
File metadata
- Download URL: faker_sqlalchemy-0.9.220807.post1550.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcad951e88c6c62d596691e8ed2ddd5ca27d4454e5181a514e31eeeb5927fd75 |
|
MD5 | 9a9d1749ac9ce87911bdbb8fe640cbcd |
|
BLAKE2b-256 | c4372309fa872c8ea7ea5821ea7a343860bdcefbf0873e7b862bf898ef8b2050 |
File details
Details for the file faker_sqlalchemy-0.9.220807.post1550-py3-none-any.whl
.
File metadata
- Download URL: faker_sqlalchemy-0.9.220807.post1550-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 723ced898f6b87d70c898841483837a68afdfc13c838e0faac10609a585187cf |
|
MD5 | 531a6f58b7671c98acb600b4d554a8dc |
|
BLAKE2b-256 | e0f2a9f46a2a07d80e9003ca14e035904608556e2e660f990b116b3fff7dfccd |