Analysis updated 2026-07-09 · repo last pushed 2023-11-24
Store millions of machine learning image metadata records like Stable Diffusion prompts.
Save web scraping results to disk without setting up a database server.
Track experiment results in a Python research project with automatic crash recovery.
Process massive datasets one record at a time using minimal memory.
| lllyasviel/singlefiledb | michaelliao/miniweibo | aqua5230/usage | |
|---|---|---|---|
| Stars | 85 | 83 | 82 |
| Language | Python | Python | Python |
| Last pushed | 2023-11-24 | 2012-12-28 | — |
| Maintenance | Dormant | Dormant | — |
| Setup difficulty | easy | moderate | easy |
| Complexity | 2/5 | 3/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
No installation needed beyond copying the single Python file into your project.
Single File Database (SFDB) is a lightweight Python tool for storing key-value data, think of it like a dictionary that saves to disk. The author created it to manage millions of image metadata records in machine learning projects, particularly for storing Stable Diffusion prompts. The entire thing is one Python file with under 150 lines of code, no external dependencies, and you install it by just copying the file into your project. Under the hood, it stores data using SQLite, a widely-supported database format. Your values are saved as human-readable JSON text, which means you can open the database file in any SQLite viewer and inspect or edit your data directly, even outside your code. For small datasets, you can load everything into memory with a single line. For massive datasets, it lets you read and write items one at a time without loading the whole file, so you could theoretically process 10TB of data using only 10MB of memory. This would appeal to someone building a Python app who needs persistent storage but doesn't want the overhead of setting up a full database server or learning a complex ORM. A solo developer prototyping an AI tool, a researcher tracking experiment results, or a startup founder scraping and storing web data could drop this in and start saving records immediately. The thread-safety and automatic crash recovery mean you don't have to worry much about data corruption if your app dies mid-write. A notable design choice is how it handles disk writes. Updates appear instant to your code, but the actual file writes are batched, either every 16,384 updates, every 60 seconds, or when the program exits. This reduces wear on your storage drive and improves performance, though it means a sudden power loss could lose up to a minute of recent changes (application crashes, however, are handled safely by SQLite's built-in recovery).
A zero-dependency Python key-value store in a single file that saves data as readable JSON, designed for managing millions of records without a database server.
Mainly Python. The stack also includes Python, SQLite, JSON.
Dormant — no commits in 2+ years (last push 2023-11-24).
The license for this repository is not specified in the provided information, so check the repository files for terms before use.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.