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.15-cp313-cp313-win_amd64.whl (287.1 kB view details)

Uploaded CPython 3.13Windows x86-64

narrativeengine-0.1.15-cp313-cp313-manylinux_2_34_x86_64.whl (439.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

narrativeengine-0.1.15-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.15-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for narrativeengine-0.1.15-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2d87ceef00d550be45d4a1f2bec23642c4377f753ec8818847da94244e404839
MD5 57238b3faddb5dfe0f3a8e737a9f658a
BLAKE2b-256 60c1c6daf8ea73aa2f2007d07011929efc945c24e2ac48025ff48652621c4cf9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for narrativeengine-0.1.15-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c7c68cfd1b9abeb582a938f978210bd1269d37dc4b00f8b19ae055a9f3263699
MD5 dfd3d5bd5330e7cc0778bd7c36078f26
BLAKE2b-256 5465eb2b704bc5cc7e3ea937d0e0ac7c401146b9178b7d682a228f404bd86aa5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for narrativeengine-0.1.15-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 19f86488e7afdc33752032c66aeae56169a1a0817eed0a9e234ad26d14ce16c7
MD5 e19728d1a15fa12f90f53f02624a3297
BLAKE2b-256 339d36beb511674b3f1ce7f18458b139596703eab7bef73c2a0243b85b5e2fd2

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