kickapi-sikriet


Namekickapi-sikriet JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/Sikriet/KickApi
SummaryFast and easy to use Kick.com API
upload_time2024-06-19 20:46:12
maintainerNone
docs_urlNone
authorSikriet
requires_pythonNone
licenseMIT
keywords kick api kickapi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Kick API for Python

## Based on: [https://github.com/Enmn/KickApi](https://github.com/Enmn/KickApi)

The `kickapi-sikriet` Python package is your gateway to seamless integration with the Kick API, providing a robust and user-friendly interface for retrieving comprehensive channel and video data. Empowering developers to harness the full potential of Kick's capabilities, this package simplifies data retrieval, enabling a wide range of applications from content analysis to user interaction.

## Installation

Getting started is a breeze. Install the kickapi-sikriet package with a single command

```bash
pip install kickapi-sikriet
```

## Usage

Integrate the kickapi-sikriet into your Python project with ease:

### Fetch Channel Data

The KickAPI package allows you to fetch detailed information about a Kick channel effortlessly. The example code below demonstrates how to use KickAPI to retrieve and display channel data.

```python
from kickapi_sikriet import KickAPI

# Create an instance of KickAPI
kick_api = KickAPI()

# Fetch channel data by username
channel = kick_api.channel("username")

# Access channel attributes
print("Channel ID:", channel.id)
print("Username:", channel.username)
print("Bio:", channel.bio)
print("Avatar URL:", channel.avatar)
print("Followers:", channel.followers)
print("Playback URL:", channel.playback)
```

### Fetch Video Data

To obtain insights into Kick videos, including details such as title, thumbnail URL, duration, and more, you can use KickAPI to fetch video data. The example code below demonstrates how to retrieve and display video details.

```python
from kickapi_sikriet import KickAPI

# Create an instance of KickAPI
kick_api = KickAPI()

# Fetch video data by video ID
video = kick_api.video('video_id')

# Access video attributes
print("Video ID:", video.id)
print("Title:", video.title)
print("Thumbnail URL:", video.thumbnail)
print("Duration:", video.duration)
print("Live Stream ID:", video.live_stream_id)
print("Created At:", video.created_at)
print("Updated At:", video.updated_at)
print("UUID:", video.uuid)
print("Views:", video.views)
print("Language:", video.language)
print("Stream Video URL:", video.strem_video)

# Access channel data associated with the video
print("Channel ID:", video.channel.id)
print("Channel Username:", video.channel.username)
```

### Fetch Chat Data

The KickAPI package allows you to fetch chat data for a specific video, providing insights into the conversation history. The example code below demonstrates how to use KickAPI to retrieve and display chat messages.

```python
from kickapi_sikriet import KickAPI

# Create an instance of KickAPI
kick_api = KickAPI()

# Fetch video data
channel = kick_api.channel('username')

# Fetch chat data for the video's channel and a specific date
chat = kick_api.chat(channel.id, '<DATE_TIME>') # Example 2024-01-1T01:00:00.000Z

# Iterate over messages and print sender's username and text
for message in chat.messages:
    print("{}: {}".format(message.sender.username, message.text))
```

### Fetch Live Chat Data

To fetch live chat data and receive real-time updates on the ongoing conversation, you can continuously retrieve messages at intervals. The example code below demonstrates how to use KickAPI to fetch and display live chat messages.

```python
from kickapi_sikriet import KickAPI
from datetime import datetime, timedelta
import time

# Create an instance of KickAPI
kick_api = KickAPI()

# Fetch video data
video = kick_api.video('video_id')

while True:
    # Convert to datetime object and format in the desired way
    original_date_obj = datetime.strptime(video.start_time, '%Y-%m-%d %H:%M:%S')
    formatted_date_str = original_date_obj.strftime('%Y-%m-%dT%H:%M:%S.000Z')

    # Fetch chat data for the video's channel and the specific date
    chat = kick_api.chat(video.channel.id, formatted_date_str)

    # Iterate over messages and print sender's username and text
    for message in chat.messages:
        print("{}: {}".format(message.sender.username, message.text))

    # Update start_time for the next iteration and pause for 5 seconds
    video.start_time = (original_date_obj + timedelta(seconds=5)).strftime('%Y-%m-%d %H:%M:%S')
    time.sleep(5)
```

### Fetch and Save Avatar Image

You can use the KickAPI to fetch a channel's avatar image and save it locally. Below is an example code snippet demonstrating how to achieve this:

```python
from kickapi_sikriet import KickAPI
import requests

# Create an instance of KickAPI
kick_api = KickAPI()

# Fetch channel data by username
channel = kick_api.channel("username")

# Send a request to get the avatar URL from the channel data
response = requests.get(channel.avatar)

# Check if the request was successful (status code 200)
if response.status_code == 200:
    # Open a file handler to create a new file named 'avatar.webp'
    with open('avatar.webp', "wb") as file:
        # Write the content of the response to the file
        file.write(response.content)
        print("Avatar image saved successfully.")
else:
    print(f"Failed to fetch avatar. Status Code: {response.status_code}")
```

## Features

- **Channel Insights** Obtain a detailed snapshot of Kick channels effortlessly. Retrieve essential information such as channel ID, bio, avatar URL, followers count, and playback URL.</br>
- **Video Analytics** Dive deep into Kick videos with a wealth of data at your fingertips. Retrieve details including video title, thumbnail URL, duration, live stream ID, creation and update timestamps, UUID, views count, language, stream video URL, and associated channel details.</br>
- **Chat Integration** Stay connected with Kick chat functionality. Retrieve and interact with chat messages, including sender details, message content, and timestamps.

## Contributing

We welcome contributions from the community! If you'd like to contribute to the development of kickapi-sikriet, please follow these guidelines:

- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure the code passes all tests.
- Submit a pull request with a clear description of your changes.

## License

This project is licensed under the MIT License - see the LICENSE file for details.
Make sure to include a `LICENSE` file in your project's root directory and specify the licensing details in that file. The provided link in the "License" section should point to the actual `LICENSE` file in your project.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Sikriet/KickApi",
    "name": "kickapi-sikriet",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "kick, api, kickapi",
    "author": "Sikriet",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/10/73/b56b4905249c4ebb9b01298abe0b867a734645e1741d3929e4698d3065e1/kickapi_sikriet-0.0.4.tar.gz",
    "platform": null,
    "description": "# Kick API for Python\r\n\r\n## Based on: [https://github.com/Enmn/KickApi](https://github.com/Enmn/KickApi)\r\n\r\nThe `kickapi-sikriet` Python package is your gateway to seamless integration with the Kick API, providing a robust and user-friendly interface for retrieving comprehensive channel and video data. Empowering developers to harness the full potential of Kick's capabilities, this package simplifies data retrieval, enabling a wide range of applications from content analysis to user interaction.\r\n\r\n## Installation\r\n\r\nGetting started is a breeze. Install the kickapi-sikriet package with a single command\r\n\r\n```bash\r\npip install kickapi-sikriet\r\n```\r\n\r\n## Usage\r\n\r\nIntegrate the kickapi-sikriet into your Python project with ease:\r\n\r\n### Fetch Channel Data\r\n\r\nThe KickAPI package allows you to fetch detailed information about a Kick channel effortlessly. The example code below demonstrates how to use KickAPI to retrieve and display channel data.\r\n\r\n```python\r\nfrom kickapi_sikriet import KickAPI\r\n\r\n# Create an instance of KickAPI\r\nkick_api = KickAPI()\r\n\r\n# Fetch channel data by username\r\nchannel = kick_api.channel(\"username\")\r\n\r\n# Access channel attributes\r\nprint(\"Channel ID:\", channel.id)\r\nprint(\"Username:\", channel.username)\r\nprint(\"Bio:\", channel.bio)\r\nprint(\"Avatar URL:\", channel.avatar)\r\nprint(\"Followers:\", channel.followers)\r\nprint(\"Playback URL:\", channel.playback)\r\n```\r\n\r\n### Fetch Video Data\r\n\r\nTo obtain insights into Kick videos, including details such as title, thumbnail URL, duration, and more, you can use KickAPI to fetch video data. The example code below demonstrates how to retrieve and display video details.\r\n\r\n```python\r\nfrom kickapi_sikriet import KickAPI\r\n\r\n# Create an instance of KickAPI\r\nkick_api = KickAPI()\r\n\r\n# Fetch video data by video ID\r\nvideo = kick_api.video('video_id')\r\n\r\n# Access video attributes\r\nprint(\"Video ID:\", video.id)\r\nprint(\"Title:\", video.title)\r\nprint(\"Thumbnail URL:\", video.thumbnail)\r\nprint(\"Duration:\", video.duration)\r\nprint(\"Live Stream ID:\", video.live_stream_id)\r\nprint(\"Created At:\", video.created_at)\r\nprint(\"Updated At:\", video.updated_at)\r\nprint(\"UUID:\", video.uuid)\r\nprint(\"Views:\", video.views)\r\nprint(\"Language:\", video.language)\r\nprint(\"Stream Video URL:\", video.strem_video)\r\n\r\n# Access channel data associated with the video\r\nprint(\"Channel ID:\", video.channel.id)\r\nprint(\"Channel Username:\", video.channel.username)\r\n```\r\n\r\n### Fetch Chat Data\r\n\r\nThe KickAPI package allows you to fetch chat data for a specific video, providing insights into the conversation history. The example code below demonstrates how to use KickAPI to retrieve and display chat messages.\r\n\r\n```python\r\nfrom kickapi_sikriet import KickAPI\r\n\r\n# Create an instance of KickAPI\r\nkick_api = KickAPI()\r\n\r\n# Fetch video data\r\nchannel = kick_api.channel('username')\r\n\r\n# Fetch chat data for the video's channel and a specific date\r\nchat = kick_api.chat(channel.id, '<DATE_TIME>') # Example 2024-01-1T01:00:00.000Z\r\n\r\n# Iterate over messages and print sender's username and text\r\nfor message in chat.messages:\r\n    print(\"{}: {}\".format(message.sender.username, message.text))\r\n```\r\n\r\n### Fetch Live Chat Data\r\n\r\nTo fetch live chat data and receive real-time updates on the ongoing conversation, you can continuously retrieve messages at intervals. The example code below demonstrates how to use KickAPI to fetch and display live chat messages.\r\n\r\n```python\r\nfrom kickapi_sikriet import KickAPI\r\nfrom datetime import datetime, timedelta\r\nimport time\r\n\r\n# Create an instance of KickAPI\r\nkick_api = KickAPI()\r\n\r\n# Fetch video data\r\nvideo = kick_api.video('video_id')\r\n\r\nwhile True:\r\n    # Convert to datetime object and format in the desired way\r\n    original_date_obj = datetime.strptime(video.start_time, '%Y-%m-%d %H:%M:%S')\r\n    formatted_date_str = original_date_obj.strftime('%Y-%m-%dT%H:%M:%S.000Z')\r\n\r\n    # Fetch chat data for the video's channel and the specific date\r\n    chat = kick_api.chat(video.channel.id, formatted_date_str)\r\n\r\n    # Iterate over messages and print sender's username and text\r\n    for message in chat.messages:\r\n        print(\"{}: {}\".format(message.sender.username, message.text))\r\n\r\n    # Update start_time for the next iteration and pause for 5 seconds\r\n    video.start_time = (original_date_obj + timedelta(seconds=5)).strftime('%Y-%m-%d %H:%M:%S')\r\n    time.sleep(5)\r\n```\r\n\r\n### Fetch and Save Avatar Image\r\n\r\nYou can use the KickAPI to fetch a channel's avatar image and save it locally. Below is an example code snippet demonstrating how to achieve this:\r\n\r\n```python\r\nfrom kickapi_sikriet import KickAPI\r\nimport requests\r\n\r\n# Create an instance of KickAPI\r\nkick_api = KickAPI()\r\n\r\n# Fetch channel data by username\r\nchannel = kick_api.channel(\"username\")\r\n\r\n# Send a request to get the avatar URL from the channel data\r\nresponse = requests.get(channel.avatar)\r\n\r\n# Check if the request was successful (status code 200)\r\nif response.status_code == 200:\r\n    # Open a file handler to create a new file named 'avatar.webp'\r\n    with open('avatar.webp', \"wb\") as file:\r\n        # Write the content of the response to the file\r\n        file.write(response.content)\r\n        print(\"Avatar image saved successfully.\")\r\nelse:\r\n    print(f\"Failed to fetch avatar. Status Code: {response.status_code}\")\r\n```\r\n\r\n## Features\r\n\r\n- **Channel Insights** Obtain a detailed snapshot of Kick channels effortlessly. Retrieve essential information such as channel ID, bio, avatar URL, followers count, and playback URL.</br>\r\n- **Video Analytics** Dive deep into Kick videos with a wealth of data at your fingertips. Retrieve details including video title, thumbnail URL, duration, live stream ID, creation and update timestamps, UUID, views count, language, stream video URL, and associated channel details.</br>\r\n- **Chat Integration** Stay connected with Kick chat functionality. Retrieve and interact with chat messages, including sender details, message content, and timestamps.\r\n\r\n## Contributing\r\n\r\nWe welcome contributions from the community! If you'd like to contribute to the development of kickapi-sikriet, please follow these guidelines:\r\n\r\n- Fork the repository.\r\n- Create a new branch for your feature or bug fix.\r\n- Make your changes and ensure the code passes all tests.\r\n- Submit a pull request with a clear description of your changes.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the LICENSE file for details.\r\nMake sure to include a `LICENSE` file in your project's root directory and specify the licensing details in that file. The provided link in the \"License\" section should point to the actual `LICENSE` file in your project.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Fast and easy to use Kick.com API",
    "version": "0.0.4",
    "project_urls": {
        "Homepage": "https://github.com/Sikriet/KickApi"
    },
    "split_keywords": [
        "kick",
        " api",
        " kickapi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a8f69c6956ed8484142cfcabe656deb9e5481108e42e571862cdf2461eaebbff",
                "md5": "a4670b5111ceb58de6a521ee4d89b15c",
                "sha256": "2c4cdbef20d47fc0a3de995a396299c1238546155217efd7b64e827272b6cc16"
            },
            "downloads": -1,
            "filename": "kickapi_sikriet-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a4670b5111ceb58de6a521ee4d89b15c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7712,
            "upload_time": "2024-06-19T20:46:10",
            "upload_time_iso_8601": "2024-06-19T20:46:10.412975Z",
            "url": "https://files.pythonhosted.org/packages/a8/f6/9c6956ed8484142cfcabe656deb9e5481108e42e571862cdf2461eaebbff/kickapi_sikriet-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1073b56b4905249c4ebb9b01298abe0b867a734645e1741d3929e4698d3065e1",
                "md5": "b5029896186d2e465289112cacb2c0f5",
                "sha256": "0c85948f1b77964385f9b3062c7dc01a90861cd887dcf51d2ac791900ac97a2a"
            },
            "downloads": -1,
            "filename": "kickapi_sikriet-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "b5029896186d2e465289112cacb2c0f5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6719,
            "upload_time": "2024-06-19T20:46:12",
            "upload_time_iso_8601": "2024-06-19T20:46:12.006598Z",
            "url": "https://files.pythonhosted.org/packages/10/73/b56b4905249c4ebb9b01298abe0b867a734645e1741d3929e4698d3065e1/kickapi_sikriet-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-19 20:46:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Sikriet",
    "github_project": "KickApi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "kickapi-sikriet"
}
        
Elapsed time: 0.25060s