Metadata-Version: 2.1
Name: pycubes
Version: 0.3.1
Summary: Library for creating servers and clients Minecraft Java Edition
Home-page: https://github.com/DavisDmitry/pyCubes
License: MIT
Author: Dmitry Davis
Author-email: dmitrydavis@protonmail.com
Requires-Python: >=3.10,<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.10
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
Provides-Extra: docs
Requires-Dist: lazydocs (>=0.4.8,<0.5.0); extra == "docs"
Requires-Dist: mkdocs-material (>=7.3.6,<8.0.0); extra == "docs"
Requires-Dist: mkdocs-static-i18n (>=0.21,<0.23); extra == "docs"
Requires-Dist: nbtlib (==2.0.4)
Requires-Dist: pydocstyle (>=6.1.1,<7.0.0); extra == "docs"
Project-URL: Documentation, https://pycubes.dmitrydavis.xyz
Description-Content-Type: text/markdown

<h1 align="center">pyCubes</h1>

<p align="center">
<a href="https://pypi.org/projects/pycubes"><img alt="PyPI" src="https://img.shields.io/pypi/v/pycubes"></a>
<a href="https://pypi.org/projects/pycubes"><img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/pycubes"></a>
<a href="https://pypi.org/projects/pycubes"><img alt="PyPI - License" src="https://img.shields.io/pypi/l/pyCubes"></a>
<a href="https://pepy.tech/project/pycubes"><img alt="Downloads" src="https://pepy.tech/badge/pycubes/month"></a>
</p>
<p align="center">
<a href="https://github.com/DavisDmitry/pyCubes/actions/workflows/test.yml"><img alt="Test" src="https://github.com/DavisDmitry/pyCubes/actions/workflows/test.yml/badge.svg"></a>
<a href="https://github.com/DavisDmitry/pyCubes/actions/workflows/lint.yml"><img alt="Lint" src="https://github.com/DavisDmitry/pyCubes/actions/workflows/lint.yml/badge.svg"></a>
<a href="https://codecov.io/gh/DavisDmitry/pyCubes"><img alt="codecov" src="https://codecov.io/gh/DavisDmitry/pyCubes/branch/master/graph/badge.svg?token=Y18ZNYT4YS"></a>
</p>
<p align="center">
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
<a href="https://pycqa.github.io/isort"><img alt="Imports: isort" src="https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336"></a>
</p>

---
<p align="center"><a href="https://pycubes.dmitrydavis.xyz/">Documentation</a></p>

---
pyCubes is a library for creating servers and clients Minecraft Java Edition.

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

Installation:

```bash
pip install pyCubes
```

## Usage

First you need to create application instance:

```python3
import cubes

app = cubes.Application()
```

After that add a low-level handler:

```python3
async def process_handshake(packet_id: int, packet: cubes.ReadBuffer):
    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('127.0.0.1', 25565)
```

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).

