This project implements a key-value store with support for transaction and a REST API layer built using Flask. The data is persisted via SQLite3
kv_api.py # Core Functionality
kv_rest_api.py # REST API
requirements.txt
README.md git clone <your-repo-url>
cd Arcade# For Python 3.13
python3 -m venv venv
source venv/bin/activate
# OR
venv\Scripts\activate pip install -r requirements.txtpython kv_rest_api.pyIn another terminal, run the following curl commands.
curl -X POST http://127.0.0.1:5000/kv -H "Content-Type: application/json" -d '{"key": "city", "value": "San Francisco"}'
curl -X POST http://127.0.0.1:5000/kv -H "Content-Type: application/json" -d '{"key": "name", "value": "John"}'curl http://127.0.0.1:5000/kvcurl http://127.0.0.1:5000/kv/name
curl http://127.0.0.1:5000/kv/citycurl http://127.0.0.1:5000/kvcurl -X POST http://127.0.0.1:5000/kv -H "Content-Type: application/json" -d '{"key": "age", "value": 31}'curl -X DELETE http://127.0.0.1:5000/kv/citycurl -X POST http://127.0.0.1:5000/transaction/begin
curl -X POST http://127.0.0.1:5000/kv -H "Content-Type: application/json" -d '{"key": "temp", "value": "in_transaction"}'
curl -X POST http://127.0.0.1:5000/kv -H "Content-Type: application/json" -d '{"key": "transaction_test", "value": 123}'
curl -X POST http://127.0.0.1:5000/transaction/commit
curl http://127.0.0.1:5000/kvcurl -X POST http://127.0.0.1:5000/transaction/begin
curl -X POST http://127.0.0.1:5000/kv -H "Content-Type: application/json" -d '{"key": "rollback_test", "value": "should_not_persist"}'
curl -X POST http://127.0.0.1:5000/transactions/rollback
curl http://127.0.0.1:5000/kvcurl -X POST http://127.0.0.1:5000/kv -H "Content-Type: application/json" -d '{"value": "no_key"}'
curl -X POST http://127.0.0.1:5000/kv -H "Content-Type: application/json" -d '{"key": "no_value"}'
curl http://127.0.0.1:5000/kv/nonexistentpytest