SDK for interacting with the Mantis API
Project description
SDK for Your Django API
Overview
This SDK provides a Python interface for interacting with your Django-based API. It simplifies the process of making requests to various endpoints, handling authentication, and parsing responses.
Features
- Fetch user emails by ID.
- Rename spaces.
- Update shared users for a space.
- Retrieve shared spaces.
- Create, update, and delete spaces.
- Upload images to spaces.
- Manage metadata and visibility for spaces.
- Monitor space creation progress.
Installation
Install the SDK using pip:
pip install your-sdk-name
Usage
Initialization
from your_sdk_name import YourAPIClient
# Initialize the client
client = YourAPIClient(base_url="https://api.example.com", token="your-auth-token")
Available Methods
Fetch Email by User ID
email_data = client.get_email_by_user_id(user_id="12345")
print(email_data)
Rename Space
response = client.rename_space(space_id="space-id", new_name="New Space Name")
print(response)
Update Shared Users
response = client.update_shared_users(space_id="space-id", user_ids=["user1", "user2"])
print(response)
Retrieve Shared Spaces
shared_spaces = client.get_shared_spaces()
print(shared_spaces)
Create Space
space_data = {
"space_name": "My Space",
"is_public": True,
"data_types": [{"name": "field1", "semantic": True}],
"file": open("data.csv", "rb")
}
response = client.create_space(data=space_data)
print(response)
Update Space Visibility
response = client.update_space_visibility(space_id="space-id")
print(response)
Delete Space
response = client.delete_space(space_id="space-id")
print(response)
Update Space Metadata
metadata = {"key": "value"}
response = client.update_space_metadata(space_id="space-id", metadata=metadata)
print(response)
Get Space Metadata
metadata = client.get_space_metadata(space_id="space-id")
print(metadata)
Get Space Progress
progress = client.get_space_progress(space_id="space-id")
print(progress)
Upload Images
files = [open("image1.jpg", "rb"), open("image2.jpg", "rb")]
response = client.upload_images(files=files, space_name="My Space", is_public=True)
print(response)
Contributing
Contributions are welcome! Please submit issues and pull requests to improve the SDK.
License
This SDK is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
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 Mantis_SDK-1.0.0.tar.gz.
File metadata
- Download URL: Mantis_SDK-1.0.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebbe9d06f03fe5bae68328ac8110211ad6e6f82751961fef05288f3ac313aa52
|
|
| MD5 |
1d7873375ea2c226f14f56d016b52e60
|
|
| BLAKE2b-256 |
3b797202bb780f0178c9904a31153472bc59bc737179de780ec742d31b754e48
|
File details
Details for the file Mantis_SDK-1.0.0-py3-none-any.whl.
File metadata
- Download URL: Mantis_SDK-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d4e2847bf2fc225b3a2cc0dfe8e18f5a97302461ee1ebd67d3b2dd68f712dfd
|
|
| MD5 |
1ed48748b014cfe1f4d844de8e159650
|
|
| BLAKE2b-256 |
6fae6a8cc27b599121c403b3ef6c70a59ab3fa098a98a949a22019a08886e819
|