Skip to content

PteroPackages/Pytero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytero

A flexible API wrapper for Pterodactyl in Python

About

Pytero is a flexible API wrapper for the Pterodactyl Game Panel written Python using async/await syntax and up-to-date typings for proper type-checker support. If you are looking for an API wrapper with sync support, consider using Pydactyl.

Installing

pip install git+https://github.com/PteroPackages/Pytero.git

Getting Started

Using the Application API

import asyncio
from pytero import PteroApp


# initialize the application
app = PteroApp('your.domain.name', 'pterodactyl_api_key')

async def main():
    # get all servers
    servers = await app.get_servers()
    for server in servers:
        print(server)


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

Using the Client API

from pytero import PteroClient


# initialize the client
client = PteroClient('your.domain.name', 'pterodactyl_api_key')
# create the websocket shard
shard = client.create_shard('280e5b1d')

# listen for status updates
@shard.event
def on_status_update(status):
    print('server %s status: %s' % (shard.identifier, status))


# launch the shard
shard.launch()

Contributors

This repository is managed under the MIT license.

© 2021-present PteroPackages

Releases

No releases published

Contributors 4

  •  
  •  
  •  
  •  

Languages