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
Close
Hashes for faker_sqlalchemy-0.9.220807.post1550.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcad951e88c6c62d596691e8ed2ddd5ca27d4454e5181a514e31eeeb5927fd75 |
|
MD5 | 9a9d1749ac9ce87911bdbb8fe640cbcd |
|
BLAKE2b-256 | c4372309fa872c8ea7ea5821ea7a343860bdcefbf0873e7b862bf898ef8b2050 |
Close
Hashes for faker_sqlalchemy-0.9.220807.post1550-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 723ced898f6b87d70c898841483837a68afdfc13c838e0faac10609a585187cf |
|
MD5 | 531a6f58b7671c98acb600b4d554a8dc |
|
BLAKE2b-256 | e0f2a9f46a2a07d80e9003ca14e035904608556e2e660f990b116b3fff7dfccd |