Skip to main content

pteropy

適用於Pterodactyl api的python庫

安裝

pip install pteropy

Pterodactyl_Application範例

key創建位置:/admin/api

基本設置

run.py

from pteropy import Pterodactyl_Application
#導入套件

base_url = "https://面板網址"
api_key = "api key"
#key創建位置:/admin/api

#基本設定

ptero = Pterodactyl_Application(base_url, api_key)
#傳給套件

套件範例

run.py

from pteropy import Pterodactyl_Application
base_url = "https://面板網址"
api_key = "api key"
ptero = Pterodactyl_Application(base_url, api_key)


ptero.check()  #檢查api連線狀態

ptero.create_user(username="用戶名",email="用戶email", password="密碼")  #創建用戶

ptero.list_users()  #所有用戶

Pterodactyl_Client範例

key創建位置:/account/api

基本設置

run.py

from pteropy import Pterodactyl_Client
#導入套件

base_url = "https://面板網址"
api_key = "api key"
#key創建位置:/account/api

#基本設定

ptero = Pterodactyl_Client(base_url, api_key)
#傳給套件

套件範例

run.py

from pteropy import Pterodactyl_Client
base_url = "https://面板網址"
api_key = "api key"
ptero = Pterodactyl_Client(base_url, api_key)


ptero.check()  #檢查api連線狀態

ptero.account_details()  #帳戶資訊

ptero.details_2FA()  #生成TOTP 二維碼圖像以允許設置 2FA

ptero.enable_2FA()  #使用 details_2FA 請求生成的二維碼啟用 TOTP 2FA

ptero.disable_2FA()  #禁用帳戶上的 TOTP 2FA

ptero.update_email()  #更新帳戶的電子郵件位址

ptero.update_password()  #更新帳戶的密碼

ptero.list_API_keys()  #列出 API 金鑰

ptero.create_API_key()  #生成新的 API 金鑰

ptero.delete_API_key()  #刪除指定的 API 金鑰

ptero.get_server("3fa3d78d")  #獲得伺服器資料

ptero.list_servers()  #獲得伺服器列表

ptero.rename_server("3fa3d78d","名子")  #重命名伺服器

ptero.send_command("3fa3d78d","指令")  #發送指令

ptero.start_server("3fa3d78d")  #啟動伺服器

ptero.restart_server("3fa3d78d")  #重啟伺服器

ptero.stop_server("3fa3d78d")  #關閉伺服器

ptero.kill_server("3fa3d78d")  #強制關閉伺服器

Metadata

Release files for pteropy 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pteropy 0.1.8
File Size Uploaded
pteropy-0.1.8.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pteropy 0.1.8
File Interpreter ABI Platform
pteropy-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / pteropy-0.1.8.tar.gz

Download URL pteropy-0.1.8.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9ab13b136295675f0aa3cf3d7a06169a9586a7b2a31a016882e1e104180b4abc
BLAKE2b-256 checksum
How to use checksums
ad53096bcb107d99f418c7ac753e3f64a1dd8876f9fb49f8ec64be0d9c98aa52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / pteropy-0.1.8-py3-none-any.whl

Download URL pteropy-0.1.8-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b806d39ad5486cf19245e2fca117cfeaeb70b80b207eb5b250e40b51db9d89a1
BLAKE2b-256 checksum
How to use checksums
2030f3f81e09d95e6cac2e83cb22ed6e124461822fd4a1998ae95ed6a9f781f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release history Release notifications | RSS feed

0.1.9

2 release files

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page