random-recipes


Namerandom-recipes JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://pypi.org/project/random-recipes/
SummaryRecipes to generate random instances of various types, beyond the scope of random.
upload_time2023-10-08 18:39:16
maintainer
docs_urlNone
authorIan Pearthree
requires_python>=3.11,<4.0
licenseMIT
keywords random
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Random Recipes

[![pypi](https://img.shields.io/pypi/v/random-recipes)](https://pypi.org/project/random-recipes/#history)
[![downloads](https://img.shields.io/pypi/dm/random-recipes)](https://pypistats.org/packages/random-recipes)
![tests](images/badges/tests.svg)
![coverage](images/badges/coverage.svg)

Recipes to generate random instances of various types, beyond the scope of [random](https://docs.python.org/3/library/random.html).

Python's [random](https://docs.python.org/3/library/random.html) implements generators for pseudo-random bytes, integers, and sequences.
In [random-recipes](https://github.com/ipear3/random-recipes) we collect additional functions to generate random instances of common object types, collection types, and file types that may be useful.

## Recipes

### Objects
| Object Type                                                                               | Function          |
|-------------------------------------------------------------------------------------------|-------------------|
| [bool](https://docs.python.org/3/library/stdtypes.html#boolean-values)                    | `random_bool`     |
| [bytes](https://docs.python.org/3/library/stdtypes.html?highlight=bytes#bytes-objects)    | `random_bytes`    |
| [decimal.Decimal](https://docs.python.org/3/library/decimal.html)                         | `random_decimal`  |
| [datetime.date](https://docs.python.org/3/library/datetime.html#date-objects)             | `random_date`     |
| [datetime.datetime](https://docs.python.org/3/library/datetime.html#datetime-objects)     | `random_datetime` |
| [float](https://docs.python.org/3/library/functions.html#float)                           | `random_float`    |
| [fractions.Fraction](https://docs.python.org/3/library/fractions.html#fractions.Fraction) | `random_fraction` |
| [int](https://docs.python.org/3/library/functions.html#int)                               | `random_int`      |
| [str](https://docs.python.org/3/library/stdtypes.html#str)                                | `random_str`      |

### Collections

| Collection Type                                                                                                   | Function       |
|-------------------------------------------------------------------------------------------------------------------|----------------|
| [dict](https://docs.python.org/3/library/stdtypes.html#mapping-types-dict)                                        | `random_dict`  |
| [collections.abc.Iterable[dict]](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable) | `random_dicts` |

### Files

| File Extension                                     | Function     |
|----------------------------------------------------|--------------|
| [.csv](https://docs.python.org/3/library/csv.html) | `random_csv` |


## Installation

Install the library with [pip](https://pip.pypa.io/en/stable/) from [PyPi](https://pypi.org/):
`pip install random-recipes`

---

## Development

`random-recipes` is developed by [@ipear3](https://github.com/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](https://github.com/more-itertools/more-itertools), a well-designed, simple extension to a Python's [itertools](https://docs.python.org/3/library/itertools.html).

### Packaging & Dependency Management
Get started with development by installing the project with `dev` and `test` dependency groups via [Poetry](https://python-poetry.org/): `poetry install --with dev`

### Formatting

We use [Black](https://black.readthedocs.io/en/stable/) to format our Python code.
We enforce black through a [pre-commit](https://pre-commit.com/) hook defined in [.pre-commit-config.yaml](.pre-commit-config.yaml).

### Testing

We use [pytest](https://github.com/pytest-dev/pytest) for testing, and our tests are located in [/tests](/tests).
We run our tests during the pre-push hook, `pytest`.

We use [coverage](https://github.com/nedbat/coveragepy) for test coverage, and we assert our test coverage is 95%.
Test coverage is checked during the pre-push hook, `coverage`.

### Documentation

We use [genbadge](https://smarie.github.io/python-genbadge/) to generate our `tests` and `coverage` [badges](/images/badges).
Badges are generated during the pre-push hooks `genbdage-tests` and `genbadge-coverage`.

### Releases, Tagging, and Versioning
Releases are automatically versioned by the poetry project's version in `pyproject.toml`.
Developers are responsible for incrementing the project version manually when they modify source code.
If they forget, the pre-push hook, `poetry-auto-semver` will increment the patch version by 1.

To create a release on [GitHub](https://github.com/ipear3/random-recipes/releases) and [PyPi](https://pypi.org/project/random-recipes/#history), push a commit to the `main` branch that affects any of the paths:
  - `random_recipes/**`
  - `pyproject.toml`
  - `poetry.lock`

The [release action](https://github.com/ipear3/random-recipes/actions/workflows/release.yml) will automatically:
1. Install the project
2. Test the project
3. Assert test coverage is 95%
4. Build the project for distribution
5. Create a GitHub release
   1. Autogenerate release notes
   2. Upload distribution files
6. Publish the project to PyPi

            

Raw data

            {
    "_id": null,
    "home_page": "https://pypi.org/project/random-recipes/",
    "name": "random-recipes",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11,<4.0",
    "maintainer_email": "",
    "keywords": "random",
    "author": "Ian Pearthree",
    "author_email": "52967928+ipear3@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/44/40/dba76ec7ff7844f8c43d0404bc318d952d464579212f8c27a77670dc60b0/random_recipes-0.1.0.tar.gz",
    "platform": null,
    "description": "# Random Recipes\n\n[![pypi](https://img.shields.io/pypi/v/random-recipes)](https://pypi.org/project/random-recipes/#history)\n[![downloads](https://img.shields.io/pypi/dm/random-recipes)](https://pypistats.org/packages/random-recipes)\n![tests](images/badges/tests.svg)\n![coverage](images/badges/coverage.svg)\n\nRecipes to generate random instances of various types, beyond the scope of [random](https://docs.python.org/3/library/random.html).\n\nPython's [random](https://docs.python.org/3/library/random.html) implements generators for pseudo-random bytes, integers, and sequences.\nIn [random-recipes](https://github.com/ipear3/random-recipes) we collect additional functions to generate random instances of common object types, collection types, and file types that may be useful.\n\n## Recipes\n\n### Objects\n| Object Type                                                                               | Function          |\n|-------------------------------------------------------------------------------------------|-------------------|\n| [bool](https://docs.python.org/3/library/stdtypes.html#boolean-values)                    | `random_bool`     |\n| [bytes](https://docs.python.org/3/library/stdtypes.html?highlight=bytes#bytes-objects)    | `random_bytes`    |\n| [decimal.Decimal](https://docs.python.org/3/library/decimal.html)                         | `random_decimal`  |\n| [datetime.date](https://docs.python.org/3/library/datetime.html#date-objects)             | `random_date`     |\n| [datetime.datetime](https://docs.python.org/3/library/datetime.html#datetime-objects)     | `random_datetime` |\n| [float](https://docs.python.org/3/library/functions.html#float)                           | `random_float`    |\n| [fractions.Fraction](https://docs.python.org/3/library/fractions.html#fractions.Fraction) | `random_fraction` |\n| [int](https://docs.python.org/3/library/functions.html#int)                               | `random_int`      |\n| [str](https://docs.python.org/3/library/stdtypes.html#str)                                | `random_str`      |\n\n### Collections\n\n| Collection Type                                                                                                   | Function       |\n|-------------------------------------------------------------------------------------------------------------------|----------------|\n| [dict](https://docs.python.org/3/library/stdtypes.html#mapping-types-dict)                                        | `random_dict`  |\n| [collections.abc.Iterable[dict]](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable) | `random_dicts` |\n\n### Files\n\n| File Extension                                     | Function     |\n|----------------------------------------------------|--------------|\n| [.csv](https://docs.python.org/3/library/csv.html) | `random_csv` |\n\n\n## Installation\n\nInstall the library with [pip](https://pip.pypa.io/en/stable/) from [PyPi](https://pypi.org/):\n`pip install random-recipes`\n\n---\n\n## Development\n\n`random-recipes` is developed by [@ipear3](https://github.com/ipear3).\nThis is a low-commitment project for practicing Python packaging, but it does try to contribute something of value.\nSuggestions, comments, and contributions are welcome.\n\nThis project draws inspiration from [more-itertools](https://github.com/more-itertools/more-itertools), a well-designed, simple extension to a Python's [itertools](https://docs.python.org/3/library/itertools.html).\n\n### Packaging & Dependency Management\nGet started with development by installing the project with `dev` and `test` dependency groups via [Poetry](https://python-poetry.org/): `poetry install --with dev`\n\n### Formatting\n\nWe use [Black](https://black.readthedocs.io/en/stable/) to format our Python code.\nWe enforce black through a [pre-commit](https://pre-commit.com/) hook defined in [.pre-commit-config.yaml](.pre-commit-config.yaml).\n\n### Testing\n\nWe use [pytest](https://github.com/pytest-dev/pytest) for testing, and our tests are located in [/tests](/tests).\nWe run our tests during the pre-push hook, `pytest`.\n\nWe use [coverage](https://github.com/nedbat/coveragepy) for test coverage, and we assert our test coverage is 95%.\nTest coverage is checked during the pre-push hook, `coverage`.\n\n### Documentation\n\nWe use [genbadge](https://smarie.github.io/python-genbadge/) to generate our `tests` and `coverage` [badges](/images/badges).\nBadges are generated during the pre-push hooks `genbdage-tests` and `genbadge-coverage`.\n\n### Releases, Tagging, and Versioning\nReleases are automatically versioned by the poetry project's version in `pyproject.toml`.\nDevelopers are responsible for incrementing the project version manually when they modify source code.\nIf they forget, the pre-push hook, `poetry-auto-semver` will increment the patch version by 1.\n\nTo create a release on [GitHub](https://github.com/ipear3/random-recipes/releases) and [PyPi](https://pypi.org/project/random-recipes/#history), push a commit to the `main` branch that affects any of the paths:\n  - `random_recipes/**`\n  - `pyproject.toml`\n  - `poetry.lock`\n\nThe [release action](https://github.com/ipear3/random-recipes/actions/workflows/release.yml) will automatically:\n1. Install the project\n2. Test the project\n3. Assert test coverage is 95%\n4. Build the project for distribution\n5. Create a GitHub release\n   1. Autogenerate release notes\n   2. Upload distribution files\n6. Publish the project to PyPi\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Recipes to generate random instances of various types, beyond the scope of random.",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://pypi.org/project/random-recipes/",
        "Repository": "https://github.com/ipear3/random-recipes"
    },
    "split_keywords": [
        "random"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2343679b166688a1343276e2d03286adf5bdc062a2928748a68fa9193302bd61",
                "md5": "263cf9eb0a22d9afe6a6663b2f0e5a59",
                "sha256": "5a784b2ee8dea922d9f5d0347a8485bf18807d0dae294e15a255103eb96a49ef"
            },
            "downloads": -1,
            "filename": "random_recipes-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "263cf9eb0a22d9afe6a6663b2f0e5a59",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11,<4.0",
            "size": 6372,
            "upload_time": "2023-10-08T18:39:15",
            "upload_time_iso_8601": "2023-10-08T18:39:15.134843Z",
            "url": "https://files.pythonhosted.org/packages/23/43/679b166688a1343276e2d03286adf5bdc062a2928748a68fa9193302bd61/random_recipes-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4440dba76ec7ff7844f8c43d0404bc318d952d464579212f8c27a77670dc60b0",
                "md5": "c275e7c0c3f2e0d98460c4f7ed817204",
                "sha256": "0c4c75d1fe7bdbc39d12b1a79b6d5966791242fcd02cbc888f1078b9dd4eacee"
            },
            "downloads": -1,
            "filename": "random_recipes-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c275e7c0c3f2e0d98460c4f7ed817204",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11,<4.0",
            "size": 5186,
            "upload_time": "2023-10-08T18:39:16",
            "upload_time_iso_8601": "2023-10-08T18:39:16.647441Z",
            "url": "https://files.pythonhosted.org/packages/44/40/dba76ec7ff7844f8c43d0404bc318d952d464579212f8c27a77670dc60b0/random_recipes-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-08 18:39:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ipear3",
    "github_project": "random-recipes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "random-recipes"
}
        
Elapsed time: 0.12202s