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.
pip install git+https://github.com/PteroPackages/Pytero.git
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())
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()
- Devonte W - Owner, maintainer
This repository is managed under the MIT license.
© 2021-present PteroPackages