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.0.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.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gameinventory-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 25006084d4592699aadd208095d37eb1b530ed6295c5f686c6f0bdd8484b2d7b
MD5 a3b37e5c1ca3f1629e6f249ff7b43ab1
BLAKE2b-256 8561c704a7754a0909ff96be39e5ad663402df3be74d34dcf81e7062f3907780

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gameinventory-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f58f463701ee3985aca10ebce33b88f2ff30231862dd7ba34ef480d8ffb1a88b
MD5 0e2703e60cb63f951cc085984600a719
BLAKE2b-256 82b63111e7959f6691fffb520489998316965015f85eb3f8f24cf9f73f6d2929

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