Skip to main content

fidius_python/
lib.rs

1// Copyright 2026 Colliery, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Python plugin runtime for Fidius.
16//!
17//! This crate embeds CPython into the host process via PyO3 and (in later
18//! tasks) exposes a `PluginHandle` whose dispatcher calls into a loaded
19//! Python module. Hosts opt into Python plugin support by depending on this
20//! crate (typically through `fidius-host`'s `python` feature flag).
21//!
22//! At this stage the crate provides only the foundation: shared interpreter
23//! initialisation and Python-exception-to-`PluginError` conversion. The
24//! loader, dispatcher, and packaging integration land in subsequent tasks
25//! under FIDIUS-I-0020.
26
27pub mod error;
28pub mod handle;
29pub mod interpreter;
30pub mod loader;
31pub mod value_bridge;
32
33pub use error::pyerr_to_plugin_error;
34pub use handle::{PythonCallError, PythonPluginHandle};
35pub use interpreter::ensure_initialized;
36pub use loader::{load_python_plugin, PythonLoadError};