Metadata-Version: 2.4
Name: frumle
Version: 0.3.0
Summary: AI-powered codebase analyzer and API documentation for Python projects
Author: Tellecata LLC
License: MIT
Project-URL: Homepage, https://github.com/tellecata/frumle
Project-URL: Documentation, https://frumle.com
Project-URL: Repository, https://github.com/tellecata/frumle
Keywords: ai,code-analysis,documentation,codebase,analyzer,api,flask,fastapi,django
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"

# frumle (Python)

AI-powered codebase analyzer for **Python** projects. Scan your Flask, FastAPI, Django, or Starlette app and get API documentation in your Frumle dashboard.

## What is frumle?

`frumle` scans your Python codebase, sends it to the Frumle backend, and generates documentation including:

- **API Documentation**: Endpoints, request/response bodies, parameters, authentication
- **Structured Analysis**: Overview, architecture, tech stack
- **Dashboard**: View everything at [frumle.com](https://frumle.com)

Same backend as the [npm](https://www.npmjs.com/package/frumle) and [Maven](https://central.sonatype.com/artifact/com.frumle/frumle-maven-plugin) / Gradle plugins—only the CLI and file scanning are Python-specific.

## Quick Start

### 1. Install

```bash
pip install frumle
```

> **Note:** If you also use Frumle for JavaScript, C#, or PHP, install within a **virtual environment** to avoid global CLI conflicts across package managers. Then run with `python -m frumle` instead of `frumle`.

Or run without installing (from a clone):

```bash
python -m pip install -e .
# or
PYTHONPATH=src python -m frumle --help
```

### 2. Get your API key

1. Go to [frumle.com](https://frumle.com)
2. Sign up and copy your API key from the dashboard

### 3. Add your API key

```bash
python -m frumle add-key <your-api-key>
```

Or set an environment variable (useful for CI):

```bash
export FRUMLE_API_KEY=frumle_…
python -m frumle
```

### 4. Analyze your project

From your project root:

```bash
python -m frumle
```

Or a specific directory:

```bash
python -m frumle ./src
python -m frumle ./app
```

Analysis runs on the server. When it’s done, open your dashboard to see the docs.

## Commands

| Command | Description |
|--------|-------------|
| `python -m frumle` | Analyze current directory (default) |
| `python -m frumle <directory>` | Analyze a given directory |
| `python -m frumle add-key <key>` | Store and verify your API key |
| `python -m frumle login <key>` | Same as `add-key` |
| `python -m frumle status` | Show API key status and quota |
| `python -m frumle ci` | Add `.github/workflows/frumle.yml` for auto-docs on push |

### Options

- `--project-name <name>` – Project name (default: directory name or `pyproject.toml` / `setup.py` name)
- `--ignore <dirs>` – Comma-separated dirs to ignore (default: `__pycache__,.git,.venv,venv,env,.eggs,dist,build`)
- `--skip-config-write` – Do not write `frumle.config.json` (also default when `CI=true`)
- `--json` – Print a single JSON result
- `--quiet` – Suppress progress logs

### Auto-docs on every push

After a successful interactive analyze, Frumle asks once to add a GitHub Action. Or run:

```bash
python -m frumle ci
gh secret set FRUMLE_API_KEY
```

Then commit and push the workflow file.

### Examples

```bash
# Use a custom project name
python -m frumle --project-name my-fastapi-app

# Ignore extra directories
python -m frumle --ignore __pycache__,.pytest_cache,.mypy_cache
```

## Supported frameworks

- **Flask** – `@app.route`, blueprints
- **FastAPI** – `@app.get`, `@app.post`, routers, `APIRouter`
- **Django** – URLconf, DRF views, `@api_view`
- **Starlette** – `Route`, `Router`
- **Other** – Any Python web app with route-like patterns

## Config file

Running `frumle` creates or updates `frumle.config.json` in the project with base URLs, e.g.:

```json
{
  "baseUrls": [
    { "environment": "local", "url": "http://localhost:8000" },
    { "environment": "production", "url": "" }
  ]
}
```

You can add your production URL in that file. Local URL is guessed from common patterns (e.g. `app.run(port=5000)`, `uvicorn.run(..., port=8000)`).

## Requirements

- Python 3.8+
- Internet connection (to talk to the Frumle API)

## Other platforms

- **Node.js / TypeScript**: `npm install --save-dev frumle` → run with `npx frumle` → [npm](https://www.npmjs.com/package/frumle)
- **C# / .NET**: `dotnet tool install Frumle` → run with `dotnet frumle` → [NuGet](https://www.nuget.org/packages/Frumle)
- **PHP**: `composer require --dev frumle/frumle` → run with `vendor/bin/frumle`
- **Java (Maven)**: `mvn frumle:add-key` then `mvn frumle:start` → [Maven Central](https://central.sonatype.com/artifact/com.frumle/frumle-maven-plugin)
- **Java (Gradle)**: `./gradlew frumle` → Gradle Plugin Portal

## Publishing to PyPI (maintainers)

```bash
cd py-package
pip install build twine
python -m build
twine upload dist/*
```

Use a PyPI account and token (or `~/.pypirc`) for uploads.

## License

MIT © Tellecata LLC
