Python SDK for NarrativeEngine, powered by Rust and PyO3.
Project description
NarrativeEngine Python SDK
The Python SDK is a thin PyO3 wrapper over the canonical Rust implementation. All domain models are generated from Rust schemas.
Installation
pip install narrativeengine
pip install "narrativeengine[pydantic]"
Usage
from narrativeengine import LabConfig, NarrativeLore, create_block, generate_candidate
block = create_block("intro", "A signal appears in the archive.")
lore = NarrativeLore(id="lore-1", title="Archive Signal", blocks=[block])
candidate = generate_candidate(lore, LabConfig(temperature=0.7, max_candidates=4, seed=7))
Development
python -m pip install -e ".[dev]"
maturin develop --manifest-path ../crates/narrativeengine-py/Cargo.toml --extras pydantic
python -m pytest
ruff check .
mypy narrativeengine
Build
maturin build --manifest-path ../crates/narrativeengine-py/Cargo.toml --release
Release
Wheels are built through GitHub Actions and published by scripts/publish-all.sh.
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 Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file narrativeengine-0.1.13-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: narrativeengine-0.1.13-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 286.5 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6048b23b41069b1cc5e1aeef4a60eeedfaa071602c207d84eef2590955aba3bd
|
|
| MD5 |
e06ea797ee6a7f79f677e2a8885343f4
|
|
| BLAKE2b-256 |
36d18bc5253bf8de37d2aa58b94ecd5361d151980b19acf408d00fa56db66ac4
|
File details
Details for the file narrativeengine-0.1.13-cp313-cp313-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: narrativeengine-0.1.13-cp313-cp313-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 439.6 kB
- Tags: CPython 3.13, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
714180f22ee7e14f347965a888fd4797a68a9deb2d1fa7b8cbdbb5ddf2122c2f
|
|
| MD5 |
ccafd0b645cc1b4c3d5b40c6eb4a2cda
|
|
| BLAKE2b-256 |
678ce701b87943c89e2ff8f2def0dc1b935faf1ab43389b092ee8eef2012ef86
|
File details
Details for the file narrativeengine-0.1.13-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: narrativeengine-0.1.13-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 380.3 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0294c23c869807f1b27e572f29424c2d2319028d08968e286db3e0ddcf5be5ea
|
|
| MD5 |
332ac578cdffdea9c392a761c5d8409e
|
|
| BLAKE2b-256 |
1cdf116535f0c9ca791d62e2c3c2e3558a783a487f470f2982c0e3580d92cba5
|