Skip to content

Latest commit

 

History

History
75 lines (52 loc) · 2.61 KB

File metadata and controls

75 lines (52 loc) · 2.61 KB

PyPI-Server DOI Codecov docs license

osw

Python toolset for data processing, queries, wikicode generation and page manipulation within OpenSemanticLab.

Work with OpenSemanticLab instances the way you work with Python objects: load pages as typed pydantic entities, query with semantic search, generate models from the schemas stored in the wiki, and write changes back.

Documentation: https://opensemanticlab.github.io/osw-python/

Installation

pip install osw

Optional extras (osw[wikitext], osw[DB], osw[S3], osw[dataimport], osw[UI], osw[mcp], osw[all]) are described in the Get Started guide.

Quickstart

from osw.express import OswExpress

osw = OswExpress(domain="wiki-dev.open-semantic-lab.org")
instances = osw.site.semantic_search("[[Category:Item]]")
print(instances)

More runnable scripts live in examples/, and the Basics tutorial walks through the OpenSemanticLab data model.

Tools

Installing osw also installs an osw command line client, and the osw[mcp] extra adds an MCP server that exposes a live instance to agent clients such as Claude Code:

osw search ask '[[Category:Item]]' --limit 5

Commands, tools and their configuration are described in the Tools guide.

Logging

osw reports what it is doing on the osw logger at INFO by default. Levels, the OSW_LOG_LEVEL environment variable and how to collect the records in your own logging setup are described in the Get Started guide.

Contributing

Contributions are welcome, see CONTRIBUTING.md. Development setup, checks and tests are one command each: make install, make check, make test.

Related projects

General features for object-oriented interaction with knowledge graphs live in the standalone package oold-python.

License

AGPL-3.0-or-later, see LICENSE.txt.