Skip to main content

Python module to interact with Nitrado API endpoints.

Project description

Nitrado API

Python module for easily interacting with the Nitrado API, allowing game server management and common operations like whitelist management, event configuration, file validation, and more.

Features

  • Retrieve server details
  • Restart and stop the server
  • Manage player lists (whitelist, banlist, priority list)
  • Handle configuration files (upload, download, validate)
  • Schedule automatic restarts
  • Easy and extensible setup

Requirements

This module requires Python 3.6 or higher and the aiohttp library to handle asynchronous HTTP requests.

Installation

To install directly from GitHub:

pip install git+https://github.com/yourusername/nitrado_api.git

Basic Usage

Here's an example to get started with the module:

import asyncio
from nitrado_api import NitradoAPI

async def main():
    nitrado_api = NitradoAPI("YOUR_NITRADO_TOKEN")

    # Retrieve server details
    server_details = await nitrado_api.get_server_details(nitrado_id="123456")
    print("Server details:", server_details)

    # Restart the server
    await nitrado_api.restart_server(nitrado_id="123456")

    # Add users to the whitelist
    await nitrado_api.manage_list("123456", action="add", list_type="whitelist", members=["User1", "User2"])

# Run the main function
asyncio.run(main())

Function Documentation

NitradoAPI(nitrado_token)

  • Initializes the module with the Nitrado API token.

Main Methods

  • get_server_details(nitrado_id): Retrieves details for the specified server.
  • restart_server(nitrado_id): Restarts the server.
  • stop_server(nitrado_id): Stops the server.
  • manage_list(nitrado_id, action, list_type, members): Manages the whitelist, banlist, or priority list to add or remove players.

Contributions

Contributions are welcome. If you find an issue or have a suggestion, please open an issue or make a pull request on the GitHub repository.

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

nitrado_api-0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

nitrado_api-0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file nitrado_api-0.1.tar.gz.

File metadata

  • Download URL: nitrado_api-0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for nitrado_api-0.1.tar.gz
Algorithm Hash digest
SHA256 3e44a50b7f2fd46d425c9abdeb9a16bd2b531c44d8ae6d81b74f2023a7881c3b
MD5 190d833532d76899eadcef0b76543294
BLAKE2b-256 1b74493ba029215aef0ae15acd3fc2c0f691df1638519442d306d72b500cb2e1

See more details on using hashes here.

File details

Details for the file nitrado_api-0.1-py3-none-any.whl.

File metadata

  • Download URL: nitrado_api-0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for nitrado_api-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ce56996025ab068289222ad07595e64da520e72483ae236849f5fef8417105b
MD5 a0e9f39da16b70b4f9c4c7268fa52d03
BLAKE2b-256 032a1f3f76c068a4bd6e88c991a77c2783f9fbb8823ef7c5ed19bb063f7fab07

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