OTO
inside the engine · from ARCHITECTURE.md at v0.6.1

Where to add things

  • A new source format. Shipped: text and Markdown, Word, PowerPoint, PDF, Excel, HTML with its images, MHTML archives, and legacy Office through LibreOffice. Add a module under intake/extractors/ that subclasses Extractor, declares its extensions, and returns a Document. Register it in the extractors package. No core file changes.
  • A new command. Add cli/<name>.py with cmd_* handlers and register(sub), then list it in COMMANDS in cli/init.py. Use project_arguments for the --project flag.
  • A new compile output. Add a stage module with run(project) and append it to STAGES in builder.py. Add every path it writes to generated_paths, or the transaction cannot restore it.
  • A new query tool. Add a *_text function and a TOOLS entry in serve/engine.py. The CLI mode maps a command word to the same function.
  • A new starter vocabulary. Export one from a project with oto ontology export, which writes it to ~/.oto/ontologies/<name>/ (or OTO_ONTOLOGIES). A user ontology shadows a shipped one of the same name, and oto init --ontology also accepts a directory path. To ship one with the package, add the same four files under ontologies/; the ontology test takes it through init, build and a query automatically.