An open API service indexing awesome lists of open source software.

https://github.com/pteropackages/pytero

A flexible API wrapper for Pterodactyl in Python
https://github.com/pteropackages/pytero

pterodactyl pterodactyl-api python wrapper

Last synced: 11 months ago
JSON representation

A flexible API wrapper for Pterodactyl in Python

Awesome Lists containing this project

README

          

Pytero


A flexible API wrapper for Pterodactyl in Python


## About
Pytero is a flexible API wrapper for the [Pterodactyl Game Panel](https://pterodactyl.io) 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](https://github.com/iamkubi/pydactyl).

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

## Getting Started

### Using the Application API
```python
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
```python
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
- [Devonte W](https://github.com/devnote-dev) - Owner, maintainer

This repository is managed under the MIT license.

© 2021-present PteroPackages