pyrule34


Namepyrule34 JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/Hypick122/pyrule34
SummaryAsynchronous wrapper for rule34.xxx.
upload_time2023-10-23 16:41:50
maintainer
docs_urlNone
authorHypick
requires_python>=3.5
license
keywords async rule34 rule34 api wrapper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            PyRule34 ![GitHub](https://img.shields.io/github/license/Hypick122/pyrule34)
=============================
### <strong><a href="https://github.com/Hypick122/pyrule34/blob/master/.github/README_RU.md"> Р СѓСЃСЃРєРёР№ </a> | English </strong>
This is a lightweight asynchronous library for the [rule34](rule34.xxx) API

Install [![Downloads](https://pepy.tech/badge/pyrule34)](https://pepy.tech/project/pyrule34)
-------------
The library requires Python 3.5 or higher
- Latest version on PyPI: [`1.1.0`](https://pypi.org/project/pyrule34/1.1.0/)
```sh
pip install -U pyrule34
```

Usage
-------------
Importing required libraries
```python
import asyncio
from pyrule34 import AsyncRule34
```
AsyncRule34 can be used as a context manager:
```python
#example
async def main():
    async with AsyncRule34() as r34:
        get_posts = await r34.get_posts(4931536)
        
        print(get_posts[0].tags)
        
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```

### Search
Search for posts using specified inclusion and exclusion tags.

Returns a list.

Parameters:
- `tags` - The include tags
- `exclude_tags` - The exclude tags (default: None)
- `limit` - The (maximum) limit to get posts. Maximum 1000 per one request (default: 100)
- `page_id` - The page number (default: 0)
```python
search = await r34.search(tags=["neko"], exclude_tags=["rating:general"], page_id=2, limit=1)
```
### Post
Retrieve post(s) by ID or MD5 hash.

Returns a list.

Parameters:
- `posts_id`: The list of IDs posts or post ID
- `md5`: The MD5 hash of the post (default: None)
```python
get_posts = await r34.get_posts(4931536)
```
### Comments on the post
Get comments by post ID.

Returns a list.

Parameters:
- `post_id`: The ID of the post
```python
get_post_comments = await r34.get_post_comments(4153825)
```
### Random post
Get a random post.

Returns a dict.
```python
get_random_post = await r34.get_random_post()
```
### Pool
Get Pool by ID.

Returns a list.

Parameters:
- `cid`: Pool ID
- `offset`: offset (default: 0) | 1 page - 45
```python
get_pool = await r34.get_pool(29619)
```
### User Favorites
Get user's favorites by ID.

Returns a list.

Parameters:
- `user_id`: user ID
- `offset`: offset (default: 0) | 1 page - 50
```python
favorite = await r34.users.favorites(2993217)
```
### Top 100 characters and tags
Get the top 100 characters or tags.

Returns a list.
```python
top_character = await r34.top_characters()
top_tags = await r34.top_tags()
```
### Top users
Get the top 10 best users by tags, comments, etc.

Returns a list.
```python
taggers = await r34.stats.taggers()
favorites = await r34.stats.favorites()
commenters = await r34.stats.commenters()
forum_posters = await r34.stats.forum_posters()
image_posters = await r34.stats.image_posters()
note_editors = await r34.stats.note_editors()
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Hypick122/pyrule34",
    "name": "pyrule34",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "async rule34,rule34 api,wrapper",
    "author": "Hypick",
    "author_email": "twerka420@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/26/34/c2d25c19c050d9645f674c16e268a9315198b50f93dacb2f761e708826f2/pyrule34-1.1.0.tar.gz",
    "platform": null,
    "description": "PyRule34 ![GitHub](https://img.shields.io/github/license/Hypick122/pyrule34)\r\n=============================\r\n### <strong><a href=\"https://github.com/Hypick122/pyrule34/blob/master/.github/README_RU.md\"> \u0420\u00a0\u0421\u0453\u0421\u0403\u0421\u0403\u0420\u0454\u0420\u0451\u0420\u2116 </a> | English </strong>\r\nThis is a lightweight asynchronous library for the [rule34](rule34.xxx) API\r\n\r\nInstall [![Downloads](https://pepy.tech/badge/pyrule34)](https://pepy.tech/project/pyrule34)\r\n-------------\r\nThe library requires Python 3.5 or higher\r\n- Latest version on PyPI: [`1.1.0`](https://pypi.org/project/pyrule34/1.1.0/)\r\n```sh\r\npip install -U pyrule34\r\n```\r\n\r\nUsage\r\n-------------\r\nImporting required libraries\r\n```python\r\nimport asyncio\r\nfrom pyrule34 import AsyncRule34\r\n```\r\nAsyncRule34 can be used as a context manager:\r\n```python\r\n#example\r\nasync def main():\r\n    async with AsyncRule34() as r34:\r\n        get_posts = await r34.get_posts(4931536)\r\n        \r\n        print(get_posts[0].tags)\r\n        \r\nloop = asyncio.get_event_loop()\r\nloop.run_until_complete(main())\r\n```\r\n\r\n### Search\r\nSearch for posts using specified inclusion and exclusion tags.\r\n\r\nReturns a list.\r\n\r\nParameters:\r\n- `tags` - The include tags\r\n- `exclude_tags` - The exclude tags (default: None)\r\n- `limit` - The (maximum) limit to get posts. Maximum 1000 per one request (default: 100)\r\n- `page_id` - The page number (default: 0)\r\n```python\r\nsearch = await r34.search(tags=[\"neko\"], exclude_tags=[\"rating:general\"], page_id=2, limit=1)\r\n```\r\n### Post\r\nRetrieve post(s) by ID or MD5 hash.\r\n\r\nReturns a list.\r\n\r\nParameters:\r\n- `posts_id`: The list of IDs posts or post ID\r\n- `md5`: The MD5 hash of the post (default: None)\r\n```python\r\nget_posts = await r34.get_posts(4931536)\r\n```\r\n### Comments on the post\r\nGet comments by post ID.\r\n\r\nReturns a list.\r\n\r\nParameters:\r\n- `post_id`: The ID of the post\r\n```python\r\nget_post_comments = await r34.get_post_comments(4153825)\r\n```\r\n### Random post\r\nGet a random post.\r\n\r\nReturns a dict.\r\n```python\r\nget_random_post = await r34.get_random_post()\r\n```\r\n### Pool\r\nGet Pool by ID.\r\n\r\nReturns a list.\r\n\r\nParameters:\r\n- `cid`: Pool ID\r\n- `offset`: offset (default: 0) | 1 page - 45\r\n```python\r\nget_pool = await r34.get_pool(29619)\r\n```\r\n### User Favorites\r\nGet user's favorites by ID.\r\n\r\nReturns a list.\r\n\r\nParameters:\r\n- `user_id`: user ID\r\n- `offset`: offset (default: 0) | 1 page - 50\r\n```python\r\nfavorite = await r34.users.favorites(2993217)\r\n```\r\n### Top 100 characters and tags\r\nGet the top 100 characters or tags.\r\n\r\nReturns a list.\r\n```python\r\ntop_character = await r34.top_characters()\r\ntop_tags = await r34.top_tags()\r\n```\r\n### Top users\r\nGet the top 10 best users by tags, comments, etc.\r\n\r\nReturns a list.\r\n```python\r\ntaggers = await r34.stats.taggers()\r\nfavorites = await r34.stats.favorites()\r\ncommenters = await r34.stats.commenters()\r\nforum_posters = await r34.stats.forum_posters()\r\nimage_posters = await r34.stats.image_posters()\r\nnote_editors = await r34.stats.note_editors()\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Asynchronous wrapper for rule34.xxx.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/Hypick122/pyrule34",
        "Source": "https://github.com/Hypick122/pyrule34"
    },
    "split_keywords": [
        "async rule34",
        "rule34 api",
        "wrapper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "942d5a58b768950072a142075810f385d6d450d166a9e806359640ebda91d94a",
                "md5": "6cc2bdd1b6375c03f45215e062237fe9",
                "sha256": "06e1209930769e19c92dafe654c6433bf9c45a9c5915b9d917ea719e94102478"
            },
            "downloads": -1,
            "filename": "pyrule34-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6cc2bdd1b6375c03f45215e062237fe9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 19066,
            "upload_time": "2023-10-23T16:41:48",
            "upload_time_iso_8601": "2023-10-23T16:41:48.021040Z",
            "url": "https://files.pythonhosted.org/packages/94/2d/5a58b768950072a142075810f385d6d450d166a9e806359640ebda91d94a/pyrule34-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2634c2d25c19c050d9645f674c16e268a9315198b50f93dacb2f761e708826f2",
                "md5": "1bf58da83855fd79783fe8ce89935a21",
                "sha256": "f39158d40b9d76a352958b2c337053ea01122f02ce7fac4a9cad0b091d6808a9"
            },
            "downloads": -1,
            "filename": "pyrule34-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1bf58da83855fd79783fe8ce89935a21",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 19045,
            "upload_time": "2023-10-23T16:41:50",
            "upload_time_iso_8601": "2023-10-23T16:41:50.395021Z",
            "url": "https://files.pythonhosted.org/packages/26/34/c2d25c19c050d9645f674c16e268a9315198b50f93dacb2f761e708826f2/pyrule34-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-23 16:41:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Hypick122",
    "github_project": "pyrule34",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pyrule34"
}
        
Elapsed time: 0.13027s