Git Product home page Git Product logo

nitrado-sdk's Introduction

Nitrado SDK   Python

Testing

A Python based SDK for the Nitrado RESTful API published at PyPI.


Installation

In your terminal install the nitrado package with pip.

pip install nitrado

Overview

To have access to this application you must have an account created at Nitrado and create an API key.

Table of contents

Shows how to get access to your API key.

Shows how to log in to the client and use the basic code interface

Basic requests from Nitrado for health and maintenance checks.

Data provided outside of the game server. Like server status, user id, and auto extension plan.

Data directly related to the game server. This includes the player list, game settings, etc.

Custom game specific libraries.



Examples

The basic maintanance tools from Nitrado API.

from nitrado import Global

version = Global.version()
print(version)

'nitrapi-1201-wh2h4'

This example highlights how to get the service.

from nitrado import Service

services = Service.all()
print(services)
[
    <Service(id=1011111, status='active', type_human='Publicserver 10 slots', suspend_date='2023-05-07T01:21:11')>,
    <Service(id=1022222, status='active', type_human='Publicserver 20 slots', suspend_date='2023-07-07T02:11:01')>,
    <Service(id=1033333, status='active', type_human='Publicserver 30 slots', suspend_date='2023-09-07T06:51:41')>
]

This example highlights how to get the gameserver.

from nitrado import GameServer

gameservers = GameServer.all()
print(gameservers)
[
    <GameServer(service_id=11111111, location='US', slots=10, ip='1.2.3.4', game_human='ARK: Survival Evolved (Xbox One)')>,
    <GameServer(service_id=22222222, location='US', slots=70, ip='11.22.33.44', game_human='ARK: Survival Evolved (Xbox One)')>
]

nitrado-sdk's People

Contributors

kbiernat avatar mjlomeli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nitrado-sdk's Issues

initialize_client method doesn't work?

The doc says to use either:

NitradoAPI.initialize_client("your-api-key")
api = NitradoAPI()

or:

api = NitradoAPI("your-api-key")

The first style didn't work for me; all I got was "access_token_not_valid" not valid errors.

The second style is working great. :-)

[GameServer] Log files

I would love to see the the latest log files from the gameserver being pulled/retrieved
So that in a 2nd command (in a loop check) the newest lines are printed/stored for further actions

sorry if this all doesn’t really make a lot of sense, I’m not working in IT but love to do coding :)

overview:

  • check logfiles
  • check for updates / new files
  • Print latest X lines of the latest files

Latest Version Not Available on PyPi

Hi, I'm so sorry, but when I ran 'pip install nitrado==1.0.14', I could not get the latest version from PyPi, and only got up to 0.0.11. :) Is it still in the process of being tested?

changing method call

Change GameServer.find_game_server(111111) method name to GameServer.find_by_id(11111)

Change Service.find_service(111111) method name to Service.find_by_id(11111)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.