🐹 NoPokeDB
A tiny, disk-backed vector database built on hnswlib (for approximate nearest neighbor search) and SQLite (for metadata).
Simple, lightweight, and crash-safe — good for prototypes, side projects, or when you don’t want a heavyweight vector DB service.
✨ Features
- Durable: HNSW index + SQLite metadata, persisted on disk
- Crash safety: write-ahead oplog with replay
- Fast: batch inserts, bulk metadata fetch, auto-resize index
- Flexible metrics: cosine / L2 / inner product
- CRUD:
add,add_many,get,delete,upsert - Consistent scoring: higher = better for all metrics (with raw
distanceincluded)
📦 Installation
pip install nopokedb
🚀 Quickstart
import numpy as np
from nopokedb import NoPokeDB
# Create (or load existing) DB with 128-d vectors
db = NoPokeDB(dim=128, max_elements=10_000, path="./vdb_data", space="cosine")
# Insert one vector
vec = np.random.rand(128).astype(np.float32)
vid = db.add(vec, metadata={"name": "foo"})
# Insert many at once (faster)
V = np.random.rand(5, 128).astype(np.float32)
metas = [{"i": i} for i in range(len(V))]
ids = db.add_many(V, metas)
# Query nearest neighbors
q = np.random.rand(128).astype(np.float32)
hits = db.query(q, k=3)
for h in hits:
print(h["id"], h["score"], h["metadata"])
# Get / update / delete
print(db.get(vid))
db.upsert(vid, metadata={"name": "bar"})
db.delete(ids[0])
# Persist & close
db.save()
db.close()
Example query result:
{'id': 0, 'metadata': {'name': 'foo'}, 'score': 0.991, 'distance': 0.009}
🛠 Development
Bump version
The Makefile automates version bumps in pyproject.toml and src/nopokedb/__init__.py:
make bump V=0.2.0
That will:
- update both files
- commit with message
Bump to v0.2.0 - tag
v0.2.0 - push tag + main branch
Publish to PyPI
-
Set your API key once:
export PYPI_API_KEY=your-pypi-token
-
Build + upload:
make publish
📜 License
MIT
Metadata
Release files for nopokedb 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nopokedb-0.5.1.tar.gz | 8.9 kB | Without provenance | Details for nopokedb-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nopokedb-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for nopokedb-0.5.1-py3-none-any.whl |
Total release size: 15.9 kB
Release files / nopokedb-0.5.1.tar.gz
| Download URL | nopokedb-0.5.1.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
389e0c9f926391b3cffe93093d2f666d70673b592c4809a4698c7a4957c960ca
|
|
BLAKE2b-256 checksum How to use checksums |
078e365be59e9b5ed546792ee6f407b56d95683bbafc52c1b229c37a5767af29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / nopokedb-0.5.1-py3-none-any.whl
| Download URL | nopokedb-0.5.1-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
649cbb444a5d76d857636c7d5e67e4dd42580e0fed2641d59af187d98d4cef3b
|
|
BLAKE2b-256 checksum How to use checksums |
c925d404f8aae27f95a2f2561e5d8b203d0bcec9361a7773f750bcee3c7285d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Security for nopokedb 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.