semvec/pypi-packages huggingface dataset:
noauth 0.1.4
Centralized OAuth token service on Modal with encrypted storage and automatic refresh.
Requires Python: >=3.12
Keywords: oauth, tokens, modal, fastapi, sdk

# noauth

Centralized OAuth token service on Modal with encrypted storage and automatic refresh.

## SDK install (GitHub)

Use this when you only want the client library (no Modal server deps). This install does not pull Modal.

```bash
uv pip install "git+https://github.com/thehumanworks/noauth.git"
```

Minimal usage:

```python
from noauth.sdk import NoAuthClient

# Credentials can be provided via:
# 1. Explicit parameters (shown below)
# 2. Environment variables (NOAUTH_CLIENT_ID, NOAUTH_CLIENT_SECRET)
# 3. ~/.modal.toml file

client = NoAuthClient(
    base_url="https://<your-app>.modal.run",
    token_id="wk-...",
    token_secret="ws-...",
)
print(client.health().message)

# Store an OAuth credential
client.store_credential(
    "codex",
    "oauth",
    config={"client_id": "...", "token_url": "..."},
    tokens={"access_token": "...", "refresh_token": "..."},
)

# Get credentials
cred = client.get_credential("codex", "oauth")
print(cred.tokens.get("access_token"))

# List credentials
creds = client.list_credentials()
print([c.name for c in creds])

# Refresh OAuth tokens
client.refresh_credential("codex")

## CLI usage

```bash
# Health check
noauth health

# Get OAuth credential tokens
noauth get codex --kind oauth

# Get bearer credential value
noauth get api-key --kind bearer

# Store OAuth tokens (from JSON file)
noauth store codex ./tokens.json

# Store OAuth config + optional tokens
noauth store-credential codex --kind oauth --config ./config.json --tokens ./tokens.json

# Store bearer token
noauth store-credential api-key --kind bearer --value "secret"

# Refresh OAuth credential
noauth refresh codex

# List credentials
noauth list
noauth list --kind oauth

# Delete credential
noauth delete codex --kind oauth --force
```
```

## Doppler secrets

noauth can use Doppler as the credential store. Set `DOPPLER_TOKEN`, `DOPPLER_PROJECT`, and `DOPPLER_CONFIG` for the Modal app. When enabled, OAuth credentials are stored as JSON in Doppler under `CODEX_AUTH_JSON` and `GEMINI_AUTH_JSON`.

## Server install (Modal app)

Use this when you want to deploy the service:

```bash
uv pip install "git+https://github.com/thehumanworks/noauth.git#egg=noauth[server]"
```

Deploy:

```bash
uv run modal deploy -m noauth.app
```

Notes:
- All endpoints require Modal Proxy Auth. Use a Proxy Auth token (`wk-...`/`ws-...`).
- API/CLI tokens (`ak-`/`as-`) are not valid for proxy auth.
courtlistener-api 0.1.0
Official Python SDK for the CourtListener API
Requires Python: >=3.10
Keywords: api, courtlistener, legal, mcp, sdk

# CourtListener API

Official Python SDK for the [CourtListener API](https://www.courtlistener.com/api/rest-info/).

## Installation

### For Users

```bash
pip install courtlistener-api
```

### For Developers

Clone the repository and install with [uv](https://docs.astral.sh/uv/):

```bash
git clone https://github.com/freelawproject/courtlistener-api.git
cd courtlistener-api
uv sync --dev
```

## Configuration

Set your CourtListener API token as an environment variable:

```bash
export COURTLISTENER_API_TOKEN="your-api-token-here"
```

You can obtain an API token from your [CourtListener account settings](https://www.courtlistener.com/profile/api/).

## Usage

### Basic SDK Usage

```python
from courtlistener_api import CourtListenerClient

# Using environment variable for token
client = CourtListenerClient()

# Or provide token directly
client = CourtListenerClient(api_token="your-api-token")

# Get a docket by ID
docket = client.get_docket(4214664)
print(f"Case: {docket.case_name}")
print(f"Court: {docket.court_id}")
print(f"Docket Number: {docket.docket_number}")
```

### Using as a Context Manager

```python
from courtlistener_api import CourtListenerClient

with CourtListenerClient() as client:
    docket = client.get_docket(4214664)
    print(docket.case_name)
```

## MCP Server

This package includes an MCP (Model Context Protocol) server that allows AI assistants to interact with the CourtListener API.

### Installing the MCP Server

#### For Claude Desktop

Add the following to your Claude Desktop configuration file:

**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "courtlistener": {
      "command": "uvx",
      "args": ["courtlistener-api"],
      "env": {
        "COURTLISTENER_API_TOKEN": "your-api-token-here"
      }
    }
  }
}
```

#### For Development

If you're developing locally:

```json
{
  "mcpServers": {
    "courtlistener": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/courtlistener-api", "courtlistener-mcp"],
      "env": {
        "COURTLISTENER_API_TOKEN": "your-api-token-here"
      }
    }
  }
}
```

### Available MCP Tools

- **get_docket**: Get a court docket by its ID. Returns case information including case name, docket number, court, filing dates, and more.

## Development

### Running Tests

```bash
uv run pytest
```

### Linting

```bash
uv run ruff check .
uv run ruff format .
```

### Type Checking

```bash
uv run mypy courtlistener_api
```

## License

MIT License - see LICENSE file for details.