Pyventure is a simple library for creating a text adventure with Python
I created this library with and for my son for him practice coding, using pip, and importing libraries.
Installation
python -m pip install pyventure
Tutorial
Pyventure handles the game logic; all the user needs to do is
create Place objects. Each Place object represents a location
on the game map. It is the game space which includes things with
which the player can interact.
A Place object is created by providing four parameters:
- a string
namerequired - a string
descriptionrequired - a list of
Features - a list of
Nodes
Example of a playable game with two places to move between
from pyventure.place import Place, Feature, Node
from pyventure.items import Clue, Consumable, Tool
from pyventure.game_loops import start
from pyventure.message import msg
LIVING_ROOM = 'Living Room'
KITCHEN = 'Kitchen'
living_room = Place(
name=LIVING_ROOM,
description="There is a door on your [u]left[/u] and a pencil on the carpet.",
features=[
Feature(
name='pencil',
interact_msg='It is a no. 2 Pencil',
takeable=Tool(
name='pencil',
risk=0,
uses=10,
description='it could stand to be sharpened',
total=1
)
)
],
nodes = [
Node(
name='left',
place_name=KITCHEN,
travel_msg='You open the door and stop into the kitchen.',
accessible=True
)
]
)
kitchen = Place(
name=KITCHEN,
description="The floor is dirty. You're afraid of what is in the refridgerator.",
features=[],
nodes = [
Node(
name='living room',
place_name=LIVING_ROOM,
travel_msg='You are back in the living room.',
accessible=True
)
]
)
all_places = {
LIVING_ROOM: living_room,
KITCHEN: kitchen
}
if __name__ == '__main__':
msg.narrate('Welcome to a Simple Game')
start(new_game_msg='Name your character: ', all_places=all_places)
Metadata
Release files for pyventure 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyventure-0.1.1.tar.gz | 7.1 kB | Without provenance | Details for pyventure-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyventure-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pyventure-0.1.1-py3-none-any.whl |
Total release size: 15.2 kB
Release files / pyventure-0.1.1.tar.gz
| Download URL | pyventure-0.1.1.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a5fce2a4bb2eb78d7b149a2cc83c84e65f186fb9187b061f21cca008ae173b7d
|
|
BLAKE2b-256 checksum How to use checksums |
769b4eeb84d799b9d77af0e9b558b536c29686a2882b66532a4c664629f67958
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.11 CPython/3.10.2 Windows/10
|
Release files / pyventure-0.1.1-py3-none-any.whl
| Download URL | pyventure-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c68c0228e17fc769d2940d8fdac24c5fc021030aae5d9c6d917a2c6899c4b59b
|
|
BLAKE2b-256 checksum How to use checksums |
87f7e78f068b7596d03838eb869cbcbe0596a0133ec5108bd0735ef872607b7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.11 CPython/3.10.2 Windows/10
|
Security for pyventure 0.1.1
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.