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 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
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.post1554.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a7a1382669e7dcc17246332b0f2c8d1aebd246b67c6789818b2bc09a1b254e1 |
|
MD5 | 477d042325813f7e711925496ed0471c |
|
BLAKE2b-256 | 160c5c8f88c310778616f7a35abff2b827bb7d2118c10c5f92d110008d5648c5 |
Close
Hashes for faker_sqlalchemy-0.9.220807.post1554-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85fa250c9a24307d3d97741d8d67a6a5eb97b9ba961b87647f9688de682d185d |
|
MD5 | 8d6756d1e01045372208807ed6df73ec |
|
BLAKE2b-256 | 4971d86065f0611ffad6c8aff5d89f9c78db95e176346146696892c548e4b124 |