Add README.md
This commit is contained in:
parent
59027075e8
commit
be81204cd9
|
@ -0,0 +1,85 @@
|
|||
# MCaio
|
||||
|
||||
Asynс lib to get information about Minecraft Java server using **[SLP](https://wiki.vg/Server_List_Ping)**
|
||||
|
||||
Project uses code from **[clarence112](https://gist.github.com/clarence112/9a3e971283d7f4052a0c33f11de9b7c5)**
|
||||
|
||||
## Install:
|
||||
|
||||
**From Gitea**
|
||||
```bash
|
||||
pip install --extra-index-url https://git.orudo.ru/api/packages/trueold89/pypi/simple/ mcaio
|
||||
```
|
||||
|
||||
**From PyPi**
|
||||
```bash
|
||||
pip install mcaio
|
||||
```
|
||||
|
||||
## Build:
|
||||
|
||||
**Deps:** python3
|
||||
|
||||
**Clone repo:**
|
||||
```bash
|
||||
git clone https://git.orudo.ru/trueold89/mcaio --depth=1 && cd mcaio
|
||||
```
|
||||
|
||||
**Create venv:**
|
||||
```bash
|
||||
python -m venv venv && . venv/bin/activate
|
||||
```
|
||||
|
||||
**Install SetupTools**:
|
||||
```bash
|
||||
pip install setuptools
|
||||
```
|
||||
|
||||
**Build:**
|
||||
```
|
||||
python3 setup.py sdist
|
||||
```
|
||||
|
||||
## Usage:
|
||||
|
||||
### As lib:
|
||||
|
||||
**Import MCServer class:**:
|
||||
```python
|
||||
from mcaio.client import AIOMCServer as AIOMC
|
||||
```
|
||||
|
||||
**Create object:**
|
||||
```python
|
||||
mc = AIOMC("localhost", 25565)
|
||||
```
|
||||
|
||||
**Await property:**
|
||||
```python
|
||||
name = await mc.name
|
||||
print(name)
|
||||
# Paper 1.20.4
|
||||
```
|
||||
|
||||
**Properties:**
|
||||
| Property | Description |
|
||||
| -------- | ----------- |
|
||||
| name | Server name |
|
||||
| motd | Server motd |
|
||||
| players_count | Current number of players on the server |
|
||||
| maxplayers | Max number of players on the server |
|
||||
|
||||
|
||||
### As cli:
|
||||
|
||||
```bash
|
||||
MC_HOST=localhost MC_PORT=25565 mcaio name
|
||||
# Paper 1.20.4
|
||||
```
|
||||
**Args:**
|
||||
| Arg | Description |
|
||||
| -------- | ----------- |
|
||||
| name | Server name |
|
||||
| motd | Server motd |
|
||||
| pcount | Current number of players on the server |
|
||||
| pmax | Max number of players on the server |
|
6
setup.py
6
setup.py
|
@ -1,5 +1,9 @@
|
|||
from setuptools import setup
|
||||
|
||||
from pathlib import Path
|
||||
this_directory = Path(__file__).parent
|
||||
long_description = (this_directory / "README.md").read_text()
|
||||
|
||||
setup(
|
||||
name="mcaio",
|
||||
version="0.1",
|
||||
|
@ -7,6 +11,8 @@ setup(
|
|||
author="trueold89",
|
||||
author_email="trueold89@orudo.ru",
|
||||
description="Asynс lib to get information about Minecraft server",
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/markdown',
|
||||
packages=["mcaio"],
|
||||
entry_points={
|
||||
"console_scripts": ["mcaio = mcaio.cli:main"]
|
||||
|
|
Loading…
Reference in New Issue