You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The LegendKeeper door (onlyworlds.legendkeeper; built on the API's answers as recorded 2026-10-22): import_legendkeeper(source, project_id, out_dir, plan_only=False, type_map=None, include_hidden=False, include_secrets=False) and python -m onlyworlds.legendkeeper --project ID OUT-DIR [--plan] [--key-file PATH] [--map TAG=TYPE ...] [--include-hidden] [--include-secrets] read a LegendKeeper project through its API v3 into a world folder written through write_folder. No AI. Reading and converting are apart: a Source answers one GET; ApiSource(key) is the live API (GET only, Authorization: Bearer, stdlib urllib, paced on x-ratelimit-remaining/-reset, a 429's Retry-After honoured, cursor paging), RecordedSource answers from recorded replies; read_project walks a source into a Snapshot and the converter reads only that. The key comes from LEGENDKEEPER_API_KEY or --key-file, and is never stored, printed, or written into the folder or the report. What becomes what: a resource becomes an element typed by a tag equal to one of the 22 type names (any case) or one --map names, never a guess; a resource with no type tag, or two, is a Narrative with supertype legendkeeper. Its page blocks become the description as Markdown (headings, runs, lists, tables, quotes, callouts, code, images and embeds as their URL; a mention as its display text). A keyValue row whose key names a field of the type becomes it when the value fits (text, a whole number, mentions of the linked type); a titled resourceLink list whose title names a link field and whose targets fit becomes it; otherwise each target becomes a Relation element named by the title (actor for a Character source, Relation's field for each end's type, x_legendkeeper_source/_target for the direction). A timeline's events become Events with x_legendkeeper_start/_end ({"minutes", "formatted"}), _calendar, _lane, _timeline; start_date/end_date stay unset, since converting the minutes needs the world's time settings (a later step). What it keeps: every key not placed, as x_legendkeeper_<key>; tags, aliases, the LegendKeeper id, the parent's element id (and parent_location/parent_institution under a parent of the same type), the mentioned elements' ids as x_legendkeeper_mentions. What it leaves out, counted: hidden resources and their subtrees, hidden documents, properties and events, and secret blocks, each opt-in by a flag; hidden content is not fetched. Map and board documents are named, not imported. Ids are UUIDv5 in LEGENDKEEPER_NAMESPACE of legendkeeper:<project>:<resource id> (events :event:<id>, Relations :link:<resource>:<list>:<item>), so a second import finds the same elements. world.json carries producer{"tool": "onlyworlds", "version": ..., "input": "legendkeeper-api"}, a word new to the folder spec's list. The report (ImportReport, printed at the end and by --plan) names how each type was decided, the tags --map could use, every key not placed, every titled link kept as Relations with counts, every link or mention whose target is not in the folder, what was omitted, the documents not imported, every answer that could not be read, and what is not kept (icons, rank, timestamps, permissions). Tested on three recorded wire answers (tests/fixtures/legendkeeper/); a real worldbuilder's project is the walk still to come.