Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Homoni/python-500px

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-500px

A Python client for 500px API ( https://github.com/500px/api-documentation ).

this library was inspired by tweepy(https://github.com/tweepy/tweepy), python-instagram(https://github.com/Instagram/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(https://github.com/500px/api-documentation/tree/master/authentication)
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.blogs_comments_post()
  • api.blogs_post()
  • api.blogs_delete()
  • api.blogs_update()
  • 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]

About

api library for 500px

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.