scapi-py


Namescapi-py JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryDead simple, self-contained, single-file API load testing tool built on FastAPI.
upload_time2025-08-17 22:20:04
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords api fastapi load python python310 python311 python312 python313 single-file testing tool
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SCAPI

![Total](https://img.shields.io/github/downloads/sesav/scapi-py/total)
![Python Version](https://img.shields.io/badge/python-3.10+-blue)
[![codecov](https://codecov.io/github/sesav/scapi/graph/badge.svg?token=GSHBWZGXAH)](https://codecov.io/github/sesav/scapi)
![License](https://img.shields.io/github/license/sesav/scapi-py)

> Dead simple, **S**elf-**C**ontained, single-file **API** load testing tool built on FastAPI.

A lightweight utility for quickly testing external APIs. It lets you generate a
small amount of load, experiment with headers, and measure average response
times — nothing more. The tool is designed to run anywhere with minimal setup:
just launch it and start testing, no extra configuration required.

## Features

- **Zero Configuration** - One file, one command;
- **Self-Contained** - Uses uv's inline metadata format;
- **FastAPI Swagger UI** - Beautiful web interface;
- **Async Load Testing** - Built on httpx and asyncio;
- **Real-time Results** - View metrics during execution;
- **Container Ready** - Works in any Python environment.

## Quick Start

### Option 1: Run Directly (No Installation)

```bash
# Download and run the tool directly
curl -LOs https://github.com/sesav/scapi-py/releases/latest/download/scapi.py
uv run scapi.py

# Or with wget
wget https://github.com/sesav/scapi-py/releases/latest/download/scapi.py
uv run scapi.py
```

### Option 2: Install as Package

```bash
# Install from PyPI
pip install scapi-py

# Run the tool
scapi
```

### Option 3: Install with uv

```bash
# Install with uv
uv add scapi-py

# Run the tool
scapi
```

### Usage

1. Open http://localhost:8000 in your browser
2. Use the `/load` endpoint to send requests
3. Check `/results` for metrics and response times

## API Reference

### POST /load
Send load test requests to a target URL.

**Parameters:**
* `url` (string, required) - Target URL to test;
* `method` (string, required) - HTTP method (GET, POST, PUT, etc.);
* `attempts` (int, default: 10) - Number of requests to send;
* `delay` (float, default: 0.1) - Delay between requests in seconds;
* `headers` (object, optional) - Custom HTTP headers;
* `body` (object, optional) - Request body for POST/PUT requests;
* `response_header` (bool, default: false) - Include response headers in logs;
* `response_body` (bool, default: false) - Include response body in logs.

### GET /results
Get aggregated test results and metrics.

**Response:**
```json
{
  "results": {
    "200": 10,
    "404": 2
  },
  "average_request_time": 0.25
}
```

## Docker Usage

```bash
docker run -ti --rm -p "8000:8000" python:3.12-slim-bookworm bash
```
Then follow the installation steps inside the container.

## Screenshots

![Load Testing Interface](https://github.com/sesav/scapi-py/blob/main/images/load.png)
*Configure your load test parameters*

![Results Dashboard](https://github.com/sesav/scapi-py/blob/main/images/results.png)
*View real-time results and metrics*

## Limitations

A minimal, single-threaded, memory-based tool for quick API load tests. Designed to run anywhere
with Python and the uv binary, it generates a small number of requests and provides fast feedback
without heavy dependencies.
long-running benchmarks.

## Development

```bash
# Clone the repository
git clone https://github.com/sesav/scapi-py.git
cd scapi-py

# Install development dependencies
make install

# Run tests
make test

# Run
make run
```

## Requirements

- Python 3.10+
- uv package manager
- wget or curl (for installation)

## License

This project is licensed under the [MIT License](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "scapi-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "api, fastapi, load, python, python310, python311, python312, python313, single-file, testing, tool",
    "author": null,
    "author_email": "Sergey Silaev <hello@8am.dev>",
    "download_url": "https://files.pythonhosted.org/packages/6d/0b/43dd4b37b5d406b68837c43973cffba7a5f2b4aa18c362af7bf4679dd0f8/scapi_py-1.0.0.tar.gz",
    "platform": null,
    "description": "# SCAPI\n\n![Total](https://img.shields.io/github/downloads/sesav/scapi-py/total)\n![Python Version](https://img.shields.io/badge/python-3.10+-blue)\n[![codecov](https://codecov.io/github/sesav/scapi/graph/badge.svg?token=GSHBWZGXAH)](https://codecov.io/github/sesav/scapi)\n![License](https://img.shields.io/github/license/sesav/scapi-py)\n\n> Dead simple, **S**elf-**C**ontained, single-file **API** load testing tool built on FastAPI.\n\nA lightweight utility for quickly testing external APIs. It lets you generate a\nsmall amount of load, experiment with headers, and measure average response\ntimes \u2014 nothing more. The tool is designed to run anywhere with minimal setup:\njust launch it and start testing, no extra configuration required.\n\n## Features\n\n- **Zero Configuration** - One file, one command;\n- **Self-Contained** - Uses uv's inline metadata format;\n- **FastAPI Swagger UI** - Beautiful web interface;\n- **Async Load Testing** - Built on httpx and asyncio;\n- **Real-time Results** - View metrics during execution;\n- **Container Ready** - Works in any Python environment.\n\n## Quick Start\n\n### Option 1: Run Directly (No Installation)\n\n```bash\n# Download and run the tool directly\ncurl -LOs https://github.com/sesav/scapi-py/releases/latest/download/scapi.py\nuv run scapi.py\n\n# Or with wget\nwget https://github.com/sesav/scapi-py/releases/latest/download/scapi.py\nuv run scapi.py\n```\n\n### Option 2: Install as Package\n\n```bash\n# Install from PyPI\npip install scapi-py\n\n# Run the tool\nscapi\n```\n\n### Option 3: Install with uv\n\n```bash\n# Install with uv\nuv add scapi-py\n\n# Run the tool\nscapi\n```\n\n### Usage\n\n1. Open http://localhost:8000 in your browser\n2. Use the `/load` endpoint to send requests\n3. Check `/results` for metrics and response times\n\n## API Reference\n\n### POST /load\nSend load test requests to a target URL.\n\n**Parameters:**\n* `url` (string, required) - Target URL to test;\n* `method` (string, required) - HTTP method (GET, POST, PUT, etc.);\n* `attempts` (int, default: 10) - Number of requests to send;\n* `delay` (float, default: 0.1) - Delay between requests in seconds;\n* `headers` (object, optional) - Custom HTTP headers;\n* `body` (object, optional) - Request body for POST/PUT requests;\n* `response_header` (bool, default: false) - Include response headers in logs;\n* `response_body` (bool, default: false) - Include response body in logs.\n\n### GET /results\nGet aggregated test results and metrics.\n\n**Response:**\n```json\n{\n  \"results\": {\n    \"200\": 10,\n    \"404\": 2\n  },\n  \"average_request_time\": 0.25\n}\n```\n\n## Docker Usage\n\n```bash\ndocker run -ti --rm -p \"8000:8000\" python:3.12-slim-bookworm bash\n```\nThen follow the installation steps inside the container.\n\n## Screenshots\n\n![Load Testing Interface](https://github.com/sesav/scapi-py/blob/main/images/load.png)\n*Configure your load test parameters*\n\n![Results Dashboard](https://github.com/sesav/scapi-py/blob/main/images/results.png)\n*View real-time results and metrics*\n\n## Limitations\n\nA minimal, single-threaded, memory-based tool for quick API load tests. Designed to run anywhere\nwith Python and the uv binary, it generates a small number of requests and provides fast feedback\nwithout heavy dependencies.\nlong-running benchmarks.\n\n## Development\n\n```bash\n# Clone the repository\ngit clone https://github.com/sesav/scapi-py.git\ncd scapi-py\n\n# Install development dependencies\nmake install\n\n# Run tests\nmake test\n\n# Run\nmake run\n```\n\n## Requirements\n\n- Python 3.10+\n- uv package manager\n- wget or curl (for installation)\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Dead simple, self-contained, single-file API load testing tool built on FastAPI.",
    "version": "1.0.0",
    "project_urls": {
        "Source code": "https://github.com/sesav/scapi-py"
    },
    "split_keywords": [
        "api",
        " fastapi",
        " load",
        " python",
        " python310",
        " python311",
        " python312",
        " python313",
        " single-file",
        " testing",
        " tool"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "67c627f158ebe2b5b8b7d109f00e7a2f87bcde795230e0072df5718dcc753e8b",
                "md5": "4bc47b7508003046bfe3a0eac075a854",
                "sha256": "caf48e78c0e31f6e1a84c8bc73a49ad20496974bee4ebae6465b230ab9566364"
            },
            "downloads": -1,
            "filename": "scapi_py-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4bc47b7508003046bfe3a0eac075a854",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 6187,
            "upload_time": "2025-08-17T22:20:02",
            "upload_time_iso_8601": "2025-08-17T22:20:02.976051Z",
            "url": "https://files.pythonhosted.org/packages/67/c6/27f158ebe2b5b8b7d109f00e7a2f87bcde795230e0072df5718dcc753e8b/scapi_py-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6d0b43dd4b37b5d406b68837c43973cffba7a5f2b4aa18c362af7bf4679dd0f8",
                "md5": "243e565736d17cb3d05c9650770f8e87",
                "sha256": "1c0eb1f63aa4f7c8aaea7e9547f4f3b10708be6464b7ffe8a2b42133f5080bc1"
            },
            "downloads": -1,
            "filename": "scapi_py-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "243e565736d17cb3d05c9650770f8e87",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 142463,
            "upload_time": "2025-08-17T22:20:04",
            "upload_time_iso_8601": "2025-08-17T22:20:04.021504Z",
            "url": "https://files.pythonhosted.org/packages/6d/0b/43dd4b37b5d406b68837c43973cffba7a5f2b4aa18c362af7bf4679dd0f8/scapi_py-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-17 22:20:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sesav",
    "github_project": "scapi-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "scapi-py"
}
        
Elapsed time: 1.37394s