Srcly Server
A FastAPI server for static code analysis using lizard.
Features
- Static Analysis: Scans the codebase for cyclomatic complexity and LOC (Lines of Code).
- Caching: Caches analysis results in the user cache directory (see the main README) and reuses them until files change.
- File Serving: Provides an API to read raw file contents (absolute paths).
- API Documentation: Auto-generated Swagger UI at
/docs.
Setup
This project is managed with uv.
-
Install dependencies:
uv sync
Running the Server
Start the server with hot-reloading:
uv run uvicorn app.main:app --reload
The API will be available at http://localhost:8000.
API Endpoints
Analysis
GET /api/analysis: Get the analysis tree. Scans unless an unchanged cached analysis exists.POST /api/analysis/refresh: Force a new scan and replace the cached analysis.
Files
GET /api/files/content?path=/absolute/path/to/file: Get raw file content.
Client Generation
You can generate a client SDK (TypeScript, Python, etc.) using the OpenAPI schema available at http://localhost:8000/openapi.json.
Example using openapi-generator-cli:
npx @openapitools/openapi-generator-cli generate -i http://localhost:8000/openapi.json -g typescript-axios -o ../client/src/api
Metadata
Release files for srcly 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| srcly-1.0.0.tar.gz | 1.2 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| srcly-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.5 MB
Release files / srcly-1.0.0.tar.gz
| Download URL | srcly-1.0.0.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5aa81a104ca0877dbf59126e0a2252eb58e1d0671915985974032265fb3d56bc
|
|
BLAKE2b-256 checksum How to use checksums |
a7529d2c0898f1cb247270d047e656548e0ebc0d9e23cf1ebff18a2272f1f19c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / srcly-1.0.0-py3-none-any.whl
| Download URL | srcly-1.0.0-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b31b703637376adfe25ca2a2f00de98916e24ae387bb6c05e0748a11ee56f225
|
|
BLAKE2b-256 checksum How to use checksums |
6b4bf7d97cabbedc966aa99a2a9e9745706a9c14d81f81f7bf9a397e85f94a0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|