Skip to main content

fastokf

fastokf parses Open Knowledge Format (OKF) concept documents into Pydantic models.

OKF documents are Markdown files with YAML frontmatter. fastokf reads them into useful, typed Python objects.

Install

This project targets Python 3.10 and newer.

uv sync

For development, install the test group too:

uv sync --group dev

Parse a document

from fastokf import parse_string

document = parse_string("""---
type: Metric
title: Revenue
tags: [finance]
generated:
  by: human:finance-team
  at: 2026-06-20T22:53:05Z
---
# Definition

Recognized revenue for a fiscal year.
""")

print(document.frontmatter.title)  # Revenue
print(document.body)

Input sources

Parse documents from text, files, URLs, or open text streams:

from fastokf import parse_file, parse_file_object, parse_string, parse_url

parse_string(okf_text)
parse_file("knowledge/metrics/revenue.md")
with open("knowledge/metrics/revenue.md", encoding="utf-8") as file:
    parse_file_object(file)
parse_url("https://example.com/knowledge/metrics/revenue.md")

parse() also accepts any of these sources directly:

from pathlib import Path

from fastokf import parse

parse(Path("knowledge/metrics/revenue.md"))  # filesystem path
parse("https://example.com/revenue.md")      # HTTP(S) URL
parse("---\ntype: Metric\n---\n")             # document text

Development

uv run pytest

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastokf-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastokf-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file fastokf-0.1.0.tar.gz.

File metadata

  • Download URL: fastokf-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fastokf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1c710f700c79dc71def9b4f5d6d9c1355b62c2540eff04b98656f21a6cbe833b
MD5 6f0bba62142f3b68c03294b9eaba2d8b
BLAKE2b-256 80f1b7e92a28ebe88e52977e8648f82172aa92d551842954dfcfd2772ddf74b4

See more details on using hashes here.

File details

Details for the file fastokf-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fastokf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fastokf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93387088acf25667efaea36c75bf7e4e5352365f044f99f982ee804962744c26
MD5 b6773a680aaf921d0c50faf21adcec4b
BLAKE2b-256 914bbd2d18531997fd480de696edfc548b723e7fbbc06b99cffc2279f42fbcbd

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page