Metadata-Version: 2.4
Name: rdm-ppl
Version: 0.2.0
Summary: Create random personal data.
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: python-dateutil>=2.8.2

# rdm-ppl

`rdm-ppl` generates random IDs, names, and dates. The PyPI distribution is named
`rdm-ppl`; the Python import is `rdm_ppl`.

## Install

Requires Python 3.10 or newer.

```cmd
python -m pip install rdm-ppl
```

For development, run this from the project directory:

```cmd
python -m pip install -e .
```

This also installs the `python-dateutil` dependency used for calendar year
calculations.

## Use

```python
from datetime import date
from rdm_ppl import gen_id, gen_name, gen_date

gen_id()                       # 8 alphanumeric characters
gen_id(12)                     # 12 alphanumeric characters
gen_name()                     # two names using the default syllables
gen_name(format=[2], syllables=["la"])  # "Lala"

gen_date()                     # between four years ago and today
gen_date(end=date(2024, 2, 29))  # four calendar years before end through end
gen_date(years=2)              # two calendar years ago through today
gen_date(end=date(2024, 2, 29), years=2)
gen_date(start=date(2020, 1, 1))  # given start through today
gen_date(start=date(2020, 1, 1), end=date(2024, 1, 1))
```

`gen_date` includes both range endpoints. Supply either `start` or `years`; if
neither is supplied, it uses four years. `end` defaults to today's local date.
Dates must be `datetime.date` objects. `gen_id` requires an integer length of at
least 1. `gen_name` uses its built-in syllables when `syllables` is omitted or
an empty list is passed. Each number in `format` must be at least 2.

## Run the tests

From the project directory in Command Prompt, install the project in editable
mode and run the standard-library test suite:

```cmd
python -m pip install -e .
python -m unittest discover -s tests -v
```

## Publish an update to PyPI

1. Change `version` in `pyproject.toml` to a new version. PyPI does not allow
   replacing an already uploaded distribution file.
2. Run the tests shown above.
3. Install the release tools and build the new distributions:

   ```cmd
   python -m pip install --upgrade build twine
   rmdir /s /q dist
   python -m build
   python -m twine check dist/*
   ```

4. Create a PyPI API token at [pypi.org](https://pypi.org/manage/account/token/).
   Upload the new wheel and source distribution:

   ```cmd
   python -m twine upload dist/*
   ```

   When prompted, use the API token, the full `pypi-...`
   token. You will not be asked for a username or password. Keep the token private. Check the release at
   [pypi.org/project/rdm-ppl](https://pypi.org/project/rdm-ppl/).


