{ "info": { "author": "Michael Krukov", "author_email": "krukov.michael@ya.ru", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries" ], "description": "# Vkpore\n\n[![Build Status](https://travis-ci.com/ekonda/vkpore.svg?branch=master)](https://travis-ci.com/ekonda/vkpore)\n[![codecov](https://codecov.io/gh/ekonda/vkpore/branch/master/graph/badge.svg)](https://codecov.io/gh/ekonda/vkpore)\n[![Documentation Status](https://readthedocs.org/projects/vkpore/badge/?version=latest)](https://vkpore.readthedocs.io/en/latest/?badge=latest)\n[![CodeFactor](https://www.codefactor.io/repository/github/ekonda/vkpore/badge)](https://www.codefactor.io/repository/github/ekonda/vkpore)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/66e342d2507247dcbc5b9a3c7f2fca30)](https://www.codacy.com/app/michaelkrukov/vkpore?utm_source=github.com&utm_medium=referral&utm_content=ekonda/vkpore&utm_campaign=Badge_Grade)\n[![codebeat badge](https://codebeat.co/badges/709259fe-147c-41da-8df5-bdbe2d89f67f)](https://codebeat.co/projects/github-com-ekonda-vkpore-master)\n\nAsynchronous library for organizing interactions with\n[Vkontakte](https://vk.com/dev) api.\n\n## Documentation\n\nDocumentation is available [here](https://vkpore.readthedocs.io/).\n\n## Features\n\n- Direct requests to Vkontakte API\n- Requests to Vkontakte API using [execute](https://vk.com/dev/execute)\n- Straightforward usage and API\n- Heavily annotated types\n- Extensive testing\n- Supports multiple groups at the same time\n- Small overhead\n- Build on experience and many known use cases\n\n### Supported attachments\n\nYou can use these classes from `vkpore.objects` to parse source data into\ninstances. If you need something not supported by the library, every\ninstance has `.source` field with raw source data.\n\n- `Sticker` (type: `sticker`)\n- `Video` (type: `video`)\n- `Photo` (type: `photo`)\n- `Audio` (type: `audio`)\n- `Link` (type: `link`)\n- `Wall` (type: `wall`)\n- `Gift` (type: `gift`)\n- `Doc` (type: `doc`)\n\n### Supported events\n\nYou can use these classes from `vkpore.events` to parse source data into\ninstances. If you need something not supported by the library, every\ninstance has `.source` field with raw source data.\n\n- `MessageNew` (type: `message_new`)\n\n## Usage\n\n### Longpoll\n\nYou can use class `Vkpore` to create a manager and subscribe callbacks to\nevents. When the manager receives event, it will call registered callback\nfor type `vk:`. The callback will receive an event\ninstance through which you can interact with Vkontakte.\n\nTo start the manager, just call `.run()` method. If you want to run\nmanager in backgroudn, you can use use coroutine `.start()`.\n\n#### Example\n\n```py\napp = Vkpore([\"token\"])\n\n@app.on(\"vk:message_new\")\nasync def _(event: MessageNew): # Echo callback\n await event.response(event.text)\n\napp.run()\n```\n\n### Client\n\nYou can use class `VkClient` to perform requests in a loop with `execute`\nor directly.\n\n> `VkClient` uses `aiohttp.ClientSession`, so you need to\n> clean up before exiting your application, if your don't\n> want to see the warnings\n\n#### Example without loop\n\n```py\nasync def application():\n client = VkClient(\"token\")\n\n users = await client.raw_request(\"users.get\", user_id=188149294)\n\n if users:\n print(users[0])\n\n await client.close_session()\n\nget_event_loop().run_until_complete(application())\n```\n\n#### Example with loop\n\n- Use `.request()` to utilize batching with `execute` and respect limits\n- Place your calls to `.request()` between `.start()` and `.stop()`\n\n> You still have to close the session\n\n```py\nasync def application():\n client = VkClient(\"token\")\n client.start()\n\n # ...\n\n await client.stop()\n\nget_event_loop().run_until_complete(application())\n```\n\n## FAQ\n\n- **Is there plugins?** No. `Vkpore` is a library for aiding in developing\n your solutions with organizing and using Vkontakte API.\n\n- **Is every event is supported?** No. Only a few update types are\n supported with classes at the moment. *But.* You don't have to only use\n classes. You can use `\"vk:raw\"` for receiving any update types that are\n not supported with classes.\n\n- **Does this library work with user accounts?** No, but actually yes. Only\n groups are supported by `Vkpore` class, but if you pass a user token in\n `VkClient` - it will possibly work fine.\n\n- **Does this library support telegram?** No. It's a library for Vkontakte.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ekonda/vkpore/", "keywords": "library,vkontakte,asynchronous,asyncio,longpoll", "license": "", "maintainer": "", "maintainer_email": "", "name": "vkpore", "package_url": "https://pypi.org/project/vkpore/", "platform": "", "project_url": "https://pypi.org/project/vkpore/", "project_urls": { "Homepage": "https://github.com/ekonda/vkpore/" }, "release_url": "https://pypi.org/project/vkpore/0.1.0/", "requires_dist": null, "requires_python": ">=3.5", "summary": "Library for organizing interactions with Vkontakte api.", "version": "0.1.0" }, "last_serial": 5329227, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8fc29887a5b601af0cb85b3f6b02f10e", "sha256": "ad85895c38079351db5d83357f9feb988888174ebdd697c4a7363af24fdc5664" }, "downloads": -1, "filename": "vkpore-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8fc29887a5b601af0cb85b3f6b02f10e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 12632, "upload_time": "2019-05-28T21:54:15", "url": "https://files.pythonhosted.org/packages/68/e4/3e869b388735927294c778fe5b63ebaecbc212e8a4bca8a04ad67270507f/vkpore-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8fc29887a5b601af0cb85b3f6b02f10e", "sha256": "ad85895c38079351db5d83357f9feb988888174ebdd697c4a7363af24fdc5664" }, "downloads": -1, "filename": "vkpore-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8fc29887a5b601af0cb85b3f6b02f10e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 12632, "upload_time": "2019-05-28T21:54:15", "url": "https://files.pythonhosted.org/packages/68/e4/3e869b388735927294c778fe5b63ebaecbc212e8a4bca8a04ad67270507f/vkpore-0.1.0.tar.gz" } ] }