Official Python SDK for the FloopFloop API
Project description
floopfloop
Official Python SDK for the FloopFloop API. Build a project, refine it, manage secrets and API keys from any Python 3.10+ codebase.
Install
pip install floopfloop
Quickstart
Grab an API key via the floop CLI
(floop keys create my-sdk) or the dashboard → Account → API Keys. Business
plan required to mint new keys.
import os
from floopfloop import FloopClient
floop = FloopClient(api_key=os.environ["FLOOP_API_KEY"])
# Create a project and wait for it to go live.
created = floop.projects.create(
prompt="A landing page for a cat cafe with a sign-up form",
name="Cat Cafe",
subdomain="cat-cafe",
bot_type="site",
)
live = floop.projects.wait_for_live(created["project"]["id"])
print("Live at:", live["url"])
Streaming progress
for event in floop.projects.stream(project_id):
print(f"{event['status']} ({event['step']}/{event['total_steps']}) — {event['message']}")
Error handling
Every call raises FloopError on non-2xx. Switch on .code:
import time
from floopfloop import FloopClient, FloopError
try:
floop.projects.create(prompt="...")
except FloopError as err:
if err.code == "RATE_LIMITED":
time.sleep((err.retry_after_ms or 5000) / 1000)
elif err.code == "UNAUTHORIZED":
print("Check your FLOOP_API_KEY.")
else:
print(f"[{err.request_id}] {err.code}: {err}")
raise
Resources
| Namespace | Methods |
|---|---|
floop.projects |
create, list, get, status, cancel, reactivate, refine, conversations, stream, wait_for_live |
floop.secrets |
list, set, remove |
floop.api_keys |
list, create, remove |
floop.library |
list, clone |
floop.subdomains |
check, suggest |
floop.uploads |
create (for attaching files to projects.refine) |
floop.usage |
summary |
floop.user |
me |
Authentication
Two token shapes are accepted on api_key:
| Prefix | Source | Plan gate |
|---|---|---|
flp_… |
Dashboard → API Keys, floop keys create |
Business (to mint) |
flp_cli_… |
floop login device token |
Free (unlimited) |
CLI device tokens (flp_cli_…) work here too — handy for local scripts that
already logged in through the CLI.
Configuration
floop = FloopClient(
api_key="flp_...",
base_url="https://www.floopfloop.com", # override for staging
timeout=30.0, # seconds
poll_interval=2.0, # for wait_for_live / stream
user_agent="myapp/1.2.3", # appended to User-Agent
)
Use as a context manager to close the underlying httpx.Client:
with FloopClient(api_key="...") as floop:
floop.projects.list()
Releasing (maintainers only)
This package publishes to PyPI via trusted publishing (OIDC) — no long-lived API token is stored in GitHub Actions.
Before the first release, register the trusted publisher at https://pypi.org/manage/project/floopfloop/settings/publishing/ (or, for a brand-new project, the pending-publisher page):
- PyPI project name:
floopfloop - Owner:
FloopFloopAI - Repository name:
floop-python-sdk - Workflow name:
release.yml - Environment name: leave blank
After that, ship a release by bumping pyproject.toml + src/floopfloop/_version.py, pushing a py-v<version> tag. The release workflow will build, test, and publish.
License
MIT. See LICENSE.
Related
- @floopfloop/sdk — Node.js twin of this SDK; same backend surface.
- floop-cli — the CLI that ships the same backend surface as a terminal UI.
- Customer docs — API reference.
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 floopfloop-0.1.0a1.tar.gz.
File metadata
- Download URL: floopfloop-0.1.0a1.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9a302cc37221557a771cce740ee43076aa34a42ce49004d12a1e7ab44aa9c6a
|
|
| MD5 |
d3a9811998d56b17ad209a77f39c4db4
|
|
| BLAKE2b-256 |
0094f4d70463d6587386bd9a937c1daecc23ef34830a2a83ed649e96a107e9a9
|
Provenance
The following attestation bundles were made for floopfloop-0.1.0a1.tar.gz:
Publisher:
release.yml on FloopFloopAI/floop-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
floopfloop-0.1.0a1.tar.gz -
Subject digest:
f9a302cc37221557a771cce740ee43076aa34a42ce49004d12a1e7ab44aa9c6a - Sigstore transparency entry: 1365632173
- Sigstore integration time:
-
Permalink:
FloopFloopAI/floop-python-sdk@9fc47d0b9637481177224bf7b15cb393fbfe9a10 -
Branch / Tag:
refs/tags/py-v0.1.0a1 - Owner: https://github.com/FloopFloopAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9fc47d0b9637481177224bf7b15cb393fbfe9a10 -
Trigger Event:
push
-
Statement type:
File details
Details for the file floopfloop-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: floopfloop-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef456e29dcbb57820607a7fb1f52a15a3e6463dfe581ee80de773fa3b5e94a0b
|
|
| MD5 |
729f3cc7776440bcd323bec58cb67370
|
|
| BLAKE2b-256 |
e519f5bd90d121ca6c497f357fa1bcd99ccc4b7f1df021f2f41f45755d432fa0
|
Provenance
The following attestation bundles were made for floopfloop-0.1.0a1-py3-none-any.whl:
Publisher:
release.yml on FloopFloopAI/floop-python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
floopfloop-0.1.0a1-py3-none-any.whl -
Subject digest:
ef456e29dcbb57820607a7fb1f52a15a3e6463dfe581ee80de773fa3b5e94a0b - Sigstore transparency entry: 1365632270
- Sigstore integration time:
-
Permalink:
FloopFloopAI/floop-python-sdk@9fc47d0b9637481177224bf7b15cb393fbfe9a10 -
Branch / Tag:
refs/tags/py-v0.1.0a1 - Owner: https://github.com/FloopFloopAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9fc47d0b9637481177224bf7b15cb393fbfe9a10 -
Trigger Event:
push
-
Statement type: