Name | chaturbate-poller JSON |
Version |
1.7.2
JSON |
| download |
home_page | None |
Summary | Poller for the Chaturbate events API. |
upload_time | 2024-12-17 02:11:14 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | MIT License Copyright (c) 2024 MountainGod2 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
api
chaturbate
poller
python
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div align="center">
# Chaturbate Poller
[![Read the Docs](https://img.shields.io/readthedocs/chaturbate-poller?link=https%3A%2F%2Fchaturbate-poller.readthedocs.io%2Fen%2Fstable%2F)](https://chaturbate-poller.readthedocs.io/en/stable/)
[![Codecov Coverage](https://img.shields.io/codecov/c/github/MountainGod2/chaturbate_poller/main?link=https%3A%2F%2Fapp.codecov.io%2Fgh%2FMountainGod2%2Fchaturbate_poller)](https://app.codecov.io/gh/MountainGod2/chaturbate_poller/)
[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/MountainGod2/chaturbate_poller?link=https%3A%2F%2Fwww.codefactor.io%2Frepository%2Fgithub%2Fmountaingod2%2Fchaturbate_poller)](https://www.codefactor.io/repository/github/mountaingod2/chaturbate_poller)
[![Workflow Status](https://img.shields.io/github/actions/workflow/status/MountainGod2/chaturbate_poller/docker-build.yml?branch=main&link=https%3A%2F%2Fgithub.com%2FMountainGod2%2Fchaturbate_poller%2Factions%2Fworkflows%2Fdocker-build.yml)](https://github.com/MountainGod2/chaturbate_poller/actions/workflows/docker-build.yml/)
[![License](https://img.shields.io/pypi/l/chaturbate-poller?link=https%3A%2F%2Fgithub.com%2FMountainGod2%2Fchaturbate_poller)](https://github.com/MountainGod2/chaturbate_poller?tab=MIT-1-ov-file)
[![Python Version](https://img.shields.io/pypi/pyversions/chaturbate-poller?link=https%3A%2F%2Fwww.python.org%2Fdownloads%2F)](https://www.python.org/downloads/)
[![Version](https://img.shields.io/pypi/v/chaturbate-poller?link=https%3A%2F%2Fpypi.org%2Fproject%2Fchaturbate-poller%2F)](https://pypi.org/project/chaturbate-poller/)
</div>
**Chaturbate Poller** is a Python library and CLI for polling events from the Chaturbate API. It provides asynchronous event handling, logging, and optional integration with InfluxDB to store event data for analysis.
## Features
- **Event Polling**: Efficiently poll events from Chaturbate’s API.
- **Error Handling**: Includes backoff and retry mechanisms.
- **Logging**: Console and JSON file logging for structured insights.
- **Optional InfluxDB Storage**: Store events in InfluxDB for analysis or monitoring.
## Installation
Ensure Python 3.11 or later is installed, then install via pip:
```bash
pip install chaturbate-poller
```
## Configuration
Create a `.env` file in your project’s root directory for API and InfluxDB credentials:
```text
CB_USERNAME="your_chaturbate_username"
CB_TOKEN="your_chaturbate_token"
INFLUXDB_URL="http://influxdb:8086"
INFLUXDB_TOKEN="your_influxdb_token"
INFLUXDB_ORG="chaturbate-poller"
INFLUXDB_BUCKET="your_bucket"
USE_DATABASE="false" # Set to `true` if InfluxDB is used
```
> [!NOTE]
> [Generate an API token here](https://chaturbate.com/statsapi/authtoken/) with the "Events API" permission enabled.
## Usage
### CLI
Run the setup program:
```bash
python -m chaturbate_poller setup
```
![image](https://github.com/user-attachments/assets/6060699d-022a-4526-b323-a140ee69e9c2)
Start the poller from the command line:
```bash
python -m chaturbate_poller start --username <your_username> --token <your_token>
```
![image](https://github.com/user-attachments/assets/b80bf277-188d-4874-b52d-99f8cd6b1c3b)
For additional options:
```bash
python -m chaturbate_poller --help
```
![image](https://github.com/user-attachments/assets/e564d698-a31f-4932-835e-44786a945747)
### Docker
Run Chaturbate Poller in Docker:
```bash
docker pull ghcr.io/mountaingod2/chaturbate_poller:latest
```
```bash
docker run \
-e CB_USERNAME="your_chaturbate_username" \
-e CB_TOKEN="your_chaturbate_token" \
ghcr.io/mountaingod2/chaturbate_poller:latest --verbose --testbed
```
### Library Usage
To use Chaturbate Poller as a library, here's a sample script to fetch events in a loop:
```python
import asyncio
from chaturbate_poller import ChaturbateClient
async def main():
async with ChaturbateClient("your_username", "your_token", testbed=False) as client:
url = None
while True:
response = await client.fetch_events(url)
for event in response.events:
print(event.model_dump())
url = response.next_url
if __name__ == "__main__":
asyncio.run(main())
```
## Development
1. Clone the repository:
```bash
git clone https://github.com/MountainGod2/chaturbate_poller.git
cd chaturbate_poller
```
2. Set up the environment and dependencies using [uv](https://docs.astral.sh/uv/):
```bash
uv venv
uv sync --all-extras
```
## Contributing
Contributions are welcome! To contribute:
1. Fork the repository.
2. Create a feature branch.
3. Submit a pull request, ensuring tests and coding standards are met.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
Raw data
{
"_id": null,
"home_page": null,
"name": "chaturbate-poller",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "api, chaturbate, poller, python",
"author": null,
"author_email": "MountainGod2 <admin@reid.ca>",
"download_url": "https://files.pythonhosted.org/packages/d4/ff/18fd6316efd3f5c8032f5f2845b944edcd21d17e7cab85515b1e31f72ba5/chaturbate_poller-1.7.2.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n\n# Chaturbate Poller\n\n[![Read the Docs](https://img.shields.io/readthedocs/chaturbate-poller?link=https%3A%2F%2Fchaturbate-poller.readthedocs.io%2Fen%2Fstable%2F)](https://chaturbate-poller.readthedocs.io/en/stable/)\n[![Codecov Coverage](https://img.shields.io/codecov/c/github/MountainGod2/chaturbate_poller/main?link=https%3A%2F%2Fapp.codecov.io%2Fgh%2FMountainGod2%2Fchaturbate_poller)](https://app.codecov.io/gh/MountainGod2/chaturbate_poller/)\n[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/MountainGod2/chaturbate_poller?link=https%3A%2F%2Fwww.codefactor.io%2Frepository%2Fgithub%2Fmountaingod2%2Fchaturbate_poller)](https://www.codefactor.io/repository/github/mountaingod2/chaturbate_poller)\n[![Workflow Status](https://img.shields.io/github/actions/workflow/status/MountainGod2/chaturbate_poller/docker-build.yml?branch=main&link=https%3A%2F%2Fgithub.com%2FMountainGod2%2Fchaturbate_poller%2Factions%2Fworkflows%2Fdocker-build.yml)](https://github.com/MountainGod2/chaturbate_poller/actions/workflows/docker-build.yml/)\n[![License](https://img.shields.io/pypi/l/chaturbate-poller?link=https%3A%2F%2Fgithub.com%2FMountainGod2%2Fchaturbate_poller)](https://github.com/MountainGod2/chaturbate_poller?tab=MIT-1-ov-file)\n[![Python Version](https://img.shields.io/pypi/pyversions/chaturbate-poller?link=https%3A%2F%2Fwww.python.org%2Fdownloads%2F)](https://www.python.org/downloads/)\n[![Version](https://img.shields.io/pypi/v/chaturbate-poller?link=https%3A%2F%2Fpypi.org%2Fproject%2Fchaturbate-poller%2F)](https://pypi.org/project/chaturbate-poller/)\n\n</div>\n\n**Chaturbate Poller** is a Python library and CLI for polling events from the Chaturbate API. It provides asynchronous event handling, logging, and optional integration with InfluxDB to store event data for analysis.\n\n## Features\n\n- **Event Polling**: Efficiently poll events from Chaturbate\u2019s API.\n- **Error Handling**: Includes backoff and retry mechanisms.\n- **Logging**: Console and JSON file logging for structured insights.\n- **Optional InfluxDB Storage**: Store events in InfluxDB for analysis or monitoring.\n\n## Installation\n\nEnsure Python 3.11 or later is installed, then install via pip:\n\n```bash\npip install chaturbate-poller\n```\n\n## Configuration\n\nCreate a `.env` file in your project\u2019s root directory for API and InfluxDB credentials:\n\n```text\nCB_USERNAME=\"your_chaturbate_username\"\nCB_TOKEN=\"your_chaturbate_token\"\nINFLUXDB_URL=\"http://influxdb:8086\"\nINFLUXDB_TOKEN=\"your_influxdb_token\"\nINFLUXDB_ORG=\"chaturbate-poller\"\nINFLUXDB_BUCKET=\"your_bucket\"\nUSE_DATABASE=\"false\" # Set to `true` if InfluxDB is used\n```\n\n> [!NOTE]\n> [Generate an API token here](https://chaturbate.com/statsapi/authtoken/) with the \"Events API\" permission enabled.\n\n## Usage\n\n### CLI\n\nRun the setup program:\n\n```bash\npython -m chaturbate_poller setup\n```\n\n![image](https://github.com/user-attachments/assets/6060699d-022a-4526-b323-a140ee69e9c2)\n\nStart the poller from the command line:\n\n```bash\npython -m chaturbate_poller start --username <your_username> --token <your_token>\n```\n\n![image](https://github.com/user-attachments/assets/b80bf277-188d-4874-b52d-99f8cd6b1c3b)\n\nFor additional options:\n\n```bash\npython -m chaturbate_poller --help\n```\n\n![image](https://github.com/user-attachments/assets/e564d698-a31f-4932-835e-44786a945747)\n\n### Docker\n\nRun Chaturbate Poller in Docker:\n\n```bash\ndocker pull ghcr.io/mountaingod2/chaturbate_poller:latest\n```\n\n```bash\ndocker run \\\n -e CB_USERNAME=\"your_chaturbate_username\" \\\n -e CB_TOKEN=\"your_chaturbate_token\" \\\n ghcr.io/mountaingod2/chaturbate_poller:latest --verbose --testbed\n```\n\n### Library Usage\n\nTo use Chaturbate Poller as a library, here's a sample script to fetch events in a loop:\n\n```python\nimport asyncio\nfrom chaturbate_poller import ChaturbateClient\n\nasync def main():\n async with ChaturbateClient(\"your_username\", \"your_token\", testbed=False) as client:\n url = None\n while True:\n response = await client.fetch_events(url)\n\n for event in response.events:\n print(event.model_dump())\n\n url = response.next_url\n\nif __name__ == \"__main__\":\n asyncio.run(main())\n```\n\n## Development\n\n1. Clone the repository:\n\n ```bash\n git clone https://github.com/MountainGod2/chaturbate_poller.git\n cd chaturbate_poller\n ```\n\n2. Set up the environment and dependencies using [uv](https://docs.astral.sh/uv/):\n\n ```bash\n uv venv\n uv sync --all-extras\n ```\n\n## Contributing\n\nContributions are welcome! To contribute:\n\n1. Fork the repository.\n2. Create a feature branch.\n3. Submit a pull request, ensuring tests and coding standards are met.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 MountainGod2 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Poller for the Chaturbate events API.",
"version": "1.7.2",
"project_urls": {
"Documentation": "https://mountaingod2.github.io/chaturbate_poller/",
"Homepage": "https://github.com/MountainGod2/chaturbate_poller",
"Repository": "https://github.com/MountainGod2/chaturbate_poller"
},
"split_keywords": [
"api",
" chaturbate",
" poller",
" python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "89ce64a931e54ab322057a96b6d54f3790913d9c8d412bb14cfd14aebbadf88c",
"md5": "687196b908b7e9c47cd2d9e6272d2a4f",
"sha256": "33acffb89f3c8bfa77ac45bd5a56a7b3f1ed0b78e4a35484991a4f3725992a52"
},
"downloads": -1,
"filename": "chaturbate_poller-1.7.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "687196b908b7e9c47cd2d9e6272d2a4f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 20391,
"upload_time": "2024-12-17T02:11:11",
"upload_time_iso_8601": "2024-12-17T02:11:11.608930Z",
"url": "https://files.pythonhosted.org/packages/89/ce/64a931e54ab322057a96b6d54f3790913d9c8d412bb14cfd14aebbadf88c/chaturbate_poller-1.7.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d4ff18fd6316efd3f5c8032f5f2845b944edcd21d17e7cab85515b1e31f72ba5",
"md5": "1c44a0fc2bf6082651714678607c462b",
"sha256": "c25a8998dbdc955792295d734868628e8346dfbdb83c5a1651d0dc74fca8dfa0"
},
"downloads": -1,
"filename": "chaturbate_poller-1.7.2.tar.gz",
"has_sig": false,
"md5_digest": "1c44a0fc2bf6082651714678607c462b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 155383,
"upload_time": "2024-12-17T02:11:14",
"upload_time_iso_8601": "2024-12-17T02:11:14.433492Z",
"url": "https://files.pythonhosted.org/packages/d4/ff/18fd6316efd3f5c8032f5f2845b944edcd21d17e7cab85515b1e31f72ba5/chaturbate_poller-1.7.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-17 02:11:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MountainGod2",
"github_project": "chaturbate_poller",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "chaturbate-poller"
}