Tripo Python Client
Project description
Tripo Python Client
This is a Python client for the Tripo API.
Installation
pip install tripo
export TRIPO_API_KEY="your_api_key"
Usage
from tripo import Client
with Client() as client:
balance = client.get_balance()
print(f"Balance: {balance.balance}, Frozen: {balance.frozen}")
from tripo import Client, FileToken
# Initialize the client
with Client() as client:
# Create a task to generate a model from text
success_task = client.text_to_model(
prompt="A 3D model of a futuristic car",
texture=True,
pbr=True
)
print(f"Created task with ID: {success_task.task_id}")
# Get 3d model
data = client.try_download_model(success_task.task_id)
with open("model.glb", "wb") as f:
f.write(data.model)
from tripo import Client, FileToken
# Initialize the client
with Client() as client:
# Upload a file
upload_data = client.upload_file('path/to/your/image.jpg')
print(f"Uploaded file token: {upload_data.image_token}")
# Create a task to generate a model from an image
success_task = client.image_to_model(
file_token=upload_data.image_token,
model_version='v1.4-20240625',
texture=True,
pbr=True
)
print(f"Created task with ID: {success_task.task_id}")
# Get 3d model
data = client.try_download_model(success_task.task_id)
with open("model.glb", "wb") as f:
f.write(data.model)
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
tripo-0.1.2.tar.gz
(11.8 kB
view details)
Built Distribution
tripo-0.1.2-py3-none-any.whl
(4.7 kB
view details)
File details
Details for the file tripo-0.1.2.tar.gz
.
File metadata
- Download URL: tripo-0.1.2.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.24
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03a5e0131f0986c79cec5515671b4a53dd40e17936ecc419dc755a35f746b135 |
|
MD5 | dd4b2ef6f7059a05371002cf01c02a6e |
|
BLAKE2b-256 | f96642347140070c2d54e419ff13d768f22e13a4b4090b85b0c60a304e16743c |
File details
Details for the file tripo-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: tripo-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.24
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4002cf71c355ab40304243e8c203fbfad8aee5294f18b661fd8efb6128babcba |
|
MD5 | 64d128e61f84a09d22de7eaa50fa8bc5 |
|
BLAKE2b-256 | fc83376bc2d78c86c32093c08189c3126e2fea4f610f8342fffcdab00ff3386d |