chaturbate-poller


Namechaturbate-poller JSON
Version 0.12.0 PyPI version JSON
download
home_pageNone
SummaryPoller for the Chaturbate events API.
upload_time2024-10-24 23:55:46
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT 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.
            # Chaturbate Poller

**Chaturbate Poller** is a Python library for interacting with the Chaturbate API. It allows you to poll events asynchronously, handle various event types, and optionally store event data in InfluxDB for further analysis or monitoring.

[![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/ci-cd-build.yml?branch=main&link=https%3A%2F%2Fgithub.com%2FMountainGod2%2Fchaturbate_poller%2Factions%2Fworkflows%2Fci-cd-build.yml)](https://github.com/MountainGod2/chaturbate_poller/actions/workflows/ci-cd-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/)

## Features

- **Event Polling**: Fetch events from the Chaturbate API using Python's asyncio.
- **Error Handling**: Includes retry logic for basic error handling during polling.
- **Optional Logging**: Configurable logging to keep track of polling activity.
- **InfluxDB Support**: Optionally store events in InfluxDB if data storage is required.

## Installation

Make sure you have Python 3.11 or later installed, then install the package:

```bash
pip install chaturbate-poller
```

## Configuration

To get started, create a `.env` file in the root of your project directory. This file will store your API credentials and (if applicable) InfluxDB connection details:

```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="true"  # Enable if you plan to use InfluxDB
```

> [!NOTE]
> To create an API token, click here: [https://chaturbate.com/statsapi/authtoken/](https://chaturbate.com/statsapi/authtoken/)

> [!IMPORTANT]
> Ensure you have the "**Events API**" permission selected before generating

## Usage

### Command-Line Tool

You run Chaturbate Poller directly from the command line:

```bash
python -m chaturbate_poller --username <your_username> --token <your_token>
```

For more options:

```bash
python -m chaturbate_poller --help
```

### Docker Usage

To run Chaturbate Poller in a Docker container:

```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 Example

You can also import it into your programs. Here’s a simple example of how to fetch events in a loop using the library asynchronously:

```python
import asyncio

from chaturbate_poller import ChaturbateClient

async def main():
    async with ChaturbateClient("your_username", "your_token") as client:
        url = None
        while True:
            response = await client.fetch_events(url)
            for event in response.events:

                # Do something with the received events
                print(event.dict())

            url = response.next_url

if __name__ == "__main__":
    asyncio.run(main())
```

## Development Setup

1. Clone the repository:
   ```bash
   git clone https://github.com/MountainGod2/chaturbate_poller.git
   cd chaturbate_poller
   ```

2. Install dependencies using [uv](https://docs.astral.sh/uv/):
   ```bash
   uv venv .venv
   uv pip install . -e
   ```

## Contributing

Contributions are welcome! If you'd like to contribute:

1. Fork the repository.
2. Create a new feature branch.
3. Submit a pull request.

Please ensure that any changes pass tests and follow coding guidelines.

## License

This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more information.

            

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/c1/b0/05be88c5cd2fb921ebe0c72f31ebd1e8dacf49444078f99aceb671f81e46/chaturbate_poller-0.12.0.tar.gz",
    "platform": null,
    "description": "# Chaturbate Poller\n\n**Chaturbate Poller** is a Python library for interacting with the Chaturbate API. It allows you to poll events asynchronously, handle various event types, and optionally store event data in InfluxDB for further analysis or monitoring.\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/ci-cd-build.yml?branch=main&link=https%3A%2F%2Fgithub.com%2FMountainGod2%2Fchaturbate_poller%2Factions%2Fworkflows%2Fci-cd-build.yml)](https://github.com/MountainGod2/chaturbate_poller/actions/workflows/ci-cd-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## Features\n\n- **Event Polling**: Fetch events from the Chaturbate API using Python's asyncio.\n- **Error Handling**: Includes retry logic for basic error handling during polling.\n- **Optional Logging**: Configurable logging to keep track of polling activity.\n- **InfluxDB Support**: Optionally store events in InfluxDB if data storage is required.\n\n## Installation\n\nMake sure you have Python 3.11 or later installed, then install the package:\n\n```bash\npip install chaturbate-poller\n```\n\n## Configuration\n\nTo get started, create a `.env` file in the root of your project directory. This file will store your API credentials and (if applicable) InfluxDB connection details:\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=\"true\"  # Enable if you plan to use InfluxDB\n```\n\n> [!NOTE]\n> To create an API token, click here: [https://chaturbate.com/statsapi/authtoken/](https://chaturbate.com/statsapi/authtoken/)\n\n> [!IMPORTANT]\n> Ensure you have the \"**Events API**\" permission selected before generating\n\n## Usage\n\n### Command-Line Tool\n\nYou run Chaturbate Poller directly from the command line:\n\n```bash\npython -m chaturbate_poller --username <your_username> --token <your_token>\n```\n\nFor more options:\n\n```bash\npython -m chaturbate_poller --help\n```\n\n### Docker Usage\n\nTo run Chaturbate Poller in a Docker container:\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 Example\n\nYou can also import it into your programs. Here\u2019s a simple example of how to fetch events in a loop using the library asynchronously:\n\n```python\nimport asyncio\n\nfrom chaturbate_poller import ChaturbateClient\n\nasync def main():\n    async with ChaturbateClient(\"your_username\", \"your_token\") as client:\n        url = None\n        while True:\n            response = await client.fetch_events(url)\n            for event in response.events:\n\n                # Do something with the received events\n                print(event.dict())\n\n            url = response.next_url\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## Development Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/MountainGod2/chaturbate_poller.git\n   cd chaturbate_poller\n   ```\n\n2. Install dependencies using [uv](https://docs.astral.sh/uv/):\n   ```bash\n   uv venv .venv\n   uv pip install . -e\n   ```\n\n## Contributing\n\nContributions are welcome! If you'd like to contribute:\n\n1. Fork the repository.\n2. Create a new feature branch.\n3. Submit a pull request.\n\nPlease ensure that any changes pass tests and follow coding guidelines.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more information.\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": "0.12.0",
    "project_urls": {
        "Documentation": "https://chaturbate-poller.readthedocs.io/en/latest/",
        "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": "e65c67bee14cbc9f246790d1e8921e5340946ac319d2cee171a474da74729f60",
                "md5": "78eeeef7571814431ccb463d652bcc8f",
                "sha256": "13fcc0ccf30626493ec238a346f5eb764f913a4964a94bc365f704e39ae78601"
            },
            "downloads": -1,
            "filename": "chaturbate_poller-0.12.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "78eeeef7571814431ccb463d652bcc8f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 20481,
            "upload_time": "2024-10-24T23:55:45",
            "upload_time_iso_8601": "2024-10-24T23:55:45.222829Z",
            "url": "https://files.pythonhosted.org/packages/e6/5c/67bee14cbc9f246790d1e8921e5340946ac319d2cee171a474da74729f60/chaturbate_poller-0.12.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c1b005be88c5cd2fb921ebe0c72f31ebd1e8dacf49444078f99aceb671f81e46",
                "md5": "f9878d1a087962daaf74e4521ce98a7c",
                "sha256": "8af80f5dbe945c29e14767f5c353fb69c3a31586d3f014e0d2e1bd5bc09de37a"
            },
            "downloads": -1,
            "filename": "chaturbate_poller-0.12.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f9878d1a087962daaf74e4521ce98a7c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 130752,
            "upload_time": "2024-10-24T23:55:46",
            "upload_time_iso_8601": "2024-10-24T23:55:46.726301Z",
            "url": "https://files.pythonhosted.org/packages/c1/b0/05be88c5cd2fb921ebe0c72f31ebd1e8dacf49444078f99aceb671f81e46/chaturbate_poller-0.12.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-24 23:55:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MountainGod2",
    "github_project": "chaturbate_poller",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "chaturbate-poller"
}
        
Elapsed time: 0.61099s