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

Uploaded CPython 3.13Windows x86-64

narrativeengine-0.1.14-cp313-cp313-manylinux_2_34_x86_64.whl (439.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

narrativeengine-0.1.14-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.14-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for narrativeengine-0.1.14-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 60024bfc9e2852234ef602ade21b1bce6c3b41c1e76b7645e2a03becab95105b
MD5 e0e44602214fb22074abdd993e8fc3ef
BLAKE2b-256 97481386bedf6d5c514cf4920091d2e0da1c0b61439272324c04b8873ce7abd0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for narrativeengine-0.1.14-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3e4a87541eec8feb6276bd8c434820b673d3652098282ce42c86b261ba536916
MD5 222be15cfddfefb9232acfed87ef4862
BLAKE2b-256 7bef9b318984b42ebbf79911946e5bb0b4bf372cfc1a6260fa7b3234471b50bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for narrativeengine-0.1.14-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e931cc2281a50dafc2d5c5aea11e0de9a840d94f11ffb8386df9d6e6e6d1c24
MD5 228e8e0aafcf5166526faaebb72d17d0
BLAKE2b-256 268b44b067cafd2aeb6e41c1c1f2a2ec7a179555ab39303c2f4407c3a7a5a87b

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