1use pyo3::prelude::*;
2
3mod annotation;
4mod annotationdata;
5mod annotationdataset;
6mod annotationstore;
7mod config;
8mod error;
9mod query;
11mod resources;
12mod selector;
13mod substore;
14mod textselection;
15
16use crate::annotation::{PyAnnotation, PyAnnotations};
17use crate::annotationdata::{PyAnnotationData, PyData, PyDataKey, PyDataValue};
18use crate::annotationdataset::PyAnnotationDataSet;
19use crate::annotationstore::PyAnnotationStore;
20use crate::error::PyStamError;
21use crate::resources::{PyCursor, PyOffset, PyTextResource};
22use crate::selector::{PySelector, PySelectorKind};
23use crate::substore::PyAnnotationSubStore;
24use crate::textselection::{PyTextSelection, PyTextSelectionOperator, PyTextSelections};
25
26const VERSION: &'static str = env!("CARGO_PKG_VERSION");
27
28#[pymodule]
29fn stam(py: Python<'_>, m: Bound<'_, PyModule>) -> PyResult<()> {
30 m.add("StamError", py.get_type::<PyStamError>())?;
31 m.add("VERSION", VERSION)?;
32 m.add_class::<PyAnnotationStore>()?;
33 m.add_class::<PyAnnotationDataSet>()?;
34 m.add_class::<PyAnnotationData>()?;
35 m.add_class::<PyAnnotation>()?;
36 m.add_class::<PyDataKey>()?;
37 m.add_class::<PyDataValue>()?;
38 m.add_class::<PyTextResource>()?;
39 m.add_class::<PySelectorKind>()?;
40 m.add_class::<PySelector>()?;
41 m.add_class::<PyOffset>()?;
42 m.add_class::<PyCursor>()?;
43 m.add_class::<PyTextSelection>()?;
44 m.add_class::<PyTextSelectionOperator>()?;
45 m.add_class::<PyAnnotations>()?;
46 m.add_class::<PyData>()?;
47 m.add_class::<PyTextSelections>()?;
48 m.add_class::<PyAnnotationSubStore>()?;
49 Ok(())
50}