Skip to main content

A Python wrapper for the GameBanana API

Project description

🍌 PyBanana

A powerful and intuitive Python client library for interacting with the GameBanana API. This library provides easy access to GameBanana's extensive modding platform, allowing you to search, retrieve, and interact with mods, users, games, and more.

Note: This library is currently a Work in Progress (WIP). Features and APIs may change.

Features

  • 🔍 Comprehensive API Coverage
    • Search for mods across GameBanana
    • Fetch detailed mod information
    • Access user profiles and statistics
    • Get game information and categories
    • Browse mod sections and categories
  • 🛠 Developer-Friendly
    • Full type hints support with Optional return types
    • Intuitive object-oriented models
    • Robust error handling with graceful failure (returns None)
    • Well-documented API methods
  • 🚀 Easy to Use
    • Simple and clean API
    • Pythonic interface
    • Extensive examples provided

Quick Start

from pybanana.api import PyBanana
from pybanana.enums import ModelType

# Initialize the client
api = PyBanana()

# Get a member's profile
member = api.get_member(1382)  # Tom's ID
if member:
    print(f"Name: {member.name}")
    print(f"Online: {member.is_online}")

# Search for mods
results = api.search("sound effects", ModelType.MOD)
if results:
    for mod in results.records:
        print(f"Mod: {mod.name} - {mod.description}")

Installation

pip install pybanana

Documentation

For detailed documentation and examples, check out:

Requirements

Runtime Dependencies

  • Python 3.7+
  • requests >= 2.25.0
  • python-dateutil >= 2.8.2

Development Dependencies

  • pytest >= 8.0.0
  • requests-mock >= 1.11.0

Error Handling

All public API methods now return Optional types and include built-in error handling. When an API call fails, methods return None instead of raising exceptions, allowing for more resilient code:

# Safe API usage with None check
mod = api.get_mod_profile(12345)
if mod:
    print(f"Found mod: {mod.name}")
else:
    print("Mod not found or API error occurred")

Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Thanks to GameBanana for providing the API
  • All contributors who help improve this library

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

pybanana-0.5.0.tar.gz (31.6 kB view details)

Uploaded Source

Built Distribution

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

pybanana-0.5.0-py3-none-any.whl (31.0 kB view details)

Uploaded Python 3

File details

Details for the file pybanana-0.5.0.tar.gz.

File metadata

  • Download URL: pybanana-0.5.0.tar.gz
  • Upload date:
  • Size: 31.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pybanana-0.5.0.tar.gz
Algorithm Hash digest
SHA256 46e2c4079c4021911c4a61c5b0af53625b2ced33802b0399e360f71a1ef8d161
MD5 44f27ba2dc22f7d46657c8c33a76ad47
BLAKE2b-256 454b86dd3e781e5e22ec0f5d3903b4ff60c072ace77dfffe9bf835d0c666827c

See more details on using hashes here.

File details

Details for the file pybanana-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pybanana-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 31.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for pybanana-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e0e57230b3fcb461cd4395cc641e1fb7a46a181bed185b6f0fc9646d728767a
MD5 0c5887e91b9eb064c4d25b9883abd4da
BLAKE2b-256 d82dd719f52bf0f08eba7006f5255282c4da7e6daf215e309569aef4b356efc7

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