semvec/pypi-packages huggingface dataset:
pytography 0.1.3
A library for password hashing and JWT encoding
License: MIT
Requires Python: >=3.6

# Pytography

A Python library that provides secure password hashing and JSON Web Token (JWT) functionality.

## Installation

```bash
pip install pytography
```
## Quick Start

### PHC String Format

The **PHC (Password Hashing Competition) string format** is a standardized way of representing password hashes for various algorithms. It includes all the necessary information to verify the password, including the hashing algorithm, parameters (e.g., cost factor, salt, and iteration count), and the resulting hash.

### Structure

The structure of a PHC string is as follows:
- **`<algorithm>`**: The name of the hashing algorithm used (e.g., `pbkdf2`, `scrypt`).
- **`<parameters>`**: The specific parameters used for the algorithm, such as the cost factor, salt, and iteration count.
- **`<hash>`**: The actual password hash.

### Why Use PHC Format?

1. **Portability**: The PHC format makes it easy to migrate password hashes between different systems.
2. **Security**: It ensures that all relevant parameters for hashing are stored alongside the hash, including salts and iteration counts.
3. **Standardization**: It provides a uniform format for representing password hashes across different hashing algorithms.

### Scrypt (with PHC format)

- `scrypt`: Indicates the scrypt hashing algorithm.
- `16384`: CPU/memory cost.
- `8`: Block size.
- `32`: Parallelization factor.
- The salt and hash are base64 encoded.
- PHC string format \$scrypt\$ln={n}\$r={r}\$p={p}\${salt}\${password_hash}

### Pbkdf2 (with PHC format)

- `pbkdf2`: Indicates the pbkdf2 hashing algorithm.
- `sha256`: The hash function to use.
- `600000`: The number of iterations to use for key derivation.
- The salt and hash are base64 encoded.
- PHC string format \$pbkdf2-{hash_name}\$i={iterations}\${salt}\${password_hash}

### Password Hashing with Scrypt (Default)
```python
from pytography import PasswordHashLibrary

encoded_password = PasswordHashLibrary.encode(password="password", algorithm="scrypt")
is_valid = PasswordHashLibrary.verify(password="password", encoded_password=encoded_password)
```

### Password Hashing with Pbkdf2
```python
from pytography import PasswordHashLibrary

encoded_password = PasswordHashLibrary.encode(password="password", algorithm="pbkdf2")
is_valid = PasswordHashLibrary.verify(password="password", encoded_password=encoded_password)
```

### JSON Web Token (JWT)
```python
from pytography import JsonWebToken
from datetime import datetime, timedelta, UTC

now = datetime.now(UTC)
exp = (now + timedelta(seconds=7200)).timestamp()

# Create a token
token = JsonWebToken.encode(payload={"exp": exp, "user_id": 123}, key="key")

# Decode token to get payload
header, payload, signature = JsonWebToken.decode(token=token)

# Verify token
is_valid = JsonWebToken.verify(token=token, key="key")
```

## License
This project is licensed under the terms of the LICENSE file included in the repository.

## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
pytest-rich 0.2.0
Leverage rich for richer test session output
License: MIT
Requires Python: >=3.9

===========
pytest-rich
===========

Leverage `rich`_ for richer test session output.

.. image:: https://img.shields.io/pypi/v/pytest-rich.svg
    :target: https://pypi.org/project/pytest-rich
    :alt: PyPI version

.. image:: https://img.shields.io/pypi/pyversions/pytest-rich.svg
    :target: https://pypi.org/project/pytest-rich
    :alt: Python versions

IMPORTANT: Proof-of-concept
---------------------------

This plugin is mostly a proof of concept and is **looking for a maintainer** which wants to adopt it.

The plugin currently outputs this:

.. image:: assets/screenshot.png
    :align: center

There's definitely room for improvement, and the new maintainers are free to improve on that or even change it completely.

I intend to *initially* add people as maintainers to this repository, and after a while eventually transfer it to another account.

The reason is that I played a bit with it and see promise in a full `pytest`_ + `rich`_ integration, but I don't have
the bandwidth to maintain yet another pytest plugin, so I'm opening the code to the community in the hope that someone
picks it up and gives it the treatment it deserves.

If you are interested, feel free to open an issue.

License
-------

Distributed under the terms of the `MIT`_ license, "pytest-rich" is free and open source software


----

This `pytest`_ plugin was generated with `Cookiecutter`_ along with `@hackebrot`_'s `cookiecutter-pytest-plugin`_ template.

.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter
.. _`@hackebrot`: https://github.com/hackebrot
.. _`MIT`: http://opensource.org/licenses/MIT
.. _`BSD-3`: http://opensource.org/licenses/BSD-3-Clause
.. _`GNU GPL v3.0`: http://www.gnu.org/licenses/gpl-3.0.txt
.. _`Apache Software License 2.0`: http://www.apache.org/licenses/LICENSE-2.0
.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin
.. _`file an issue`: https://github.com/nicoddemus/pytest-rich/issues
.. _`pytest`: https://github.com/pytest-dev/pytest
.. _`tox`: https://tox.readthedocs.io/en/latest/
.. _`pip`: https://pypi.org/project/pip/
.. _`PyPI`: https://pypi.org/project
.. _`rich`: https://github.com/Textualize/rich
how-old 0.0.4
Age Calculator CLI Tool
License: MIT
Requires Python: <4.0,>=3.11

# Age Calculator CLI Tool 🕰️

This simple Python script calculates your age based on your date of birth. It supports command-line inputs for the year, month, and day of birth. Great for learning Python, understanding date handling, or building small CLI tools!

## Features
- 🗓️ Accepts year, month, and day of birth as inputs.
- 🚀 Command-line interface (CLI) for easy usage.
- ⚡ Calculates your precise age based on today's date.
- 🛡️ Handles invalid dates with clear error messages.

## Usage

### 1. Clone the Repository
```bash
git clone https://github.com/your-username/age-calculator.git
cd age-calculator
```
### 2. Run the Script
Use the following command to calculate your age:
```bash
python age_calculator.py --year 1990 --month 12 --day 15
```
### 3. Example Output

    You are 33 years old.

## Command-Line Arguments

    --year (required): Year of birth (e.g., 1990).
    --month (optional): Month of birth (1-12, default: 1).
    --day (optional): Day of birth (1-31, default: 1).

## Requirements

    Python 3.6 or higher

## License

This project is licensed under the MIT License. See the LICENSE file for details.