Skip to main content

Python module to interact with Nitrado API endpoints.

Project description

Nitrado DayZ API

Python module for easily interacting with the Nitrado API (DayZ gameserver oriented), 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/DonMatraca/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 this is a first stage of developement and lots of things can fail to work. If you find an issue or have a suggestion, please open an issue or make a pull request on the GitHub repository or contact me on Discord as DonMatraca#2756.

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.2.tar.gz (5.0 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.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nitrado_api-0.2.tar.gz
  • Upload date:
  • Size: 5.0 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.2.tar.gz
Algorithm Hash digest
SHA256 c538f2049aa7c8394b08a15c00e84ad20db03f3ceca7041cf4b37f595554f734
MD5 cee6a9582903c5ffdeec18739954a548
BLAKE2b-256 8dde85add9f5080d80d91e86b7b758bf9f628fdd40e8da41692b14a304a0c043

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nitrado_api-0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bc1226b1a3d00af873cb465f6aa5d1ed0b3549681d713adc42b62647d1f242aa
MD5 492a30a16e26e7b3482be4f99a8fc6c3
BLAKE2b-256 70ce8b4a61009e79af4d24e7fcb6bcae05cd62e4c787f9ca7c6294657376d17a

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