Skip to main content

forjio-locavello

Typed Python client for the locavello.forjio.com localization REST API.

pip install forjio-locavello
from forjio_locavello import LocavelloClient, paginate

# Bearer token from api_key= or the LOCAVELLO_API_KEY env var — use an
# lv_live_... API key from Dashboard -> Settings -> API keys.
client = LocavelloClient(api_key="lv_live_xxx")

# Projects — create, browse, locales + namespaces
project = client.projects.create(slug="marketing-site", name="Marketing Site")
page = client.projects.list(limit=20)  # {"data", "cursor", "has_more"}
detail = client.projects.get(project["id"])  # + locale stats, namespaces, lastRelease
client.projects.add_locale(project["id"], tag="id", fallback="en")
client.projects.update_locale(project["id"], "id", enabled=True)
stats = client.projects.locales(project["id"])  # plain array, not a Page
client.projects.add_namespace(project["id"], name="checkout", review_policy="gated")

# Keys — bulk-sync source strings (max 2000 per request), then browse
result = client.keys.upsert(
    project["id"],
    keys=[
        {"name": "cta.title", "sourceText": "Get started"},
        {"namespace": "checkout", "name": "pay.button", "sourceText": "Pay now", "maxLength": 12},
    ],
    prune=True,
)  # {"created", "updated", "archived"}
for key in paginate(lambda c: client.keys.list(project["id"], status="missing", cursor=c)):
    print(key["name"])

# Translations — set values, work the review queue
client.translations.set("key_...", "id", value="Mulai sekarang", status="needs_review")
queue = client.translations.review_queue(project["id"], locale="id")
client.translations.approve(queue["data"][0]["id"])
client.translations.reject("trn_...", reason="Wrong tone")

# Releases — publish per locale, pull catalogs, gate CI
release = client.releases.publish(project["id"], locale="id")
bundle = client.releases.pull(project["id"])  # all released catalogs + fallbacks
check = client.releases.check(project["id"])  # {"ok", "errors", "warnings", "stats"}
diff = client.releases.diff(release["id"], "rel_previous")

# Jobs — machine translate + site crawl
job = client.jobs.translate(project["id"], locale="id")
job = client.jobs.get(job["id"])  # poll: queued | running | done | failed
client.jobs.crawl(project["id"])  # proxy-mode projects
pages = client.jobs.pages(project["id"])

# Glossary + translation memory
client.glossary.create(term="Forjio")  # no translation = do-not-translate
client.glossary.create(term="checkout", locale="id", translation="pembayaran")
tm = client.tm.suggest(text="Get started", target="id")  # {"exact", "fuzzy"}
hits = client.tm.search(q="started", target="id")

# API keys + billing
minted = client.api_keys.create(name="ci")  # plaintext shown once
info = client.billing.get()
out = client.billing.checkout("pro")  # redirect the browser to out["hostedUrl"]

# Public surface — no api key required, never sends Authorization
preview = client.public.preview(url="https://example.com", target_locale="id")
result = client.public.preview_result(preview["previewId"])
catalog = client.public.catalog(project["id"], locale="id")

Endpoints covered

Namespace Methods
projects create, list, get, update (nullable site_url), add_locale, update_locale, locales, add_namespace, update_namespace
keys upsert (bulk sync + prune), list (namespace / q / locale / status / archived / limit / cursor)
translations update_key, set (value + status + author, returns lengthWarning), review_queue, approve, reject
releases publish, list, get, pull (draft / pseudo), check, diff
jobs translate, crawl, pages, list, get
glossary create, list, delete
tm suggest(text, target), search(q, target)
api_keys create, list, revoke
billing get (subscription + usage + tier table), checkout(tier) -> hosted checkout URL
public preview, preview_result, catalog (no api key)

List methods return a Page dict {"data", "cursor", "has_more"}; paginate(fetch) walks every page of any list method. Idempotent GETs are retried automatically (max 2) on HTTP 429/502/503/504 and network errors with exponential backoff from retry_base_ms.

Errors raise LocavelloError carrying the API envelope's error.code (NOT_FOUND, VALIDATION_ERROR, AUTH_REQUIRED, ...), the HTTP status, and the meta.requestId.

Family

Sister to:

Metadata

Release files for forjio-locavello 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forjio-locavello 0.3.0
File Size Uploaded
forjio_locavello-0.3.0.tar.gz 20.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for forjio-locavello 0.3.0
File Interpreter ABI Platform
forjio_locavello-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.7 kB

Release files / forjio_locavello-0.3.0.tar.gz

Download URL forjio_locavello-0.3.0.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
31f91b4d6d60fb2a6c6460e2984ae445dc7dd561d8bb274c3f3b256c1db48c80
BLAKE2b-256 checksum
How to use checksums
1bfefc4b73a467c7fff740afd37fb5b6227bc9f21361d9ffd48a49d2a0476218
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / forjio_locavello-0.3.0-py3-none-any.whl

Download URL forjio_locavello-0.3.0-py3-none-any.whl
Size 17.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98d213c7850d25b5fbc4129a30c0c92f2ffe63a9408ae63aba4a57a4b95f9d16
BLAKE2b-256 checksum
How to use checksums
2918a0b1e7919ae66e3b9b7d98050dc2c625d2263cbe3257f5410ab231cc2686
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page