Metadata-Version: 2.4
Name: butterfly-jwt
Version: 0.2.0
Summary: A lightweight, pure Python JWT implementation
Home-page: https://github.com/yourusername/butterfly-jwt
Author: Your Name
Author-email: your.email@example.com
Keywords: jwt token authentication
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
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
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-python
Dynamic: summary

Your updated README.md for the `Butterfly JWT` library looks good and includes concise, clear instructions for installation, usage, and features. Hereâ€™s the enhanced content you can use:

```markdown
# Butterfly JWT

Butterfly JWT is a lightweight, pure Python library for handling JSON Web Tokens (JWT) efficiently and securely, with a focus on ease of integration and high security standards. This library is designed to work without any external dependencies, making it an excellent choice for projects requiring minimal setup.

## Installation

To install Butterfly JWT, simply run the following command in your terminal:

```bash
pip install butterfly-jwt
```

## Usage

### Encoding a Token

To encode a new JWT, provide a secret key and payload. Optionally, specify the email for encryption and set the development mode:

```python
from butterfly import jwt

# Create a token
secret_key = "your_secret_key"
payload = {"user_id": 123, "username": "example_user"}
email = "user@example.com"
token = jwt.encode(secret_key, payload, email=email)
```

### Decoding a Token

To decode and verify a JWT, use the decode function. This function will check the token's validity, signature, and expiration:

```python
from butterfly import jwt

try:
    payload = jwt.decode(secret_key, token)
    print("Token is valid. Payload:", payload)
except ValueError as e:
    print("Token verification failed:", str(e))
```

### Using the ButterflyJWT Class

For more detailed control, you can directly use the `ButterflyJWT` class:

```python
from butterfly.jwt import ButterflyJWT

# Create a JWT instance
jwt_handler = ButterflyJWT(secret_key)

# Create a token
token = jwt_handler.create_token(payload, email="user@example.com")

# Verify and decode a token
try:
    payload = jwt_handler.verify_token(token)
    print("Token is valid. Payload:", payload)
except ValueError as e:
    print("Token verification failed:", str(e))
```

## Features

- **Pure Python implementation**: Ensures compatibility and easy deployment.
- **No external dependencies**: Ideal for environments with strict dependency requirements.
- **URL-safe Base64 encoding**: Securely encodes tokens to be URL-friendly.
- **HMAC-SHA256 signature**: Provides a robust mechanism for verifying token integrity.
- **Token expiration checking**: Automatically verifies token expiry to maintain security.
- **Constant-time signature verification**: Prevents timing attacks on token signatures.

## License

This project is licensed under the MIT License - see the LICENSE file for details.
```

This version enhances clarity on the libraryâ€™s features, provides detailed code examples for both encoding and decoding tokens, and includes an example of handling email encryption within the token. It should be quite helpful for users of your library!
