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
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8dfd9fad33c2ef307d83917c7c5ce3bf24bb839d8dedfa4a483bfba7c30f7504
|
|
| MD5 |
af6bd223dd34aa2ded0c7e19b036b436
|
|
| BLAKE2b-256 |
ebbc9a1d4cdaedac4a093e30f0c1dbf14aff24e83978f85e84f0590dfdd0369d
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38b79550c4ae0de9f9aba32714ca1b9e54d28a448632eba1e07a092673b25da2
|
|
| MD5 |
b827b1e31e99b76b3945ba5993b65cd5
|
|
| BLAKE2b-256 |
a1a361a1c55738395e91ce9912485ccc9cfdfc64accb8fb5e84de730302e4049
|