{"id":17902506,"url":"https://github.com/parthsharma2/key-value-store","last_synced_at":"2025-08-15T06:32:02.764Z","repository":{"id":125176319,"uuid":"229190087","full_name":"parthsharma2/key-value-store","owner":"parthsharma2","description":"A REST API based key value store implemented in python","archived":false,"fork":false,"pushed_at":"2023-05-22T22:36:23.000Z","size":21,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T08:51:31.093Z","etag":null,"topics":["datastore","key-value","python","python3"],"latest_commit_sha":null,"homepage":"","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/parthsharma2.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":"2019-12-20T04:30:38.000Z","updated_at":"2024-05-22T13:16:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"3e615cd9-9ab0-456f-949d-cda028375649","html_url":"https://github.com/parthsharma2/key-value-store","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/parthsharma2/key-value-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parthsharma2%2Fkey-value-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parthsharma2%2Fkey-value-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parthsharma2%2Fkey-value-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parthsharma2%2Fkey-value-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parthsharma2","download_url":"https://codeload.github.com/parthsharma2/key-value-store/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parthsharma2%2Fkey-value-store/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270533850,"owners_count":24602148,"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","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"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":["datastore","key-value","python","python3"],"created_at":"2024-10-28T16:35:52.374Z","updated_at":"2025-08-15T06:32:02.485Z","avatar_url":"https://github.com/parthsharma2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KVS - Key Value Store\nA REST API based Key Value Store.\n\n## Getting Started\nThese instructions wil get you a copy of the project up and\nrunning on your local machine for development and testing purposes.\n\n### Requirements\n\n- `python3.6+`\n\n### Installing\n\nClone the project.\n```bash\ngit clone https://github.com/parthsharma2/key-value-store.git\n```\n\nMove into the project directory.\n```bash\ncd key-value-store\n```\n\nCreate a python virtual environment and activate it.\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\n```\n\nInstall python dependencies.\n```bash\npip install -r requirements.txt\n```\n\n\n## Usage\nKVS can be used via REST API or a CLI.\n\n### Starting the server\nUse the following command to start the KVS REST API server.\n```bash\npython -m kvs.server\n```\nThis will start the server on the default host `127.0.0.1` and port `25552`.\nTo run it on a custom host and port use the following command\n```bash\npython -m kvs.server -H 127.0.0.1 -p 25252\n```\nor\n```bash\npython -m kvs.server --host=127.0.0.1 --port=25252\n```\n\n### Starting the client\nUse the following command to start the KVS Client. Make sure the\nKVS REST API server is running.\n```bash\npython -m kvs.client\n```\nThis will start the client and try to connect with a KVS REST API\nserver running on host `127.0.0.1` and port `25552`.\nIf your KVS REST API server is running on a different host and/or port use\nthe following commands.\n```bash\npython -m kvs.client -H 127.0.0.1 -p 25252\n```\nor\n```bash\npython -m kvs.client --host=127.0.0.1 --port=25252\n```\n\n### API Endpoints\nThe following REST API endpoints are available:\n\n| Endpoint      | HTTP Method     | Description       |\n|---------------|-----------------|-------------------|\n|`/api/\u003ckey\u003e`   | `GET`           | Gets the value of the key `\u003ckey\u003e`. Returns `null` if the key does not exist.|\n|`/api/\u003ckey\u003e`   | `POST`          | Sets the value of the key `\u003ckey\u003e` to the value specified in the posted json data. The data to be posted should be a json key value pair of the format `{\"value\": \"some value\"}`. A successful POST request will set the value of `\u003ckey\u003e` to the value specified by `\"value\"` in the posted json data.|\n|`/api/\u003ckey\u003e`   | `DELETE`        | Deletes the key value pair specified by `\u003ckey\u003e`|\n|`/api/ping`    | `GET`           | Gets the status of the server.|\n\n### CLI Commands\nIn the client the following CLI commands are available:\n\n| Command           | Description       |\n|-------------------|-------------------|\n|`get \u003ckey\u003e`        | Get the value of the key `\u003ckey\u003e`. Returns `null` if the key does not exist. |\n|`set \u003ckey\u003e \u003cvalue\u003e`| Set the value of the key `\u003ckey\u003e` to `\u003cvalue\u003e`.|\n|`delete \u003ckey\u003e`     | Deletes the key value pair specified by `\u003ckey\u003e`.|\n|`exit`             | Quits and closes the client.|\n\n\n## Examples\n\n### REST API\nMake sure the REST API server is running.\n\nWe'll use `curl` to send HTTP requests to the KVS REST API server.\n```bash\n# Check status of the server\ncurl -i http://localhost:25552/api/ping\n\n# Let's try and get key \"hello\" value\ncurl -i http://localhost:25552/api/hello\n# We get \"null\" because the value of hello is not set\n\n# Let's set the value of \"hello\" to \"world\"\ncurl -i -d '{\"value\":\"world\"}' -H \"Content-Type: application/json\" -X POST http://localhost:25552/api/hello\n\n# Now let's again try to get the value of \"hello\"\ncurl -i http://localhost:25552/api/hello\n# This time we get the value \"world\"\n\n# Let's delete the key \"hello\"\ncurl -i -X DELETE http://localhost:25552/api/hello\n\n# Just to check if \"hello\" is deleted let's try to get it\ncurl -i http://localhost:25552/api/hello\n# We get \"null\"\n```\n### CLI Commands\nMake sure the REST API server is running and start the client.\n\nIn the client shell use the following commands:\n```bash\n# Get the value of key \"hello\"\nget hello\n\n# Set the value of \"hello\" to \"world\"\nset hello world\n\n# Get the value of key \"hello\"\nget hello\n\n# Delete the key \"hello\"\ndelete hello\n\n# Get the value of \"hello\"\nget hello\n\n# Exit the client\nexit\n```\n\n## Running the Tests\nTo run the tests use the following command while in the project root directory:\n```\npytest tests/\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparthsharma2%2Fkey-value-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparthsharma2%2Fkey-value-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparthsharma2%2Fkey-value-store/lists"}