Skip to main content

Recipes to generate random instances of various types, beyond the scope of random.

Project description

Random Recipes

pypi downloads tests coverage

Recipes to generate random instances of various types, beyond the scope of random.

Python's random implements generators for pseudo-random bytes, integers, and sequences. In random-recipes we collect additional functions to generate random instances of common types that may be useful.

Recipes

Type Function
bool random_bool
bytes random_bytes
decimal.Decimal random_decimal
datetime.date random_date
datetime.datetime random_datetime
float random_float
fractions.Fraction random_fraction
str random_str

Installation

Install the library with pip from PyPi: pip install random-recipes


Development

random-recipes is developed by @ipear3. This is a low-commitment project for practicing Python packaging, but it does try to contribute something of value. Suggestions, comments, and contributions are welcome.

This project draws inspiration from more-itertools, a well-designed, simple extension to a Python's itertools.

Packaging & Dependency Management

Get started with development by installing the project with dev and test dependency groups via Poetry: poetry install --with dev

Testing

Although tests are automatically run pre-commit, developers must agree to create robust tests.

Releases

Releases are triggered automatically by commits to branch main with a tag like *.*.*, thanks to the Release action. The release action is defined in release.yml.

Tags

Commits tagged like *.*.* are the trigger of releases.

Standards

Project standards are enforced by pre-commit hooks and GitHub Actions.

Standard Script Pre-commit Hook GitHub Action
Source changes should bump the project version. poetry version patch/minor/major
README.md should display badges for tests, coverage. scripts/tests-and-coverage.sh
Code should be formatted by Black. black . black
Source changes should pass pytest. pytest
Test coverage percentage should be 100%. coverage
pyproject.toml should be kept up to-date. poetry-check
poetry.lock should be kept up-to-date. poetry-lock
Source changes should be tagged. git tag $(poetry version --short)
Source changes should be released. Release

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

random_recipes-0.0.6.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

random_recipes-0.0.6-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

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