https://github.com/guille-ux/tinrux
Tinrux is not redis
https://github.com/guille-ux/tinrux
database hatch open-source opensource packet pip pip3 pypi python python3 redis tinrux
Last synced: about 1 year ago
JSON representation
Tinrux is not redis
- Host: GitHub
- URL: https://github.com/guille-ux/tinrux
- Owner: Guille-ux
- License: gpl-3.0
- Created: 2025-04-05T23:46:12.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-06T11:59:52.000Z (about 1 year ago)
- Last Synced: 2025-04-11T15:06:01.614Z (about 1 year ago)
- Topics: database, hatch, open-source, opensource, packet, pip, pip3, pypi, python, python3, redis, tinrux
- Language: Python
- Homepage:
- Size: 403 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Tinrux Database
[](https://pypi.org/project/tinrux)
[](https://pypi.org/project/tinrux)
[](https://www.gnu.org/licenses/gpl-3.0)
-----------------
A lightweight Redis-inspired database written in pure Python, designed for small-scale applications needing simple persistence.
## ✨ Features
- **Redis-like commands**: `SET`, `GET`, `DEL`, `EXPIRE`, etc.
- **Auto-persistence**: Saves data to JSON for more read (`tdb.json`).
- **Server/Client mode**: Runs as a standalone service.
- **Zero dependencies**: Pure Python (≥ 3.6).
- **Autosaving system**: Saves automatically the database (by default every 15 minutes).
## 🚀 Installation
```bash
pip install tinrux
```
## 🛠️ Basic Usage
Make a new db:
```bash
tinrux server localhost 5000 new
```
Start a saved server:
```bash
tinrux server localhost 5000
```
Interactive client:
```bash
tinrux client localhost 5000
```
Python example:
```python
(localhost:5000)>>> SET greeting "Hello Tinrux"
OK
(localhost:5000)>>> GET greeting
Hello Tinrux
```
## 📝 Why JSON?
Tinrux uses JSON for persistance due to several key advantages:
- **Human-readable format**: JSON files are easy to inspect and modify manually, making debugging and testing more straightforward.
- **Language interoperability**: JSON is widely supported across programming languages, allowing easy data export or import into other systems.
- **Lightweight and structured**: Perfect for small-scale applications where full databse engines are overkill, but a clear and structured format is still needed.
- **Built-in support in Python**: Using Python's standard `json` module eliminates the need for external dependencies and ensures compatibility.
This choice aligns with Tinrux's philosophy of simplicity, transparency and minimalism.
## 📚 Available Commands
| Command | Description | Example |
| ------- | ------------------------ | ------------- |
| SET | Store a value | SET key value |
| GET | Retrieve a value | GET key |
| DEL | Delete a key | DEL key |
| EXPIRE | Set key expiration (sec) | EXPIRE key 10 |
| SAVE | Manual data persistence | SAVE |
| HELP | Help command | HELP |
## 📦 Project Structure
```
tinrux/
├── src/
│ └── tinrux/
│ ├── tinruxClient.py # Connection handler
│ ├── tinruxServer.py # Core database engine
│ ├── __about__.py # version
│ ├── __init__.py # packet
│ └── cli.py # Command-line interface
```
## 📄 License
`tinrux` is distributed under the terms of the [GPLv3](https://spdx.org/licenses/GPL-3.0-or-later.html) license.
GNU General Public License v3.0 - See LICENSE.txt.
## Contributors
Make pull request to be here!
## Contributing
[Contributing](CONTRIBUTING.md)