Textoria API is a simple key-value store API that allows you to store, retrieve, update, and delete key-value pairs. It is built using aiohttp and provides an asynchronous interface for efficient and fast operations.
- Store key-value pairs
- Retrieve all key-value pairs
- Update the value of a specific key
- Delete a specific key-value pair
To use the Textoria API, simply clone the repository and install the required dependencies:
git clone https://github.com/your_username/textoria-api.git
cd textoria-api
pip install -r requirements.txtFirst, you need to instantiate the Textoria class with the API URL:
from textoria import Textoria
api_url = "https://example.com/api"
textoria = Textoria(api_url)To retrieve all the key-value pairs stored in the system, you can use the get_all_keys method:
keys = await textoria.get_all_keys()
print(keys)To create a new key-value pair, use the create_key method with the key and value as arguments:
new_key = "example_key"
new_value = "example_value"
response = await textoria.create_key(new_key, new_value)
print(response)To update the value of an existing key, use the update_key method with the key and the new value as arguments:
key = "example_key"
new_value = "updated_value"
response = await textoria.update_key(key, new_value)
print(response)To delete a specific key-value pair, use the delete_key method with the key as argument:
key = "example_key"
response = await textoria.delete_key(key)
print(response)Contributions are welcome! Please feel free to submit a pull request or open an issue to report bugs or suggest improvements.
This project is released under the MIT License.