Python ctypes bindings for the oer_lib shared library.
Project description
oer-lib-python
oer-lib-python is a small Python wrapper around the native oer_lib shared library.
It lets you build an in-memory catalog of organizations and events, search text against it,
and receive structured Python objects or raw JSON results.
Features
- Thin
ctypes-based binding with no runtime Python dependencies. - Structured dataclass results for organizations, events, and text spans.
- Configurable search options and catalog token filtering.
- Bundled Linux shared library for immediate local use.
Installation
pip install oer-lib-python
This package currently bundles a prebuilt liboer_lib.so for Linux x86_64.
If you target another platform, build and ship a compatible shared library first.
Quick Start
from oer_lib import C_Controller, CatalogConfig
organizations = ["OpenAI", "Google"]
events = [
("OpenAI", "DevDay"),
("Google", "I/O"),
]
with C_Controller.from_records(
organizations=organizations,
events=events,
config=CatalogConfig.empty(),
) as controller:
results = controller.search("OpenAI проведет DevDay в ноябре")
print(results)
API Overview
Main exports:
C_ControllerCatalogConfigSearchOptionsSearchResultResolvedOrganizationResolvedEventTextSpan
C_Controller.search() returns parsed dataclasses.
C_Controller.search_json() returns the raw JSON produced by the native library.
Development
python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
pytest
python -m build
Publishing Notes
- The wheel includes
src/oer_lib/liboer_lib.so. - The source distribution includes the same binary via
MANIFEST.in. - Before publishing, verify that the bundled shared library matches your supported target platform.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file oer_lib_python-0.1.0.tar.gz.
File metadata
- Download URL: oer_lib_python-0.1.0.tar.gz
- Upload date:
- Size: 305.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d49cf017a14c6a322c8cbe2e14d35a4ff927500d565eb90dda6a51de6ff6fd2
|
|
| MD5 |
255a903d7e9ed2a582c71df86d57b4c7
|
|
| BLAKE2b-256 |
9c8afe0e4e919828e1701cf2b659d90b55490685adaa248ed86fd46e3d311199
|