OSMA Icon # OSMA (Open Source Module Archive)

NPM Packages PyPI Packages License

**Registry lookups, without the wait.** OSMA is a lightning-fast, static search archive for querying open-source packages across NPM and PyPI, bypassing live registry bottlenecks. ### Live Explorers * **Home:** [data.amit.is-a.dev](https://data.amit.is-a.dev) * **NPM Explorer:** [data.amit.is-a.dev/npm](https://data.amit.is-a.dev/npm) * **PyPI Explorer:** [data.amit.is-a.dev/pypi](https://data.amit.is-a.dev/pypi) * **GitHub Repository:** [notamitgamer/osma](https://github.com/notamitgamer/osma) --- ## Why I Built OSMA This project was born out of pure frustration. I found myself constantly needing to look up package details, version numbers, and dependencies. But doing this on the official registries meant dealing with: 1. **Fastly Security Checks:** Being stalled by CAPTCHAs or security verification screens just to view a text page. 2. **The Multi-Click Tax:** Clicking through 2-3 different pages just to find the exact version tag or repository link I was looking for. **The Solution:** I took complete static snapshots of the registries (2026-04-29 08:45 IST for PyPI and 2026-04-29 09:42 IST for NPM). By indexing these frozen lists into a custom backend, OSMA allows users to instantly search and verify packages without ever hitting a live registry rate-limit. *(Note: Clicking a package in the UI will still fetch its extended live details securely via a side-panel).* --- ## How the Backend Works The backend is powered by **FastAPI** serving static `.csv` snapshots. Instead of querying a slow database or live third-party API, the server loads the heavily optimized snapshot data into memory. * **Speed:** Because the dataset is static, memory lookups for searches (`/search`) and chunked pagination (`/browse`) respond in milliseconds. * **Ranking Logic:** Search results are strictly ranked: 1. `Rank 0`: Exact match 2. `Rank 1`: Starts with query 3. `Rank 2`: Contains query * **Limitation:** Because this is an archive, packages published or deleted after April 2026 are not indexed. --- ## API Endpoints Documentation The APIs are hosted publicly and can be interacted with directly. ### 1. Health & Stats * **`GET /health`** * **Description:** Checks if the server is alive and returns the total indexed packages. * **Response (200):** `{"status": "ok", "total_packages": 3881465}` * **`GET /ping`** / **`GET /stats`** * **Description:** Basic server alive/telemetry routes. ### 2. Browse Packages * **`GET /browse`** * **Description:** Returns packages sequentially, ordered by `package_no`. Used for pagination. * **Parameters:** * `page` (int, default `1`): The page number (minimum 1). * `limit` (int, default `200`): Items per page (maximum 500). * **Response (200):** List of package objects `[{"no": 1, "name": "...", "version": "...", "url": "..."}]`. ### 3. Search Packages * **`GET /search`** * **Description:** Search packages by name. Returns algorithmically ranked results. * **Parameters:** * `q` (string, required): The search query (min length: 2 chars). * `limit` (int, default `250`): Max results to return (maximum 500). * **Response (200):** Ranked list of package objects matching the query. * **Response (422):** Validation Error if query is too short. --- ## Additional Documentation Please refer to the following documents for repository guidelines: * [Contributing](CONTRIBUTING.md) * [Security Policy](SECURITY.md) * [Code of Conduct](CODE_OF_CONDUCT.md) ## License Distributed under the Apache 2.0 License. See `LICENSE` for more information. --- *Maintained by [Amit Dutta](https://github.com/notamitgamer) | [amit.is-a.dev](https://amit.is-a.dev)*