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 SQLAlchemy 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.10.220813.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31d58f0fb42d913fc3a525514b7bfe8ce83eabf59b088e8d181866d3a9854914 |
|
MD5 | 2e617df308baaac71205bbee2c76abbb |
|
BLAKE2b-256 | a23558186ae77e7f9a1a216254f8d1a9fce9aa4c9ec990b5c1e162eca27a285a |
Close
Hashes for faker_sqlalchemy-0.10.220813-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83d57254d3fb1a48393e0d1061c5ca89382fe4456b126129b7422c5538747bdb |
|
MD5 | c59915d2a3acda8b970f67abc67d5d0e |
|
BLAKE2b-256 | a72eaab724d4a1aaa1125cca12df477e07c63c98db28573784665e0cbefa3984 |