Git Product home page Git Product logo

python-500px's Introduction

python-500px

A Python client for the 500px API.

this library was inspired by tweepy and python-instagram


Installation

pip install python-500px

Requires

  • simplejson

Usage

from fivehundredpx.client import FiveHundredPXAPI
from fivehundredpx.auth   import *

unauthorized_api = FiveHundredPXAPI(handler)
unauthorized_api.users_show(consumer_key=CONSUMER_KEY, id='727199')

handler = OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
handler.set_access_token(OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
api = FiveHundredPXAPI(handler)
api.users()

Authentication

Please check 500px's authentication document. tests/oauth.py shows how to get request/access token.

# verifier:
self.handler.get_authorization_url() # go to this url and get verifier
token = self.handler.get_access_token(verifier)
token.key, token.secret

# xauth:
token = self.handler.get_request_token()
self.handler.set_request_token(token.key, token.secret)
token = self.handler.get_xauth_access_token(username, password)
token.key, token.secret

Methods

  • api.photos()
  • api.photos_search()
  • api.photos_id()
  • api.photos_post()
  • api.photos_update()
  • api.photos_delete()
  • api.photos_comments()
  • api.photos_comments_post()
  • api.photos_favorites()
  • api.photos_favorite_post()
  • api.photos_favorite_delete()
  • api.photos_tags_post()
  • api.photos_tags_delete()
  • api.photos_votes()
  • api.photos_vote_post()
  • api.upload_photo()
  • api.users()
  • api.users_show()
  • api.users_search()
  • api.users_friends()
  • api.users_followers()
  • api.users_friends_post()
  • api.users_friends_delete()
  • api.blogs()
  • api.blogs_id()
  • api.blogs_comments()
  • api.comments_post()
  • api.collections()
  • api.collections_id()
  • api.collections_post()
  • api.collections_update()
  • api.collections_delete()

Test

python tests/oauth.py      [cunsumer_key] [consumer_secret]
python tests/blog.py       [cunsumer_key] [consumer_secret] [oauth_token] [oauth_token_secret]
python tests/collection.py [cunsumer_key] [consumer_secret] [oauth_token] [oauth_token_secret]
python tests/user.py       [cunsumer_key] [consumer_secret] [oauth_token] [oauth_token_secret]
python tests/photo.py      [cunsumer_key] [consumer_secret] [oauth_token] [oauth_token_secret]
python tests/upload.py     [cunsumer_key] [consumer_secret] [oauth_token] [oauth_token_secret]

python-500px's People

Contributors

akirahrkw avatar regata avatar

Watchers

James Cloos avatar Mohammad-Reza Daliri avatar

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.