{"id":23413196,"url":"https://github.com/kazooki123/lunardb-python-sdk","last_synced_at":"2026-01-23T03:54:47.323Z","repository":{"id":268119690,"uuid":"870998349","full_name":"Kazooki123/lunardb-python-sdk","owner":"Kazooki123","description":"A Python SDK for LunarDB","archived":false,"fork":false,"pushed_at":"2024-10-12T10:31:14.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T00:41:25.345Z","etag":null,"topics":["database","lunardb","package","python","python-sdk","sdk"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/lunardb-py/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kazooki123.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-10-11T04:17:23.000Z","updated_at":"2024-10-12T10:31:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"26368f96-5d37-475f-9444-92e454b2e3e8","html_url":"https://github.com/Kazooki123/lunardb-python-sdk","commit_stats":null,"previous_names":["kazooki123/lunardb-python-sdk"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kazooki123%2Flunardb-python-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kazooki123%2Flunardb-python-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kazooki123%2Flunardb-python-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kazooki123%2Flunardb-python-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kazooki123","download_url":"https://codeload.github.com/Kazooki123/lunardb-python-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248519545,"owners_count":21117761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["database","lunardb","package","python","python-sdk","sdk"],"created_at":"2024-12-22T19:29:41.171Z","updated_at":"2026-01-23T03:54:42.294Z","avatar_url":"https://github.com/Kazooki123.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LunarDB Python SDK\n\nThe LunarDB Python SDK provides a simple and intuitive interface to interact with a LunarDB instance, a high-performance in-memory cache database. It supports basic database operations such as `SET`, `GET`, `DEL`, as well as list operations like `RPUSH`, `RPOP`, and more.\n\n## Features\n\n- **Key-Value Operations**: Easily set and retrieve values using simple commands.\n- **List Operations**: Push, pop, and manage lists within LunarDB.\n- **Efficient in-memory operations** for high-performance caching.\n- **RESTful API integration** for easy communication with LunarDB instances.\n\n## Installation\n\nTo install the LunarDB Python SDK, run the following:\n\n```bash\npip install lunardb-py\n```\n\n## Usage\n\nHere is how you can use the SDK:\n\n### 1. Connecting to LunarDB\n\n```python\nfrom lunardb.client import LunarDBClient\n\n# Connect to a LunarDB instance\nclient = LunarDBClient(base_url=\"http://localhost:8000\")\n```\n\n### 2. Setting and Getting Keys\n\n```python\n# Set a value\nclient.set(\"mykey\", \"myvalue\")\n\n# Get a value\nvalue = client.get(\"mykey\")\nprint(f\"The value for 'mykey' is {value}\")\n```\n\n### 3. Deleting Keys\n\n```python\n# Delete a key\nclient.delete(\"mykey\")\n```\n\n### 4. List Operations\n\n```python\n# Push values to a list\nclient.rpush(\"mylist\", \"value1\")\nclient.rpush(\"mylist\", \"value2\")\n\n# Pop the last value from the list\nlast_value = client.rpop(\"mylist\")\nprint(f\"Popped value: {last_value}\")\n\n# Get a range of values from the list\nvalues = client.lrange(\"mylist\", 0, -1)\nprint(f\"Values in 'mylist': {values}\")\n\n# Get the length of the list\nlength = client.llen(\"mylist\")\nprint(f\"Length of 'mylist': {length}\")\n```\n\n## API Reference\n\n### `LunarDBClient` Class\n\n- `__init__(base_url: str, api_key: Optional[str] = None)`: Initializes the LunarDB client.\n- `set(key: str, value: Any)`: Sets a key-value pair in LunarDB.\n- `get(key: str)`: Retrieves the value for a given key.\n- `delete(key: str)`: Deletes a key from the database.\n- `rpush(key: str, value: Any)`: Pushes a value to a list.\n- `rpop(key: str)`: Removes and returns the last element of a list.\n- `lrange(key: str, start: int, stop: int)`: Retrieves a range of elements from a list.\n- `llen(key: str)`: Gets the length of a list.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazooki123%2Flunardb-python-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkazooki123%2Flunardb-python-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazooki123%2Flunardb-python-sdk/lists"}