An open API service indexing awesome lists of open source software.

https://github.com/jnsougata/fractal

A fast lightweight k-v storage for hobbyists.
https://github.com/jnsougata/fractal

kvstore nosql python3 sqlite3

Last synced: 3 months ago
JSON representation

A fast lightweight k-v storage for hobbyists.

Awesome Lists containing this project

README

          

![fractal (1)](https://github.com/user-attachments/assets/d1e0dde5-b693-4591-8cce-1fa097bb6e5e)

# FractalDB - KV Store
A fast, lightweight key-value store designed for hobbyists, combining the simplicity of NoSQL with SQLite3's robust filtering and sorting capabilities.
## Features
- **NoSQL-like Experience** – Work with database records as Python dictionaries.
- **Simplified Access** – Retrieve data without remembering column names or indices.
- **SQL Power** – Use SQL queries for filtering and sorting.
- **Lightweight & Fast** – Minimal overhead with SQLite’s reliability.

## Installation
```sh
pip install git+https://github.com/jnsougata/fractal.git
```

## Example Usage

```python
from fractal import DB
import fractal.operators as op

if __name__ == "__main__":

db = DB("example.db")

users = db.collection(name="users")

inserted = users.put(
{"name": "Alice", "age": 25},
{"name": "Bob", "age": 30},
{"name": "Charlie", "age": 35},
{"name": "David", "age": 40},
)
users = db.collection("users")
results = users.where(op.greater_than("age", 35))
print(list(results))
```

#### Sample Output:
```
[{'key': '379b87afd3d74f49bc1c59b8185bb534', 'name': 'David', 'age': 40}]
```

## Documentation
Half-baked docs [here.](https://fractal.readthedocs.io/en/latest/)