Skip to main content

Worldcraft-Sim

PyPI version License: MIT Downloads LinkedIn

Overview

Worldcraft-Sim is a Python package that allows users to type plain text descriptions of imaginary worlds, defining rules, ecosystems, and events. Using LLM7 and llmatch-messages, the package returns a structured, step-by-step simulation narrative that responds to those inputs. The system interprets the user's creative prompts, verifies them with regex patterns, and generates a formatted output that can be parsed back into a programmatic representation of the evolving world, enabling playful exploration of alternate realities without processing raw documents or media.

Installation

You can install the package using pip:

pip install worldcraft_sim

Usage

Here is an example of how to use the worldcraft_sim function:

from worldcraft_sim import worldcraft_sim

# Example usage with default LLM7
response = worldcraft_sim(user_input="Describe a fantasy world with magical creatures and ancient ruins.")
print(response)

Input Parameters

  • user_input: str : The user input text to process.
  • llm: Optional[BaseChatModel] : The LangChain LLM instance to use. If not provided, the default ChatLLM7 will be used.
  • api_key: Optional[str] : The API key for LLM7. If not provided, it will be fetched from the environment variable LLM7_API_KEY.

Using a Custom LLM

You can use a custom LLM by passing an instance of BaseChatModel. For example, to use OpenAI, Anthropic, or Google's Generative AI:

OpenAI

from langchain_openai import ChatOpenAI
from worldcraft_sim import worldcraft_sim

llm = ChatOpenAI()
response = worldcraft_sim(user_input="Describe a fantasy world with magical creatures and ancient ruins.", llm=llm)
print(response)

Anthropic

from langchain_anthropic import ChatAnthropic
from worldcraft_sim import worldcraft_sim

llm = ChatAnthropic()
response = worldcraft_sim(user_input="Describe a fantasy world with magical creatures and ancient ruins.", llm=llm)
print(response)

Google Generative AI

from langchain_google_genai import ChatGoogleGenerativeAI
from worldcraft_sim import worldcraft_sim

llm = ChatGoogleGenerativeAI()
response = worldcraft_sim(user_input="Describe a fantasy world with magical creatures and ancient ruins.", llm=llm)
print(response)

API Key

The default rate limits for LLM7's free tier are sufficient for most use cases of this package. If you need higher rate limits, you can pass your own API key via the environment variable LLM7_API_KEY or directly in the function call:

response = worldcraft_sim(user_input="Describe a fantasy world with magical creatures and ancient ruins.", api_key="your_api_key")

You can get a free API key by registering at LLM7 Token.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Metadata

Release files for worldcraft-sim 2025.12.20202326

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for worldcraft-sim 2025.12.20202326
File Size Uploaded Provenance Actions
worldcraft_sim-2025.12.20202326.tar.gz 4.5 kB Without provenance Details for worldcraft_sim-2025.12.20202326.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for worldcraft-sim 2025.12.20202326
File Interpreter ABI Platform Actions
worldcraft_sim-2025.12.20202326-py3-none-any.whl Python 3 none any Details for worldcraft_sim-2025.12.20202326-py3-none-any.whl

Total release size: 9.6 kB

Release files / worldcraft_sim-2025.12.20202326.tar.gz

Download URL worldcraft_sim-2025.12.20202326.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f4739714f0e8cbd3f3fa26148a5b029213a54ed6f7876963cfa1567253fcfbb5
BLAKE2b-256 checksum
How to use checksums
a822a6d03f7a414455120a52a16caca2d3e78c746b0b3fae28eae66be4252579
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / worldcraft_sim-2025.12.20202326-py3-none-any.whl

Download URL worldcraft_sim-2025.12.20202326-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ab12aa9228750806fdf616540a7fd12c02659065d30c675488ade8d5b6ab3c4
BLAKE2b-256 checksum
How to use checksums
84950b7ab807fff45754c22a6de52afe59e851bb7b864a160ecdfbde8696eac5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Security for worldcraft-sim 2025.12.20202326

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page