Metadata-Version: 2.4
Name: sparkedhost
Version: 0.1.1
Summary: Python client for the SparkedHost (Apollo Panel) API — power servers, manage files, run backups.
Author: Jkratz01
License: MIT
Project-URL: Homepage, https://github.com/Jkratz01/sparkedhost
Project-URL: Repository, https://github.com/Jkratz01/sparkedhost
Project-URL: Issues, https://github.com/Jkratz01/sparkedhost/issues
Keywords: sparkedhost,apollo,pterodactyl,minecraft,game-server,panel,api,client
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25
Dynamic: license-file

# sparkedhost

A tiny Python client for the [SparkedHost](https://sparkedhost.com) (Apollo Panel) API.

List your servers, hit power buttons, read & write files, manage backups — all behind a small `Client` / `Server` API.

## Install

```bash
pip install sparkedhost
```

Or pull the latest from `main` directly:

```bash
pip install git+https://github.com/Jkratz01/sparkedhost.git
```

## Setup

Grab an API key from Apollo → **API Credentials**, then:

```bash
export SPARKEDHOST_API_KEY=your_key_here
```

(or pass `Client(api_key="...")` directly.)

## Usage

```python
from sparkedhost import Client

client = Client()  # reads SPARKEDHOST_API_KEY

# List your servers
for s in client.list_servers():
    print(s.identifier, s.name)

# Pick one
server = client.server("fd90ffb0-108d-4e24-996a-dc9678174d76")

# Power
server.restart()
server.stop()
server.start()

# Files
server.read_file("server.properties")
server.write_file("server.properties", "motd=hello world\n")
server.replace_in_file("server.properties",
                       old="motd=A Minecraft Server",
                       new="motd=Hello!")
server.delete_files(["bad.log"], root="/logs")

# Backups
server.create_backup(name="pre-update")
```

See [`example.py`](example.py) for every operation, and [`CLAUDE.md`](CLAUDE.md) for the full API reference.

## CLI

Installing also drops a `sparkedhost` command on your `PATH`:

```bash
sparkedhost servers                              # list servers
sparkedhost power <uuid> restart                 # power action
sparkedhost cmd <uuid> "say hello"               # console command
sparkedhost ls <uuid> /logs                      # list a directory
sparkedhost cat <uuid> server.properties         # read a file
echo "motd=hi" | sparkedhost write <uuid> server.properties
sparkedhost rm <uuid> bad.log --root /logs
sparkedhost backup <uuid> "pre-update"
```

`sparkedhost --help` lists every subcommand. Commands that fetch data accept `--json` for raw output (pipeable to `jq`).

## Using with Claude Code

This repo ships a [`CLAUDE.md`](CLAUDE.md) so Claude sessions in *this* repo are auto-fluent. To get the same in a *consuming* project, add to that project's `CLAUDE.md`:

```
We use sparkedhost — see https://raw.githubusercontent.com/Jkratz01/sparkedhost/main/CLAUDE.md
```

Or in a one-off Claude Code session, type `@https://raw.githubusercontent.com/Jkratz01/sparkedhost/main/CLAUDE.md` to load it on demand.

## License

[MIT](LICENSE)
