{"id":25096357,"url":"https://github.com/maximdanilchenko/radish","last_synced_at":"2026-05-09T04:32:58.029Z","repository":{"id":90960970,"uuid":"134280321","full_name":"maximdanilchenko/radish","owner":"maximdanilchenko","description":"Simple in-memory database and its client written in python3/asyncio for python3/asyncio","archived":false,"fork":false,"pushed_at":"2018-08-24T12:50:26.000Z","size":51,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T01:38:50.919Z","etag":null,"topics":["asyncio","database","memory-storage","python","redis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maximdanilchenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-21T14:27:43.000Z","updated_at":"2024-09-11T14:25:04.000Z","dependencies_parsed_at":"2023-07-03T21:35:29.268Z","dependency_job_id":null,"html_url":"https://github.com/maximdanilchenko/radish","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maximdanilchenko/radish","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximdanilchenko%2Fradish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximdanilchenko%2Fradish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximdanilchenko%2Fradish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximdanilchenko%2Fradish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximdanilchenko","download_url":"https://codeload.github.com/maximdanilchenko/radish/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximdanilchenko%2Fradish/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32807223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncio","database","memory-storage","python","redis"],"created_at":"2025-02-07T16:33:38.837Z","updated_at":"2026-05-09T04:32:58.010Z","avatar_url":"https://github.com/maximdanilchenko.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Radish \n_Simple in-memory database and its client written in python3/asyncio for python3/asyncio_\n \nSupports ```str```, ```bytes```, ```int```, ```list```, ```tuple``` data types  \n\n## Quick start\n### Server\n##### Run RadishDB Server:\n```python\nfrom radish.database import Server\n\nserver = Server(host=\"127.0.0.1\", port=7272)\nserver.run()\n```\nAfter that you will see an awesome output: \n```\n_____Serving RadishDB on 127.0.0.1:7272_____\n _  ___  _ ___   ___  ___  ___  _  ___  _ _ \n| ||_ _||// __\u003e | . \\| . || . \\| |/ __\u003e| | |\n| | | |   \\__ \\ |   /|   || | || |\\__ \\|   |\n|_| |_|   \u003c___/ |_\\_\\|_|_||___/|_|\u003c___/|_|_|\n```\nThat means that server is ready for handling connections.\n\n### Client\n##### Client with one connection:\n```python\nfrom radish.client import Connection\n\n\nasync def run_client():\n    con = Connection(host=\"127.0.0.1\", port=7272)\n    assert await con.set(\"my_key\", \"my_val\") == 1\n    assert await con.get(\"my_key\") == \"my_val\"\n    assert await con.echo(\"hello\") == \"hello\"\n    assert await con.delete(\"my_key\") == 1\n    await con.close()\n    # using \"async with\" statement:\n    async with Connection(host=\"127.0.0.1\", port=7272) as con:\n        assert await con.mset(k1=1, k2=b\"2\", k3=\"3\") == \"OK\"\n        assert await con.mget(\"k1\", \"k3\", \"k2\") == [1, \"3\", b\"2\"]\n        assert await con.ping() == \"PONG\"\n        assert await con.exists(\"k2\") == 1\n        assert await con.flush() == 3\n```\n\n##### Client with connection pooling:\n```python\nimport asyncio\n\nfrom radish.client import ConnectionPool, Connection\n\n\nasync def run_client(pool: ConnectionPool):\n    async with pool.acquire() as con:  # type: Connection\n        assert await con.ping() == \"PONG\"\n\n\nasync def run_pool():\n    async with ConnectionPool(host=\"127.0.0.1\",\n                              port=7272, \n                              min_size=5, \n                              max_size=50) as pool:\n        clients = [run_client(pool) for _ in range(1000)]\n        await asyncio.gather(*clients)\n```\n\nFind more examples [here](examples)\n\n## Contents:\n\n| Files | Description |\n| :--- | :---------- |\n| [database](radish/database) | Memory Storage with some most common operations and socket Server with asyncio |\n| [client](radish/client) | Client Connection and ConnectionPool implementations |\n| [protocol.py](radish/protocol.py) | Simplified to pythonic one RESP (REdis Serialization Protocol) realization |\n\n## Why?\n- After I read [this article](http://charlesleifer.com/blog/building-a-simple-redis-server-with-python/) \nI was inspired to do something like it, but with asyncio and more pythonic, with more commands and \nwith whole client stuff (such as connection pool). \n- It was interesting for me to understand how database exchange with \nclient apps is made and how these tools work on client side.\n\nMain parts of this work/studying:\n- RESP protocol, which is used for both client and database\n- Async socket server based on python3/asyncio\n- In-memory database - it is toy-database for now, but interesting for implementation \nand for benchmarking this whole solution\n- Client side implementation with Async Connection Pool. It was most interesting part for me\n\n## Pypi package/usage in real tasks\nWhile Radish DB is in development it is not recommended to use it in some real tasks. \nThere are some things I should do before - benchmarks, tests and some fixes and issues are in backlog to implement.\n\nAfter all it **is not a database for production apps** - it is redis mini clone, written in Python. \nBut I thing it will be good for prototyping or for small apps \nbecause of its simple installation and starting - it is lightweight and has no dependencies. \nBut overall it will be possible only after benchmarks and tests will be done.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximdanilchenko%2Fradish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximdanilchenko%2Fradish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximdanilchenko%2Fradish/lists"}