Skip to main content

A simple game inventory manager

Project description

Description

This package is used if you want a simple inventory for a text based game or just in general. This package is in development and in a testing stage.

Basic Usage

from gameinventory import Inventory
inventory = Inventory()
inventory.add_item("YOUR ITEM")
print(inventory.get_inventory()) # Output: [Item(name: "Your item", amount: 1)]

Functions

These are the current functions

Functions Description
add_item(item: str, amount: int = 1) -> None Adds a item to the inventory
remove_item(item_name: str, amount: int = 1) -> None Removes a item in the inventory
get_item_at_index(index: int) -> str Returns the item in the inventory at index
get_item_amount(item_name: str) -> int Returns the item amount at a index
get_inventory() -> list returns list inventory
where(item_name: str) -> int returns the index of an item
list_inventory() -> None Prints all the items with a number besides them indicating them
display_inventory() -> None Prints all the items in the inventory

Project details


Download files

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

Source Distribution

gameinventory-0.1.1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

gameinventory-0.1.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file gameinventory-0.1.1.tar.gz.

File metadata

  • Download URL: gameinventory-0.1.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for gameinventory-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8dfd9fad33c2ef307d83917c7c5ce3bf24bb839d8dedfa4a483bfba7c30f7504
MD5 af6bd223dd34aa2ded0c7e19b036b436
BLAKE2b-256 ebbc9a1d4cdaedac4a093e30f0c1dbf14aff24e83978f85e84f0590dfdd0369d

See more details on using hashes here.

File details

Details for the file gameinventory-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: gameinventory-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for gameinventory-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 38b79550c4ae0de9f9aba32714ca1b9e54d28a448632eba1e07a092673b25da2
MD5 b827b1e31e99b76b3945ba5993b65cd5
BLAKE2b-256 a1a361a1c55738395e91ce9912485ccc9cfdfc64accb8fb5e84de730302e4049

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