# Python Client
Client for iv4XR [plugin](https://github.com/iv4xr-project/iv4xr-se-plugin). It can be used to control
the [Space Engineers](https://www.spaceengineersgame.com/)
game. The plugin is developed by [GoodAI](https://www.goodai.com/).
As an alternative there is more advanced client
in [Kotlin](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/JvmClient).
## Installation
The client itself doesn't have any dependencies, but some examples do:
- [Maze generator example](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/examples/maze.py)
uses a great maze generator library [mazelib](https://github.com/john-science/mazelib)
- Cucumber test uses [behave](https://behave.readthedocs.io/en/stable/)
- [PNG](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/examples/png.py)
uses [Pillow](https://github.com/python-pillow/Pillow).
If you want to install those dependencies, simply install them through pip:
```
pip install -r requirements.txt
```
## Basic usage
To use the client, you have to have Space Engineers game with
a [running iv4XR plugin](https://github.com/iv4xr-project/iv4xr-se-plugin/#how-to-run-the-game-with-plugin).
To connect to a local game with a running plugin:
```
from spaceengineers.proxy import SpaceEngineersProxy
se = SpaceEngineersProxy.localhost()
# Example - go to "Load game" screen (game has to be in the main menu):
se.Screens.MainMenu.LoadGame()
```
For more API, take a look
at [api.py](https://github.com/iv4xr-project/iv4xr-se-plugin/blob/main/PythonClient/spaceengineers/api.py).
Class `SpaceEngineers` being the root of the API tree.
See [examples directory](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/examples) for more.
## Limitations
- All API calls have to be made either with all arguments named or all arguments positional (named arguments are
recommended). Mixture is not allowed and will cause an error.
- All default values have to be provided.
## Background
The client is simple wrapper around [JSON-RPC](https://www.jsonrpc.org/specification)
protocol.
Files [models.py](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/spaceengineers/models.py)
and [api.py](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/spaceengineers/api.py) are
generated by
[kotlin client](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/JvmClient/src/jvmMain/kotlin/spaceEngineers/util/generator/python)
.
## Cucumber implementation
The project includes a single feature file
[C284491.feature](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/features/C284491.feature)
. This file has been copied from kotlin client. By implementing steps it showcases re-usability of
[gherkin](https://cucumber.io/docs/gherkin/reference/)
Type `behave` from the root of the project to run the test (behave needs to be installed, see
[Installation](#installation)). Or you can right-click the feature file in PyCharm and select `Run`.
## Useful links
- [Kotlin client](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient)
- [Basics](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Basics.MD)
- [Blocks](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Blocks.MD)
- [Movement](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Movement.MD)
- [Screens](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Screens.MD)
- [Automated testing](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Automated-Testing.MD)
- [Multiplayer](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Multiplayer.MD)
- [Ownership](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Ownership.MD)
Raw data
{
"_id": null,
"home_page": "",
"name": "space-engineers-iv4xr",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": "Karel Hovorka <se@karel-hovorka.eu>",
"keywords": "Space Engineers,automation,iv4XR",
"author": "",
"author_email": "Karel Hovorka <karel.hovorka@goodai.com>",
"download_url": "https://files.pythonhosted.org/packages/72/b9/189db4cc57a97cf32990b25271e9507bac5bd14f9b2a31ad5034d3bfa885/space_engineers_iv4xr-0.0.1b0.tar.gz",
"platform": null,
"description": "# Python Client\n\nClient for iv4XR [plugin](https://github.com/iv4xr-project/iv4xr-se-plugin). It can be used to control\nthe [Space Engineers](https://www.spaceengineersgame.com/)\ngame. The plugin is developed by [GoodAI](https://www.goodai.com/).\n\nAs an alternative there is more advanced client\nin [Kotlin](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/JvmClient).\n\n## Installation\n\nThe client itself doesn't have any dependencies, but some examples do:\n\n- [Maze generator example](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/examples/maze.py)\n uses a great maze generator library [mazelib](https://github.com/john-science/mazelib)\n- Cucumber test uses [behave](https://behave.readthedocs.io/en/stable/)\n- [PNG](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/examples/png.py)\n uses [Pillow](https://github.com/python-pillow/Pillow).\n\nIf you want to install those dependencies, simply install them through pip:\n\n```\npip install -r requirements.txt\n```\n\n## Basic usage\n\nTo use the client, you have to have Space Engineers game with\na [running iv4XR plugin](https://github.com/iv4xr-project/iv4xr-se-plugin/#how-to-run-the-game-with-plugin).\n\nTo connect to a local game with a running plugin:\n\n```\nfrom spaceengineers.proxy import SpaceEngineersProxy\nse = SpaceEngineersProxy.localhost()\n# Example - go to \"Load game\" screen (game has to be in the main menu):\nse.Screens.MainMenu.LoadGame()\n```\n\nFor more API, take a look\nat [api.py](https://github.com/iv4xr-project/iv4xr-se-plugin/blob/main/PythonClient/spaceengineers/api.py).\nClass `SpaceEngineers` being the root of the API tree.\n\nSee [examples directory](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/examples) for more.\n\n## Limitations\n\n- All API calls have to be made either with all arguments named or all arguments positional (named arguments are\n recommended). Mixture is not allowed and will cause an error.\n- All default values have to be provided.\n\n## Background\n\nThe client is simple wrapper around [JSON-RPC](https://www.jsonrpc.org/specification)\nprotocol.\nFiles [models.py](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/spaceengineers/models.py)\nand [api.py](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/spaceengineers/api.py) are\ngenerated by\n[kotlin client](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/JvmClient/src/jvmMain/kotlin/spaceEngineers/util/generator/python)\n.\n\n## Cucumber implementation\n\nThe project includes a single feature file\n[C284491.feature](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/features/C284491.feature)\n. This file has been copied from kotlin client. By implementing steps it showcases re-usability of\n[gherkin](https://cucumber.io/docs/gherkin/reference/)\n\nType `behave` from the root of the project to run the test (behave needs to be installed, see\n[Installation](#installation)). Or you can right-click the feature file in PyCharm and select `Run`.\n\n## Useful links\n\n- [Kotlin client](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient)\n- [Basics](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Basics.MD)\n- [Blocks](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Blocks.MD)\n- [Movement](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Movement.MD)\n- [Screens](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Screens.MD)\n- [Automated testing](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Automated-Testing.MD)\n- [Multiplayer](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Multiplayer.MD)\n- [Ownership](https://github.com/iv4xr-project/iv4xr-se-plugin/tree/main/PythonClient/../JvmClient/docs/Ownership.MD)\n",
"bugtrack_url": null,
"license": "",
"summary": "Client for iv4XR Space Engineers plugin.",
"version": "0.0.1b0",
"split_keywords": [
"space engineers",
"automation",
"iv4xr"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "6f6bc442468ea75fd1db6423fa7cd5b2",
"sha256": "db35487561977fd14b42e30a662d3887365158973c550f0803bb8604cf96c1ce"
},
"downloads": -1,
"filename": "space_engineers_iv4xr-0.0.1b0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6f6bc442468ea75fd1db6423fa7cd5b2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 10603,
"upload_time": "2022-12-09T13:23:03",
"upload_time_iso_8601": "2022-12-09T13:23:03.131388Z",
"url": "https://files.pythonhosted.org/packages/3c/e5/99e97eb418e42eaf70a1f524934b1f5ad45131abc9281b7280dd74af7384/space_engineers_iv4xr-0.0.1b0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "c088b95bcbc89489529c0b33163316cc",
"sha256": "71629f9c3f951baa6058ea5e8ecf7cf9ada17aeebe7922680a7517f63ad97113"
},
"downloads": -1,
"filename": "space_engineers_iv4xr-0.0.1b0.tar.gz",
"has_sig": false,
"md5_digest": "c088b95bcbc89489529c0b33163316cc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 16117,
"upload_time": "2022-12-09T13:23:04",
"upload_time_iso_8601": "2022-12-09T13:23:04.685016Z",
"url": "https://files.pythonhosted.org/packages/72/b9/189db4cc57a97cf32990b25271e9507bac5bd14f9b2a31ad5034d3bfa885/space_engineers_iv4xr-0.0.1b0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-09 13:23:04",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "space-engineers-iv4xr"
}