Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

CharacterManager

A Python library for creating and managing game characters and RPG systems. The project brings together, in a simple API based on dataclasses, character data, combat statistics, progression, inventory, equipment, skills, status effects, and compatibility rules for relationships.

Status: alpha (0.0.1-alpha). A API ainda pode sofrer alterações.

Requisitos

  • Python 3.9 or later
  • No runtime dependencies

Instalação

PyPI

pip install CharacterManager

GitHub

pip install git+https://github.com/PlayGames-2020/CharacterManager.git

To install the development dependencies:

pip install "CharacterManager[dev]"

Quick Start

from decimal import Decimal

from CharacterManager import Character, Combat, Inventory, Item, RPG

character = Character(
    name="Andrew",
    age=20,
    sex="man",
    sexuality="heterosexual",
    weight=60.0,
    height=Decimal("1.70"),
    race="human",
    job="unemployed",
    social_class="outsider",
)

combat = Combat(attack=15, defense=12)
rpg = RPG(level=1, hp=100, max_hp=100)

potion = Item(
    name="Healing potion",
    type="consumable",
    value=25,
    description="Restores health points.",
)
inventory = Inventory()
inventory.add(potion, count=3)

print(character.name)          # Andrew
print(character.is_adult)      # True
print(character.bmi)           # Calculated BMI
print(inventory.count_of("Healing potion"))  # 3

Key features

  • Characters: identity, age, race, profession, social class and physical attributes.
  • Validation: race-specific limits for age, height and weight, as well as RPG validations.
  • Combat and progression: attributes, health, mana, stamina, gold, experience and levels.
  • Inventory: stackable items, weight limit, count and total value.
  • Equipment: slots, compatibility rules and item bonuses.
  • Skills: costs, cooldowns and applicable effects.
  • Status effects: buffs, debuffs, damage and healing per turn.
  • Relationships: compatibility based on gender, sexuality and narrative restrictions.
  • Serialisation: converting structures to dictionaries using as_dict() and copying them using as_class().

Development and testing

Clone the repository and install the package along with the development dependencies:

git clone https://github.com/PlayGames-2020/CharacterManager.git
cd CharacterManager
pip install -e ".[dev]"

Run the tests using:

python -m pytest

The tests are located in the tests/ directory.

License

Distributed under the licence MIT.

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charactermanager-0.0.1a0.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

charactermanager-0.0.1a0-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file charactermanager-0.0.1a0.tar.gz.

File metadata

  • Download URL: charactermanager-0.0.1a0.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.13

File hashes

Hashes for charactermanager-0.0.1a0.tar.gz
Algorithm Hash digest
SHA256 9dff14e7e2b44c42157b4047ef992c33bc28979d4b0f9582fcf8f195fb57559b
MD5 2ac77d1839911bf5a899de90602310c8
BLAKE2b-256 97fae9362eed79e66adfa424666b246621eba541a5601e7de6e138dd830dab81

See more details on using hashes here.

File details

Details for the file charactermanager-0.0.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for charactermanager-0.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 3123d052b6ecf18544d3da87b95faa31f46a3ea4454e9e28e723df6cf0c1f503
MD5 7502a942dff8ce812cd6e79dd224d39f
BLAKE2b-256 6f1a1243e81b86d0791e318e63f7a697db6ba5316728aa1187020fb036fbb302

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.1a0 This release

2 files

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