Skip to main content

This is a simple Palworld REST API Wrapper + CLI written in python.

Project description

Palworld REST API

PyPI version Python Versions

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) and AsyncPalworldClient (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 with hatchling, 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:

We also have a full suite of working scripts in the examples/ directory demonstrating kick/ban management, player tracking, and server metrics.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

palworld_restapi-0.7.3.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

palworld_restapi-0.7.3-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

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

Hashes for palworld_restapi-0.7.3.tar.gz
Algorithm Hash digest
SHA256 e22ecef28ab53d53f5a9f12d4fb7cf2f4515c8b22efb6d15e051a1cbbfc350a0
MD5 dde6bb565b8077c90950c1c5c7baa512
BLAKE2b-256 4b5eb91faaaaecab26bee0e4a6efe24784750c908f7b5288843b5f6ef3491098

See more details on using hashes here.

Provenance

The following attestation bundles were made for palworld_restapi-0.7.3.tar.gz:

Publisher: publish.yml on KJAyano/Palworld-RESTAPI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file palworld_restapi-0.7.3-py3-none-any.whl.

File metadata

File hashes

Hashes for palworld_restapi-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bfc7385d8e58b7097ec11f6ec9743cb5f1d200f03797ea22b918cf7ee5626b30
MD5 f4862d50f48b5779a308665eb166609b
BLAKE2b-256 22f051c890db965a1264e2a777654522862c3117f17ee1d0792971131f4894d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for palworld_restapi-0.7.3-py3-none-any.whl:

Publisher: publish.yml on KJAyano/Palworld-RESTAPI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page