This is a simple Palworld REST API Wrapper + CLI written in python.
Project description
Palworld REST API
A modern, fast, and fully-typed Python client library and CLI wrapper for the official Palworld Dedicated Server REST API. Built on httpx to provide first-class support for both synchronous scripts and high-performance asynchronous applications.
Features
- Dual Clients: Contains both
PalworldClient(sync) andAsyncPalworldClient(async) using connection pooling for maximum performance. - Strict Typing: Fully typed with PEP 561 compliance. API responses are parsed into rigorous Python Dataclasses for safety and excellent IDE autocomplete.
- CLI Included: Manage your Palworld server directly from your terminal using the built-in
palworld-cli. - Modern: Formatted with
ruff, built withhatchling, and rigorously tested.
Installation
You can install the package directly from PyPI:
pip install palworld-restapi
(Or use uv add palworld-restapi if you are using uv)
Quickstart
Async Client (Recommended for Bots / Web Apps)
import asyncio
from palworld_restapi import AsyncPalworldClient
async def main():
async with AsyncPalworldClient("http://127.0.0.1:8212", password="admin-password") as client:
info = await client.get_info()
print(f"Connected to {info.servername} (v{info.version})")
# Announce a message to the server
await client.announce("Hello from Python!")
if __name__ == "__main__":
asyncio.run(main())
Sync Client (Recommended for simple scripts)
from palworld_restapi import PalworldClient
with PalworldClient("http://127.0.0.1:8212", password="admin-password") as client:
players_resp = client.get_players()
print(f"There are currently {len(players_resp.players)} players online.")
Command Line Interface (CLI)
The package ships with a built-in CLI to easily manage your server without writing code. It supports loading credentials from .env files automatically.
# Get server info
palworld-cli info
# See online players
palworld-cli players
# Kick a player by Steam ID
palworld-cli kick steam_00000000000000000 --message "AFK too long"
# Shut the server down in 60 seconds
palworld-cli shutdown 60 --message "Restarting for an update!"
Documentation & Examples
For full details, please refer to the documentation:
- Usage Guide: Deep dive into using the Python clients.
- CLI Guide: Full command reference for the
palworld-cliterminal tool. - Endpoints Reference: Available endpoints and payload details.
We also have a full suite of working scripts in the examples/ directory demonstrating kick/ban management, player tracking, and server metrics.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file palworld_restapi-0.7.3.tar.gz.
File metadata
- Download URL: palworld_restapi-0.7.3.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e22ecef28ab53d53f5a9f12d4fb7cf2f4515c8b22efb6d15e051a1cbbfc350a0
|
|
| MD5 |
dde6bb565b8077c90950c1c5c7baa512
|
|
| BLAKE2b-256 |
4b5eb91faaaaecab26bee0e4a6efe24784750c908f7b5288843b5f6ef3491098
|
Provenance
The following attestation bundles were made for palworld_restapi-0.7.3.tar.gz:
Publisher:
publish.yml on KJAyano/Palworld-RESTAPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
palworld_restapi-0.7.3.tar.gz -
Subject digest:
e22ecef28ab53d53f5a9f12d4fb7cf2f4515c8b22efb6d15e051a1cbbfc350a0 - Sigstore transparency entry: 1894892477
- Sigstore integration time:
-
Permalink:
KJAyano/Palworld-RESTAPI@718b6929503383ef5fd9d5fb0de286f8afd09077 -
Branch / Tag:
refs/tags/v0.7.3 - Owner: https://github.com/KJAyano
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@718b6929503383ef5fd9d5fb0de286f8afd09077 -
Trigger Event:
release
-
Statement type:
File details
Details for the file palworld_restapi-0.7.3-py3-none-any.whl.
File metadata
- Download URL: palworld_restapi-0.7.3-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfc7385d8e58b7097ec11f6ec9743cb5f1d200f03797ea22b918cf7ee5626b30
|
|
| MD5 |
f4862d50f48b5779a308665eb166609b
|
|
| BLAKE2b-256 |
22f051c890db965a1264e2a777654522862c3117f17ee1d0792971131f4894d4
|
Provenance
The following attestation bundles were made for palworld_restapi-0.7.3-py3-none-any.whl:
Publisher:
publish.yml on KJAyano/Palworld-RESTAPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
palworld_restapi-0.7.3-py3-none-any.whl -
Subject digest:
bfc7385d8e58b7097ec11f6ec9743cb5f1d200f03797ea22b918cf7ee5626b30 - Sigstore transparency entry: 1894892623
- Sigstore integration time:
-
Permalink:
KJAyano/Palworld-RESTAPI@718b6929503383ef5fd9d5fb0de286f8afd09077 -
Branch / Tag:
refs/tags/v0.7.3 - Owner: https://github.com/KJAyano
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@718b6929503383ef5fd9d5fb0de286f8afd09077 -
Trigger Event:
release
-
Statement type: