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

Uploaded CPython 3.13Windows x86-64

narrativeengine-0.1.11-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.11-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.11-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for narrativeengine-0.1.11-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 acefd6fe07d92850d3033da6c4a89d454e86b82a045e7d9f6b17ecb7c42179dc
MD5 90c9f6e93dd2ab6c6acca52b97e977c9
BLAKE2b-256 fc7255da94bf616ff476537f870afc89a91c0747eba056a1fd5038fa738b32ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for narrativeengine-0.1.11-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0793e1394910661131a07466507e08cacf557b555523fe2501de62e9a975998e
MD5 ebddf6d4e49c07b80f65635a51f85c98
BLAKE2b-256 ab21e2566373e4ee85d3d18dd1fdb4201a5d02136e16ad9f56d61e9d9b0e3591

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for narrativeengine-0.1.11-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 192ac3aba76ae6ef4dfc526ddd5dbdf9e181ec1c25b149052a4f4ea8bfdcd6ed
MD5 e636a224b1b6f3ff4e68705d1a9316cc
BLAKE2b-256 5aeb7b851bc475efcce236215a9c90ba9835250a90be1de02780ed346e34b90e

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