Name | aiovotifier JSON |
Version |
1.0.6
JSON |
| download |
home_page | |
Summary | An asynchronous MInecraft server votifier client in Python |
upload_time | 2023-01-04 13:53:29 |
maintainer | |
docs_url | None |
author | Milo Weinberg |
requires_python | >=3.7,<4.0 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Aio-Votifier ![Code Quality](https://www.codefactor.io/repository/github/iapetus-11/aio-votifier/badge) ![PYPI Version](https://img.shields.io/pypi/v/aiovotifier.svg) ![PYPI Downloads](https://img.shields.io/pypi/dw/aiovotifier?color=0FAE6E) ![Views](https://api.ghprofile.me/view?username=iapetus-11.aio-votifier&color=0FAE6E&label=views&style=flat)
*An asynchronous MInecraft server votifier client in Python*
## Example Usage:
```py
from aiovotifier import VotifierClient
import asyncio
async def main():
client = VotifierClient("127.0.0.1", 8192, "testservicename", "token/rsa key")
# VotifierClient.vote(...) automatically determines the protocol and key format
await client.vote("username", "user address")
await client.vote("user2")
await client.v1_vote("username", "user address") # only supports v1 protocol
await client.nu_vote("username", "user address") # only supports NuVotifier/v2 protocol
asyncio.run(main())
```
## Documentation
#### *class* aiovotifier.**VotifierClient**(host: *str*, port: *int*, service_name: *str*, secret: *str*)
- Arguments:
- `host: str` - *The hostname or IP of the votifier server*
- `port: int` - *The port of the votifier server, commonly 8192*
- `service_name: str` - *The name of the service that sends the vote*
- `secret: str` - *The public RSA key or the token found in `config.yml`*
- Methods:
- `vote(username: str, user_address: str = "127.0.0.1")` - *sends a vote to the votifier server, automatically detects and handles the protocol and type of secret*
- `v1_vote(username: str, user_address: str = "127.0.0.1")` - *sends a Votifier v1 vote to a votifier v1 server*
- `nu_vote(username: str, user_address: str = "127.0.0.1") -> dict` - *sends a NuVotifier / v2 vote to a NuVotifier server, returns the response from the server*
#### *class* aiovotifier.**VotifierHeader**(header: *bytes*, version: *str*, token: *str* = None)
- Arguments:
- `header: bytes` - *The header received from the votifier server*
- `version: str` - *The version of the votifier server*
- `challenge: str = None` - *The challenge, included only if the votifier server is v2/NuVotifier*
- Methods:
- `@classmethod parse(header: bytes)` - *Returns a new `VotifierHeader`, parsed from the input bytes*
#### *function* aiovotifier.**votifier_v1_vote**(r: *asyncio.StreamReader*, w: *asyncio.StreamWriter*, service_name: *str*, username: *str*, user_address: *str*, key: *cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey*)
- *Sends a Votifier v1 vote to a Votifier v1 server*
#### *function* aiovotifier.**nuvotifier_vote**(r: *asyncio.StreamReader*, w: *asyncio.StreamWriter*, service_name: *str*, username: *str*, user_address: *str*, token: *str*, challenge: *str*) -> *dict*
- *Sends a NuVotifier / v2 vote to a NuVotifier server*
#### *exception* aiovotifier.**VotifierError**
- *Base class that all votifier exceptions derive from*
#### *exception* aiovotifier.**VotifierHeaderError**
- *Raised when the header from the votifier server is invalid*
#### *exception* aiovotifier.**UnsupportedVersionError**
- *Raised when the votifier version is unsupported*
#### *exception* aiovotifier.**NuVotifierResponseError**
- *Raised when the response from the votifier server contains a status that is not OK*
## Credits
*aiovotifier was based off the code and documentation below*
- https://github.com/ano95/votifier2-py
- https://www.npmjs.com/package/votifier-client/v/0.1.0?activeTab=dependents
- https://github.com/vexsoftware/votifier
- https://github.com/NuVotifier/NuVotifier/wiki/Technical-QA
Raw data
{
"_id": null,
"home_page": "",
"name": "aiovotifier",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Milo Weinberg",
"author_email": "iapetus011@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/9a/75/545981055ab4cdf0f4adf056678ac5b395f9fcfe1f138a4e74a10957ca15/aiovotifier-1.0.6.tar.gz",
"platform": null,
"description": "# Aio-Votifier ![Code Quality](https://www.codefactor.io/repository/github/iapetus-11/aio-votifier/badge) ![PYPI Version](https://img.shields.io/pypi/v/aiovotifier.svg) ![PYPI Downloads](https://img.shields.io/pypi/dw/aiovotifier?color=0FAE6E) ![Views](https://api.ghprofile.me/view?username=iapetus-11.aio-votifier&color=0FAE6E&label=views&style=flat)\n*An asynchronous MInecraft server votifier client in Python*\n\n## Example Usage:\n```py\nfrom aiovotifier import VotifierClient\nimport asyncio\n\nasync def main():\n client = VotifierClient(\"127.0.0.1\", 8192, \"testservicename\", \"token/rsa key\")\n \n # VotifierClient.vote(...) automatically determines the protocol and key format\n await client.vote(\"username\", \"user address\")\n await client.vote(\"user2\")\n\n await client.v1_vote(\"username\", \"user address\") # only supports v1 protocol\n await client.nu_vote(\"username\", \"user address\") # only supports NuVotifier/v2 protocol\n\nasyncio.run(main())\n```\n\n## Documentation\n#### *class* aiovotifier.**VotifierClient**(host: *str*, port: *int*, service_name: *str*, secret: *str*)\n- Arguments:\n - `host: str` - *The hostname or IP of the votifier server*\n - `port: int` - *The port of the votifier server, commonly 8192*\n - `service_name: str` - *The name of the service that sends the vote*\n - `secret: str` - *The public RSA key or the token found in `config.yml`*\n- Methods:\n - `vote(username: str, user_address: str = \"127.0.0.1\")` - *sends a vote to the votifier server, automatically detects and handles the protocol and type of secret*\n - `v1_vote(username: str, user_address: str = \"127.0.0.1\")` - *sends a Votifier v1 vote to a votifier v1 server*\n - `nu_vote(username: str, user_address: str = \"127.0.0.1\") -> dict` - *sends a NuVotifier / v2 vote to a NuVotifier server, returns the response from the server*\n\n#### *class* aiovotifier.**VotifierHeader**(header: *bytes*, version: *str*, token: *str* = None)\n- Arguments:\n - `header: bytes` - *The header received from the votifier server*\n - `version: str` - *The version of the votifier server*\n - `challenge: str = None` - *The challenge, included only if the votifier server is v2/NuVotifier*\n- Methods:\n - `@classmethod parse(header: bytes)` - *Returns a new `VotifierHeader`, parsed from the input bytes*\n\n#### *function* aiovotifier.**votifier_v1_vote**(r: *asyncio.StreamReader*, w: *asyncio.StreamWriter*, service_name: *str*, username: *str*, user_address: *str*, key: *cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey*)\n- *Sends a Votifier v1 vote to a Votifier v1 server*\n\n#### *function* aiovotifier.**nuvotifier_vote**(r: *asyncio.StreamReader*, w: *asyncio.StreamWriter*, service_name: *str*, username: *str*, user_address: *str*, token: *str*, challenge: *str*) -> *dict*\n- *Sends a NuVotifier / v2 vote to a NuVotifier server*\n\n#### *exception* aiovotifier.**VotifierError**\n- *Base class that all votifier exceptions derive from*\n\n#### *exception* aiovotifier.**VotifierHeaderError**\n- *Raised when the header from the votifier server is invalid*\n\n#### *exception* aiovotifier.**UnsupportedVersionError**\n- *Raised when the votifier version is unsupported*\n\n#### *exception* aiovotifier.**NuVotifierResponseError**\n- *Raised when the response from the votifier server contains a status that is not OK*\n\n## Credits\n*aiovotifier was based off the code and documentation below*\n- https://github.com/ano95/votifier2-py\n- https://www.npmjs.com/package/votifier-client/v/0.1.0?activeTab=dependents\n- https://github.com/vexsoftware/votifier\n- https://github.com/NuVotifier/NuVotifier/wiki/Technical-QA\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An asynchronous MInecraft server votifier client in Python",
"version": "1.0.6",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a77d9f54e0b4843f7d9ff367bff4320181143c5e3971f5109bdce529aa021d0b",
"md5": "cf60785e5d8c0f4ad603b39e087f4765",
"sha256": "4d393463baac46e9730bdf43d0c2f7f16828fef126d374c2bf6d2829e101925e"
},
"downloads": -1,
"filename": "aiovotifier-1.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cf60785e5d8c0f4ad603b39e087f4765",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 5927,
"upload_time": "2023-01-04T13:53:28",
"upload_time_iso_8601": "2023-01-04T13:53:28.041225Z",
"url": "https://files.pythonhosted.org/packages/a7/7d/9f54e0b4843f7d9ff367bff4320181143c5e3971f5109bdce529aa021d0b/aiovotifier-1.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9a75545981055ab4cdf0f4adf056678ac5b395f9fcfe1f138a4e74a10957ca15",
"md5": "a12477a7f3d205849807081bd34933b5",
"sha256": "738a8b992ebe9abfa494a92531a9c59f9fb793dc19dd6be68e0e60b62ad41e40"
},
"downloads": -1,
"filename": "aiovotifier-1.0.6.tar.gz",
"has_sig": false,
"md5_digest": "a12477a7f3d205849807081bd34933b5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 5214,
"upload_time": "2023-01-04T13:53:29",
"upload_time_iso_8601": "2023-01-04T13:53:29.820743Z",
"url": "https://files.pythonhosted.org/packages/9a/75/545981055ab4cdf0f4adf056678ac5b395f9fcfe1f138a4e74a10957ca15/aiovotifier-1.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-04 13:53:29",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "aiovotifier"
}