Metadata-Version: 2.1
Name: pycubes
Version: 0.1.0
Summary: Library for serializing/deserilizing Minecraft JE packets
Home-page: https://github.com/DavisDmitry/pyCubes
License: MIT
Author: Dmitry Davis
Author-email: dmitrydavis@protonmail.com
Requires-Python: >=3.9,<4.0
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Internet
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Description-Content-Type: text/markdown

# pyCubes

pyCubes is a library for serializing and deserializing Minecraft Java Edition packets.

**❗ 0.x versions are not stable. The library API is subject to change.**

[Русская версия](https://github.com/DavisDmitry/pyCubes/blob/master/README.ru.md)

Installation:

```bash
pip install pyCubes
```

## Usage:

First you need to create application instance:

```python3
import cubes

app = cubes.Application('127.0.0.1', 25565)
```

After that add a low-level handler:

```python3
async def process_handshake(packet: cubes.ReadBuffer) -> None:
    print('Protocol version:', packet.varint)
    print('Server host:', packet.string)
    print('Server port:', packet.unsigned_short)
    print('Next state:', cubes.ConnectionStatus(packet.varint))

app.add_low_level_handler(cubes.ConnectionStatus.HANDSHAKE, 0x00, process_handshake)
```

All that remains is to launch the application:

```python3
app.run()
```

A more detailed example can be found [here](https://github.com/DavisDmitry/pyCubes/blob/master/example.py).

All packages are described [here](https://wiki.vg/Protocol).

## Development

Run formatting:

```bash
make format
```

Run linters:

```bash
make lint
```

Run tests:

```bash
make test
```

