OpenFormatDB
v0.3.0Identify a file, find open tools for its format, convert it locally with WebAssembly.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
identify_file Identify a file
Candidate formats for a file, ranked: a signature match beats a MIME type, which beats an extension. Read the bytes yourself and pass them as hex; the file never leaves the machine: magic_hex = the first bytes (`xxd -p -l 1024 file`), tail_hex = the last bytes (`tail -c 512 file | xxd -p`) so end-of-file signatures can be checked, whole_file when magic_hex is the entire file. Full PRONOM signatures and their priorities decide between close formats (PNG 1.0 / 1.2 / APNG). Then call lookup_format on the best candidate.
| Parameter | Type | Description |
|---|---|---|
extension | string | File name or extension, e.g. report.doc or .doc |
limit | integer | |
magic_hex | string | First bytes of the file as hex, spaces allowed (1024 bytes recommended) |
mime | string | MIME type if known, e.g. from `file --mime-type` |
tail_hex | string | Last bytes of the file as hex (512 bytes recommended) |
whole_file | boolean | magic_hex holds the entire file |
lookup_format Look up a format
Full record of a format: identifiers, which software reads or writes it (open source first), grammars, specification, family and versions, live claims, and advice on what to do next. Find it by id, PRONOM PUID, Wikidata QID, or MIME type.
| Parameter | Type | Description |
|---|---|---|
id | string | OpenFormatDB id, from identify_file or search_formats |
mime | string | |
puid | string | PRONOM id, e.g. fmt/13 |
wikidata | string | Wikidata QID, e.g. Q178051 |
search_formats Search formats
Ranked formats matching a name, alias, extension, MIME type, PUID or QID, optionally by category or status.
| Parameter | Type | Description |
|---|---|---|
query * | string | |
category | string | |
limit | integer | |
status | string | unknown, in-progress, partial, readable (open code reads it), writable (open code writes it) |
find_conversion Find a conversion
How to convert a file from one format to another with open tools: the cheapest chains (lossless first), each step with its tool, command and what is lost. Formats as ids or extensions ("docx", "report.wpd"). Without `to`, lists the direct conversions.
| Parameter | Type | Description |
|---|---|---|
from * | string | Source format id, extension or file name |
max_steps | integer | Longest chain (default 3) |
to | string | Target format id, extension or file name |
convert_file Convert a file locally
Convert a file on this machine to another format with open-source converters compiled to WebAssembly: ImageMagick (images, raw photos), resvg (SVG), FFmpeg (audio, video), Pandoc (documents, markup), 7-Zip (archives), GDAL (geodata), Assimp (3D). Nothing is uploaded. Each engine is downloaded once on first use (2 to 59 MB, pinned versions, SHA-256 checked) into ~/.cache/openformatdb/engines. Call with only `path` to list what the file can become; chains of two engines are planned automatically (svg → png → webp). Writes next to the input unless `output` is given, and never overwrites a fil…
| Parameter | Type | Description |
|---|---|---|
path * | string | File to convert (absolute, or relative to the server's working directory) |
output | string | Output file path (default: next to the input, same name, new extension) |
to | string | Target extension: webp, mp3, docx, kml, glb, zip… |
list_sources List sources
Sources aggregated in OpenFormatDB, with record counts, licences and snapshot dates.
claim_format Claim a format
Say you are reverse engineering or documenting a format, so nobody duplicates the work: adds a claim (who, contact, scope, up to 90 days) to data/formats/<id>.yaml, creating the record if the format is new. Call lookup_format first.
| Parameter | Type | Description |
|---|---|---|
contact * | string | How others reach the claimant: email, GitHub handle, issue URL |
scope * | string | What you will document, e.g. "header and index", "full read support" |
who * | string | Who is working on it: your human's name or handle |
agent | string | Agent/tooling used |
category | string | Required only for a new format |
days | integer | Claim duration (default 30, max 90) |
extensions | array | Extensions of a new format, without the dot |
force_new | boolean | Create a new record even though a similar format exists |
id | string | Format id if it exists (from identify_file, lookup_format or search_formats). Otherwise give name + category. |
name | string | Format name, for a format not in OpenFormatDB yet |
version | string |
publish_findings Publish findings
Merge what you found into data/formats/<id>.yaml: structure, grammars, tools, conversions, specification, identifiers, verification. Status only moves forward. Optionally release your claim. Then open a pull request.
| Parameter | Type | Description |
|---|---|---|
id * | string | Format id |
patch * | object | |
allow_downgrade | boolean | Allow lowering the status (explain why in the summary or a verification note) |
release_claim_of | string | Remove the live claims of this claimant now that the work is published |