semvec/pypi-packages huggingface dataset:
simple-fastapi-auth 1.1
A *heavily* opinionated library for simplifying the boilerplate of FastAPI authentication.
Requires Python: >=3.7

```python
# app.py

from fastapi_auth.auth import setup_auth, build_auth_router, restrict, protect_router
from services.users import authenticate_user, create_user
from other_router import other_router
from fastapi import FastAPI
import uvicorn, os

# Configure auth library
auth_manager = setup_auth(
    auth_endpoint="/auth/login",
    jwt_secret_key=os.getenv("JWT_SECRET_KEY", "A-Secure-Key"),
    access_token_expire_minutes=int(os.getenv("ACCESS_TOKEN_EXPIRE_MINUTES", "1440")),
    token_renewal_minutes=int(os.getenv("TOKEN_RENEWAL_MINUTES", "30")),
    database_path=os.getenv("AUTH_DB_PATH", "auth.db") # Minimal SQLite for Auth/Tokens
)

app = FastAPI()

# Build and Register the Auth Router
app.include_router(
    build_auth_router(
        authenticate_user=authenticate_user,
        create_user=create_user
    )
)

@app.get("/restricted_ep")
@restrict(roles_allowed=["admin"], inject_user=True)
def root(current_user: dict):
    return {"message": f"Welcome {current_user['username']} - ID {current_user['user_id']}, to the API !"}

@app.get("/unrestricted_ep")
def root():
    return {"message": "Welcome to the API!"}

# Protect other routes
protect_router(other_router)
app.include_router(other_router)

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)
```

```python
# services/users.py

from fastapi import HTTPException, status
from fastapi_auth.auth import get_auth_manager

def authenticate_user(username: str, password: str):
    # 1 - Get user from database by username, fetch password
    user = {} # dummy just for the example
    
    # 2 - Verify password using the manager helper fn
    if not get_auth_manager().verify_password(password, user["password"]):
        return None
    return {"user_id": username, "role": user["role"]}

def create_user(user_dict: dict):
    # 1 - Validate if username already exists
    user_already_exists = user_dict['username'] in [] # dummy just for the example
    if user_already_exists:
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail="Username already exists"
        )
    
    # 2 - Create user in database
    # user_dict contains username, password, role, and any extra metadata
    pass
```
robokassa 1.0.8
Unofficial Robokassa API
Requires Python: >=3.8

<p align="center">
  <img src="assets/banner.png" alt="Robokassa API" width="600">
</p>

# 🚀 Robokassa API

> **Unofficial Python Library for Robokassa Payments**  
> 💳 Fast & Secure Payment Integration with Just a Few Lines of Code!
<p align="center">
  <img src="https://img.shields.io/pypi/v/robokassa?color=blue" alt="PyPI Version">
  <img src="https://img.shields.io/pypi/dm/robokassa?color=green" alt="Downloads">
  <img src="https://img.shields.io/github/license/byBenPuls/robokassa?color=red" alt="License">
</p>

---

### 💬 We now have a library discussion on Telegram! - https://t.me/robokassa_for_python


## 🎨 Features
✔️ Easy Payment Link Generation  
✔️ Secure Transactions with Hash Algorithms  
✔️ Supports all available Hashes  
✔️ Simple and Fast Integration  

---

## 📦 Installation

```bash
pip install robokassa
```

---

## ⚡ Quick Start

```python
from robokassa import HashAlgorithm, Robokassa

robokassa = Robokassa(
    merchant_login="my_login",
    password1="password",
    password2="password",
    is_test=False,
    algorithm=HashAlgorithm.md5,
)

payment_link = robokassa.generate_open_payment_link(out_sum=1000, inv_id=0)
print(payment_link)
```

Async methods available for advanced actions:

```python
from robokassa.types import InvoiceType

my_link = await robokassa.generate_protected_payment_link(
    invoice_type=InvoiceType.REUSABLE, inv_id=233, out_sum=1000
)
```

---

## 📖 Documentation

📚 **Full Documentation (in Russian):**  
🔗 [Read the Docs](https://robokassa.readthedocs.io/)

---

## 🌟 Contribute & Support
🚀 **Found this project useful?** Show some ❤️ by giving it a star!

---

Made with ❤️ for seamless payment integration.
minced 0.1.0
Minced script API for building and testing scripts without the full Minced application
Requires Python: >=3.6

# Minced Script API

This repository packages the public runtime objects that Minced-compatible
scripts rely on. Install it from PyPI to build and test scripts without the
full Minced application:

```bash
pip install minced-script-api
```

After installation scripts can import the shared runtime context and base
classes:

```python
from minced import MINCED, MincedScriptBase
```

See the inline documentation for details on each helper.