Skip to main content

Generator real fake data for testing

Project description

baraqda-lib

dev Library to generate fake data reflects real data.

State: PoC

Library take counter(how much data should be generated) and language(specifies folder in which data should be written). After invocation func generate(), data are reading to _data and weights. In next step the data is randomized and added to variable _draw. This end the process of randomization and return List of generated data. We can also invocate function stored_draw() which returns data from last draw.

How to run

After downloading folder, install libraries from requirements.txt

pip install -r requirements.txt

Run examples to check if everything is correct.

python3 example.py python3 example_addresses.py python3 example_person.py

Generating data

Generating data take place in class Generator(). Instance of this class provide function to read data, store data, display data that was read from files and most import make a toss.

Functions in Generator()

generator.draw(lang: str, data_type: str, count: int = 1, sep: str = ' ') -> List[str]

Generate list of toss. This func isn't for normal use. Use generator.generate() instead.

.generator.search_files(path, sep, lang) -> None:

Search for files in folder Data and read them with func generator.read_files(). Running this function erase all stored data and read it again. Use with caution!

generator.read_files(filepath, separator, lang, filename) -> None:

Read files in desired path. You can use this function to read additional files but remember that names of files must be unique.

generator.generate(lang: str, data_type: str, counter: int = 1, sep: str = ' ') -> List[str]

Automation to search for files, read them and make a toss. This is default function that you should use.

Example

generator.generate('PL', 'female_first_name', 10, '\t')

Generating 10 polish, female first names. The \t point separator in files.

Output

generator.access_data(lang: str, data_type: str) -> Dict[str, list]

Check if data is stored in class. If yes, returns this data. If no, print error message.

Example

generator.access_data('PL', 'male_first_name')

OUTPUT

Generate polish person and address

To generate person and address we can use class Person and class Addresses This two class generate only fake polish person.

Library generate only person nat

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

baraqda-lib-0.0.11.tar.gz (7.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

baraqda_lib-0.0.11-py3-none-any.whl (7.2 MB view details)

Uploaded Python 3

File details

Details for the file baraqda-lib-0.0.11.tar.gz.

File metadata

  • Download URL: baraqda-lib-0.0.11.tar.gz
  • Upload date:
  • Size: 7.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for baraqda-lib-0.0.11.tar.gz
Algorithm Hash digest
SHA256 5433ba397ae2300619f94a061c5f7daaa840f7fd1acb1b729d5655fe5c003e69
MD5 a3c4bbafe175d19cda8e44d554a293ce
BLAKE2b-256 7646c89fef2d06045a91ab6438157b8afdc49971767492031d52882482796f7c

See more details on using hashes here.

File details

Details for the file baraqda_lib-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: baraqda_lib-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 7.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for baraqda_lib-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 b37f159a282bf4deeb490c98f9f6ecbe4b1710d983349fa13b59c0f57982023a
MD5 e556a13adb392b1f90296e04ca5899a8
BLAKE2b-256 98f1c6641b107942f7a1669d992dc23587458a3ee997f51172f1b643b789fef7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page