semvec/pypi-packages huggingface dataset:
autheon 0.0.0
OAuth2 3rd party integration libray for your favorite framework
License: MIT
Requires Python: <4.0,>=3.10

# FastAuth
OAuth2 library for FastAPI.
### Current providers
- Google
- GitHub
- Reddit
- Discord
- Spotify
### Setup
This setup currently works, but up for change, since this project is still under development

```python
from fastapi import FastAPI

from dotenv import load_dotenv
from os import getenv

from autheon.libtypes import UserInfo, FallbackSecrets

from autheon.jwts.helpers import generate_secret
from autheon.oauth2_options import OAuthOptions
from autheon.providers.google.google import Google

from autheon.adapters.fastapi.csrf_middleware import CSRFMitigationMiddleware

load_dotenv()


# What happens when someone logs in
async def push_to_db(user_info: UserInfo) -> None:
    with open("my_db", "w") as f:
        f.write(user_info["name"])


# One router takes care of everything
auth = OAuthOptions(
    debug=True,
    provider=Google(
        client_id=getenv("GOOGLE_CLIENT_ID"),
        client_secret=getenv("GOOGLE_CLIENT_SECRET"),
        redirect_uri=getenv("GOOGLE_REDIRECT_URI"),
    ),
    signin_callback=push_to_db,
    fallback_secrets=FallbackSecrets(
        secret_1=getenv("SECRET"),
        secret_2=generate_secret(),
        secret_3=generate_secret(),
        secret_4=generate_secret(),
        secret_5=generate_secret(),
    ),
)

app = FastAPI()
# Plug in the router
app.include_router(auth)

# Optional for OAuth flow, but highly recommended
app.add_middleware(CSRFMitigationMiddleware)
```
### Usage
```python
@app.get("/auth/in")
def logged():
    return "youre in"

@app.get("/auth/out")
def out():
    return "out"
```
### Development setup
Checkout ``justfile``

### License
[MIT](/LICENSE)
deepseek-ai 0.0.1
easy use the deepseek model
License: MIT
Requires Python: <4.0,>=3.8

# 🚀 DeepSeekAI: easy use the deepseek model

## Install

* Install from source (Recommend)

```bash
cd deepseek_ai
pip install -e .
```
* Install from PyPI
```bash
pip install deepseek-ai
```

## Quick Start
* All the code can be found in the `examples`
* Set DeepSeek API key in environment if using DeepSeek models: `export DEEPSEEK_API_KEY="sk-...".`
*  Maybe you can try loading environment variables like this. Create a new `.env` file
```
DEEPSEEK_API_KEY="sk-..."
```
```python
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv(), override=True)
```
##### It works with the Langchain library

```python
from deepseek_ai import DeepSeekAI

client = DeepSeekAI(
    api_key="sk-...",
)

messages = [{"role": "user", "content": "9.11 and 9.8, which is greater?"}]

response = client.chat.completions.create(
    model="deepseek_ai-chat",
    messages=messages
)

print(response.choices[0].message.content)
```