A Python client for the Elasticsearch REST API
Project description
pyKobana Library
A Python library to access Kobana API through HTTP requests.
Installation
pip install pyKobana
Usage
from pyKobana import Kobana
# Initialize the Kobana client
kobana = Kobana("dev", "YOUR_API_TOKEN")
# Get wallets
wallets = kobana.get_wallets()
print(wallets)
Methods
Kobana.get_wallets()
Fetches the list of wallets.
Returns:
list: A list of wallet objects.
Kobana.get_wallet(wallet_id)
Fetches details of a specific wallet.
Parameters:
wallet_id(str): The ID of the wallet to fetch.
Returns:
dict: A dictionary containing wallet details.
Kobana.create_wallet(data)
Creates a new wallet.
Parameters:
data(dict): A dictionary containing wallet creation data.
Returns:
dict: A dictionary containing the created wallet details.
Kobana.update_wallet(wallet_id, data)
Updates an existing wallet.
Parameters:
wallet_id(str): The ID of the wallet to update.data(dict): A dictionary containing wallet update data.
Returns:
dict: A dictionary containing the updated wallet details.
Kobana.delete_wallet(wallet_id)
Deletes a wallet.
Parameters:
wallet_id(str): The ID of the wallet to delete.
Returns:
None
Example
from pyKobana import Kobana
# Initialize the Kobana client
kobana = Kobana("dev", "YOUR_API_TOKEN")
# Create a new wallet
new_wallet = kobana.create_wallet({"name": "New Wallet"})
print(new_wallet)
# Get details of a specific wallet
wallet = kobana.get_wallet(new_wallet["id"])
print(wallet)
# Update the wallet
updated_wallet = kobana.update_wallet(new_wallet["id"], {"name": "Updated Wallet"})
print(updated_wallet)
# Delete the wallet
kobana.delete_wallet(new_wallet["id"])
print("Wallet deleted")
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pykobana-0.0.4.tar.gz.
File metadata
- Download URL: pykobana-0.0.4.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54368b128077bcf5788fa4260cb60d769cb833b36b76b38b44cc1f6a872768e6
|
|
| MD5 |
37346f844f69dc432e9403922082cfa0
|
|
| BLAKE2b-256 |
a2bc37e1be3a0910c24f75f6df2923898e609d7620f394f0e0a677c7a347ed08
|
File details
Details for the file pyKobana-0.0.4-py3-none-any.whl.
File metadata
- Download URL: pyKobana-0.0.4-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
533ff1948890e33dca374e6fb2f838915484907ce94ccf297d059875f178936f
|
|
| MD5 |
c330939e7a4705fb784ffdb5cbd8c2a2
|
|
| BLAKE2b-256 |
d6c72ff26bf1cb0c3631c04120057ee1019baf06e43db2ce0863e4f6f39cc96b
|