Generate data randomly
Project description
randog 0.6.0 — Randomly object generator
randog is a package which helps to generate data randomly.
Install
You can install from PyPI.
pip install -U randog
Usage
For example:
import uuid
import randog.factory
factory = randog.factory.from_example({"uuid": uuid.uuid4, "name": "", "age": 20})
generated = factory.next()
assert isinstance(generated, dict)
assert isinstance(generated["uuid"], uuid.UUID)
assert isinstance(generated["name"], str)
assert isinstance(generated["age"], int)
See the documentation for more details.
Types that can be generated
- int, float, str, etc.
- tuple, list, dict
- datetime, date, time, timedelta
- (Experimental feature) Model instance of SQLAlchemy
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
randog-0.6.0.tar.gz
(26.6 kB
view hashes)
Built Distribution
randog-0.6.0-py3-none-any.whl
(45.9 kB
view hashes)