<!-- Source: https://docs.biosimulant.com/references/python-api -->

# Supported Python API surface

This is the list of supported public imports from the `biosimulant` package.
Names not listed here are implementation details and may change without notice.
The compatibility `biosim` import path exposes the same runtime APIs for existing
projects.

## Core composition

```python
from biosimulant import (
    BioWorld, WorldEvent,
    BioModule, ExecutionContext, ExecutionPolicy,
    SignalEmitterBioModule, StatefulBioModule,
    WiringBuilder, build_from_spec, load_wiring, load_wiring_toml,
    load_wiring_yaml,
)
```

Use [BioWorld](/references/bioworld-api),
[BioModule](/references/biomodule-api), and
[WiringBuilder](/references/wiring-api) for their contracts.

## Signals and visuals

```python
from biosimulant import (
    BioSignal, AcceptedSignalProfile, ScalarSignal, ArraySignal,
    RecordSignal, EventSignal, InputValueType, SignalSpec,
    unwrap_payload, coerce_float, scalar_or_record_input, make_signal,
    validate_connection_specs, validate_port_spec_direction,
    VisualSpec, validate_visual_spec, normalize_visuals,
)
```

See [BioSignal & Metadata](/references/signals) and the
[Visualization Contract](/references/visualization).

## Lab packaging

```python
from biosimulant import (
    build_package, export_lab_package, fetch_package, publish_package,
    run_package, unpack_package, validate_package,
)
```

For supported CLI workflows and archive layout, see the
[lab manifest reference](/references/lab-manifest) and
[CLI reference](/references/cli).

## Hub-backed local composition

```python
from biosimulant.hub import (
    HubComposition, LOCK_FILE_NAME, dependency_directory,
    materialize_vendored_lab,
)
```

`HubComposition` is intentionally in `biosimulant.hub`, rather than the root
namespace, to make dependency resolution an explicit choice. See the
[HubComposition API](/references/hub-composition-api).

## Runtime helpers (provisional)

```python
from biosimulant.runtime import (
    FlattenedLab, LabTree, LabTreeChild, LabTreeIO, LabTreeModel,
    LabTreePort, LabTreeWire,
    coerce_typed_inputs, extract_communication_step, extract_settle_steps,
    flatten_lab_tree, flush_package_cache, lab_io_from_mapping,
    load_entrypoint,
)
```

`biosimulant.runtime` holds the package interpretation helpers the CLI uses:
entrypoint loading, typed input coercion, communication-step resolution, and lab
flattening. It is public but provisional, so these names may still change
between minor releases.

## Optional simulator bases

```python
from biosimulant.contrib.sbml import TelluriumSBMLBioModule
from biosimulant.contrib.cellml import LibCellMLBioModule
```

Import the contrib module you need directly. Both bases import their simulator
lazily. The CellML base needs `pip install "biosimulant[cellml]"`. No extra
installs Tellurium, so add it to the model's own dependencies. See
[Wrap an External Simulator](/how-to/wrap-external-simulator).

## Managed Developer API

```python
from biosimulant import (
    Client, AsyncClient, Run, RunResult, Artifact,
    ApiError, AuthenticationError, ValidationError, RateLimitError,
    InsufficientCreditsError, RunFailed, RunTimeout,
    verify_webhook_signature,
)
```

`Client` and `AsyncClient` submit accessible versioned Hub Labs to managed
infrastructure; they do not change local `BioWorld.run()` behavior. See the
[Developer API](/developer-api), [runs and results](/developer-api/runs),
and [errors reference](/developer-api/errors).

## Optional machine-learning helper

```python
from biosimulant import OnnxClassifierModule
```

This helper is imported lazily and requires the optional ML dependencies:

```bash
pip install "biosimulant[ml]"
```

## Version

```python
from biosimulant import __version__
```
