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

https://github.com/ahen-studio/skypy-db

Open Source Reactive Database
https://github.com/ahen-studio/skypy-db

cli database open-source python

Last synced: 5 months ago
JSON representation

Open Source Reactive Database

Awesome Lists containing this project

README

          


Skypy
Skypy


Skypy - open-source reactive database.

The better way to build Python logging system!



License
|

|

Docs

```bash
pip install skypydb # python client
# or download from the source
# git clone https://github.com/Ahen-Studio/skypy-db.git
# cd skypy-db
# pip install -r requirements.txt
```

## Features

- Simple: fully-documented

- Table: create, delete data from a table

- Cli: command line interface for managing the database

- Observable: Dashboard with real-time data, metrics, and query inspection

- Free & Open Source: MIT Licensed

## TODO

- [x] code the database backend
- [ ] Create the dashboard using Reflex
- [ ] write the documentation
- [ ] improve user data security
- [ ] code a custom cli

## What's next!

- give us ideas!

## API

- use the api with a custom config

```python
import skypydb

# setup skypydb client.
client = skypydb.Client(path="./data/skypy.db", auto_start_dashboard=False)

# config to make custom table.
config = {
"all-my-documents": {
"title": "str",
"user_id": str,
"content": str,
"id": "auto"
},
"all-my-documents1": {
"title": "str",
"user_id": str,
"content": str,
"id": "auto"
},
"all-my-documents2": {
"title": "str",
"user_id": str,
"content": str,
"id": "auto"
},
}

# Create tables. get_table_from_config(config, table_name="all-my-documents"), delete_table_from_config(config, table_name="all-my-documents") are also available.
try:
table = client.create_table_from_config(config)# Create all the tables present in the config.
except Exception:
# Tables already exist, that's fine
pass

# Retrieve the table before adding any data.
table = client.get_table_from_config(config, table_name="all-my-documents")

# Add data to a table.
table.add(
title=["document"],
user_id=["user123"],
content=["this is a document"],
id=["auto"]# ids are automatically created by the backend.
)

# Blocking start (keeps dashboard running)
client.start_dashboard(block=True)
```

- use the api without a custom config

```python
import skypydb

# setup skypydb client.
client = skypydb.Client(path="./data/skypy.db", auto_start_dashboard=False)

# Create table. get_table, delete_table are also available.
try:
table = client.create_table("all-my-documents")
except Exception:
# Tables already exist, that's fine
pass

# Retrieve the table before adding any data.
table = client.get_table("all-my-documents")

# Add data to the table.
table.add(
title=["document"],
user_id=["user123"],
content=["this is a document"],
id=["auto"]# ids are automatically created by the backend
)

# Blocking start (keeps dashboard running)
client.start_dashboard(block=True)
```

## Dashboard

Start the dashboard to view your data in real time. It will remain active after your operations:

```python
import skypydb

# Dashboard will auto-start in non-blocking mode by default
client = skypydb.Client(path="./data/skypy.db")

# Or explicitly disable auto-start and start it later with blocking mode
client = skypydb.Client(path="./data/skypy.db", auto_start_dashboard=False)

# ... your operations here ...

# Start the Dashboard (blocking mode keeps it running)
client.start_dashboard(block=True) # Dashboard accessible at http://127.0.0.1:3000
```

**Dashboard options:**

```python
# Change the dashboard port
client = skypydb.Client(
path="./data/skypy.db",
dashboard_port=8080,# Change the port of the dashboard
auto_start_dashboard=False
)

# ... your operations here ...

# Start the Dashboard in blocking mode (keeps the program running)
client.start_dashboard(block=True)

# Or use non-blocking mode to continue with other operations
client.start_dashboard(block=False)
```

```python
# Disable auto-start
client = skypydb.Client(
path="./data/skypy.db",
auto_start_dashboard=False
)

# Start manually later
client.start_dashboard(block=False)

# Kill the dashboard later
client.stop_dashboard()
```

Learn more on our [Docs](https://ahen.mintlify.app/)

## License

[MIT](./LICENSE)