Python SDK for meltingface.eu
Project description
Melting Face 🫠
A Python SDK that allows you to load prompts hosted on meltingface.eu. The library handles:
- Simple prompt objects (
Prompt) - Fetching public and private prompts from the MeltingFace hub
- Caching to avoid repeated downloads
Installation
pip install meltingface
Basic Usage
Loading a Public Prompt
from meltingface.prompt import Prompt
# Load a prompt from the public hub
prompt = Prompt.from_hub("owner/repo", version="0.1.0")
print(prompt.text) # -> "Hello from my prompt!"
print(prompt.version) # -> "v1"
Loading a Private Prompt
Private prompts require authentication with an API key:
from meltingface.prompt import Prompt
# Option 1: Pass the API key directly
prompt = Prompt.from_hub("owner/private-repo", api_key="your-api-key")
# Option 2: Set the MELTINGFACE_API_KEY environment variable
# export MELTINGFACE_API_KEY="your-api-key"
prompt = Prompt.from_hub("owner/private-repo")
API Reference
repo_id("owner/repo") is how you reference your prompt's repository on meltingface.euversionis optional; if not provided, the library defaults to"latest"api_keyis required for private prompts; can be passed directly or via the MELTINGFACE_API_KEY environment variablecache_dirlets you specify a custom cache location (defaults to ~/.meltingface/prompts)force_downloadwhen set to True, bypasses the cache and fetches the prompt again
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
meltingface-0.1.2.tar.gz
(12.3 kB
view details)
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 meltingface-0.1.2.tar.gz.
File metadata
- Download URL: meltingface-0.1.2.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68ccb52984bf11571e125eaad586f9201553466a1e0f33f9e4db84bc70b0209c
|
|
| MD5 |
4710409060374675aae5edf571d86188
|
|
| BLAKE2b-256 |
a4553fe5bc772e89b6e32a3e5122d4ea7b9cd9200c3aa25f96e6172dc4f26b63
|
File details
Details for the file meltingface-0.1.2-py3-none-any.whl.
File metadata
- Download URL: meltingface-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.5.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df843a5d0216351ad75b6d71004fd932caeae647da2b582510b3e14d88ab3775
|
|
| MD5 |
de87540e7301173e6193f1da36dc36d7
|
|
| BLAKE2b-256 |
38345106fcb182581681a4e49d59d0d8d2f1582f2b806024808ad328f88ca152
|