Coder Social home page Coder Social logo

vk-requests's Introduction

VKRequestsIcon requests for humans

Build Status Coverage Status PythonVersions

vk.com is the largest social network in Russia. This library is significantly improved fork of vk

Install

pip install vk-requests

Usage

import vk_requests


api = vk_requests.create_api(app_id=123, login='User', password='Password')
api.users.get(user_ids=1)
[{'first_name': 'Pavel', 'last_name': 'Durov', 'id': 1}]

Custom scope or api version requests

Just pass scope and/or api_version parameters like

api = vk_requests.create_api(..., scope=['offline', 'status'], api_version='5.00')
api.status.set(text='Hello world!')

Enable debug logger

From your code:

import logging

logging.getLogger('vk-requests').setLevel(logging.DEBUG)

Features

"Queryset-like" requests

# Returns list of users
api.users.get(users_ids=1)

# Returns list of user's friends with extra fields 
api.friends.get(user_id=1, fields=['nickname', 'city'])

# Returns result list from your custom api method
api.execute.YourMethod(**method_params)

Interactive session.

Useful for dev purposes. You will be asked about login, password and app_id interactively in console. Useful if CAPTCHA required.

    from vk_requests.api import API
    from vk_requests.auth import InteractiveVKSession
    
    
    api = vk_requests.create_api(..., session_cls=InteractiveVKSession)

Auto-resolving conflicts when you getting access from unusual place

Just pass your phone number during API initialization. In case of security check it will be handled automatically, otherwise console input will be asked

api = vk_requests.create_api(
    app_id=123, login='User', password='Password', phone_number='+79111234567')

API docs

https://vk.com/dev/methods

Tests

tox

Bug tracker

Warm welcome for suggestions and concerns

https://github.com/prawn-cake/vk-requests/issues

License

MIT - http://opensource.org/licenses/MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.