Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

narrativeengine-0.1.10-cp313-cp313-win_amd64.whl (286.5 kB view details)

Uploaded CPython 3.13Windows x86-64

narrativeengine-0.1.10-cp313-cp313-manylinux_2_34_x86_64.whl (439.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

narrativeengine-0.1.10-cp313-cp313-macosx_11_0_arm64.whl (380.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

File details

Details for the file narrativeengine-0.1.10-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for narrativeengine-0.1.10-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 709b9c58cda852a590ce321d83336388870a927caad65e03e9fccd7949bdb1aa
MD5 16dba6706465e29b11379ab541572d74
BLAKE2b-256 61e435584cabc3c081317c43bf6c62859c8b9466d49c8e5172e0ddbf7748caa4

See more details on using hashes here.

File details

Details for the file narrativeengine-0.1.10-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for narrativeengine-0.1.10-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f7e74e5416205a53119c7163d5a49b7e2d66448762b2a40f25fe162c1b3221b7
MD5 fdb82c5a0bf3632c7f69ef96820724f4
BLAKE2b-256 c914d851dd58ece35753de44818366151277f0ef31477f0f8686db2419e17266

See more details on using hashes here.

File details

Details for the file narrativeengine-0.1.10-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for narrativeengine-0.1.10-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 951f324406618b7274066590f65fe99f059262e93f5b38937c218e8090555fe1
MD5 472b90210b4820ebd3e1cb3816e303a4
BLAKE2b-256 b6115273833d5a2e198effe5ae8e8bcee9f169444f2e12d7b38d329018c3acb4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page