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
- Host: GitHub
- URL: https://github.com/pteropackages/pytero
- Owner: PteroPackages
- License: mit
- Created: 2021-10-27T16:40:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-24T22:44:51.000Z (over 2 years ago)
- Last Synced: 2025-04-06T05:51:11.586Z (about 1 year ago)
- Topics: pterodactyl, pterodactyl-api, python, wrapper
- Language: Python
- Homepage:
- Size: 4.89 MB
- Stars: 13
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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