Metadata-Version: 2.4
Name: butterfly-jwt
Version: 0.1.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
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

# Butterfly JWT

A lightweight, pure Python JSON Web Token (JWT) library with no external dependencies.

## Installation

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

## Usage

### Encoding a Token

```python
from butterfly import jwt

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

### Decoding a Token

```python
from butterfly import jwt

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

### Using 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)

# Verify a token
payload = jwt_handler.verify_token(token)
```

## Features

- Pure Python implementation
- No external dependencies
- URL-safe Base64 encoding
- HMAC-SHA256 signature
- Token expiration checking
- Constant-time signature verification

## License

MIT License
