Metadata-Version: 2.1
Name: pytography
Version: 0.1.0
Summary: A library for password hashing and JWT encoding
Home-page: https://github.com/TalentGate/pytography
Author: TalentGate
License: MIT
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# Pytography

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

## Installation

```bash
pip install pytography
```
## Quick Start
### Password Hashing with Scrypt (Default)
```python
from pytography import PasswordHashLibrary

encoded_password = PasswordHashLibrary.encode(password="password")
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

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

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

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

# Verify token
is_valid = jwt.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.


