API Reference
Submodules
datafaker.create module
datafaker.main module
datafaker.make module
datafaker.providers module
datafaker.settings module
Utils for reading settings from environment variables.
See module pydantic for enforcing type hints at runtime. See module functools.lru_cache to save time and memory in case of repeated calls. See module typing for type hinting.
Classes:
Settings
Functions:
get_settings() -> Settings
- class datafaker.settings.Settings(*args: Any, **kwargs: Any)
Bases:
BaseSettingsA Pydantic settings class with optional and mandatory settings.
Settings class attributes describe two database connection. The source database connection is the database schema from which the object relational model is discovered. The destination database connection is the location where tables based on the ORM is created and synthetic values inserted.
- src_dsn
A DSN for connecting to the source database.
- Type:
str
- src_schema
The source database schema to use, if applicable.
- Type:
str
- dst_dsn
A DSN for connecting to the destination database.
- Type:
str
- dst_schema
The destination database schema to use, if applicable.
- Type:
str
- class Config
Bases:
objectMeta-settings for the Settings class.
- validate_dst_dsn(dsn: Optional[str], values: Any) Optional[str]
Create and validate the destination DB DSN.
- validate_src_dsn(dsn: Optional[str], values: Any) Optional[str]
Create and validate the source DB DSN.
- exception datafaker.settings.SettingsError
Bases:
ExceptionAn error in the environment variables.
- datafaker.settings.get_destination_dsn() str
Return destination address or throw a validation error if it is not set.
- datafaker.settings.get_destination_schema() Optional[str]
Return destination schema.
- datafaker.settings.get_source_dsn() str
Return source address or throw a validation error if it is not set.
- datafaker.settings.get_source_schema() Optional[str]
Return source schema.