diff --git a/README.md b/README.md new file mode 100644 index 0000000..faef8db --- /dev/null +++ b/README.md @@ -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 | diff --git a/setup.py b/setup.py index 198241c..d6aeed6 100644 --- a/setup.py +++ b/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"]