Skip to main content

Textoria API Client for Python

Project description

Textoria API

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.

Features

  • Store key-value pairs
  • Retrieve all key-value pairs
  • Update the value of a specific key
  • Delete a specific key-value pair

Installation

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.txt

Usage

First, 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)

Get all keys

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)

Create a new key-value pair

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)

Update an existing key-value pair

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)

Delete a key-value pair

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)

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue to report bugs or suggest improvements.

License

This project is released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

textoria-0.0.1.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file textoria-0.0.1.tar.gz.

File metadata

  • Download URL: textoria-0.0.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for textoria-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d30e7d0397f60f77c4ce809aad193d559ee7c17011543d910049ca5f167c366f
MD5 228b677f9ed1ef274c294cea5bc344ad
BLAKE2b-256 c758aa9f63c0453f2d5ac9d81a818aab54454c02f6bfa72333acc45194295d2d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page