Skip to main content

A database writed entirely on python, Tinrux is not redis

Project description

Tinrux Database

PyPI - Version PyPI - Python Version License: GPLv3


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).
  • Cookie's management system: Has a cookie's management system for logins and more!

🚀 Installation

pip install tinrux

🛠️ Basic Usage

Make a new db:

tinrux server localhost 5000 new

Start a saved server:

tinrux server localhost 5000

Interactive client:

tinrux client localhost 5000

Python example:

(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
PUSH PUSH NEW DATA PUSH key 5
POP POP A VALUE POP key
STACK initializes a entry as a stack POP key
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 license.

GNU General Public License v3.0 - See LICENSE.txt.

Contributors

Make pull request to be here!

Contributing

Contributing

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinrux-0.1.4.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tinrux-0.1.4-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file tinrux-0.1.4.tar.gz.

File metadata

  • Download URL: tinrux-0.1.4.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for tinrux-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a74e27eb793daaf9e1454439b3e29e8c536b3ff56c859e6bb2f296bec9b7fb38
MD5 7dab7d1677901621e1454d368f6a410d
BLAKE2b-256 33069b25ed512f1cb04b56b4f619d1347075a8e6a787c2cac0786b5d5370083b

See more details on using hashes here.

File details

Details for the file tinrux-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: tinrux-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for tinrux-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ff026d47e852f37d7abf554c2d366b6f1396c202145180d0a9f624782664f58c
MD5 7b23f22e66c27b5f3e7f6de05c6f2f08
BLAKE2b-256 f04f6067a85919104a48b5821bc87e3df808ba7b10d54baaba15ce31a7900543

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page