Skip to content

Commit 2e31bb6

Browse files
committed
akirahrkw edited README.md
1 parent 74696c5 commit 2e31bb6

File tree

1 file changed

+39
-13
lines changed

1 file changed

+39
-13
lines changed

README.md

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
python-500px
2-
======
3-
A Python client for 500px API, inspired by tweepy(https://github.com/tweepy/tweepy), python-instagram(https://github.com/Instagram/python-instagram)
1+
# python-500px
42

5-
Installation
6-
----
7-
pip install python-500px
3+
A Python client for 500px API ( https://github.com/500px/api-documentation ).
84

9-
Requires
10-
----
5+
this library was inspired by tweepy(https://github.com/tweepy/tweepy), python-instagram(https://github.com/Instagram/python-instagram)
6+
7+
***
8+
9+
## Installation
10+
pip install python-500px
11+
12+
## Requires
1113
* httplib2
1214
* simplejson
1315

14-
Usage
15-
----
16+
## Usage
17+
1618
from fivehundredpx.client import FiveHundredPXAPI
1719
from fivehundredpx.auth import *
1820

@@ -22,9 +24,27 @@ Usage
2224
handler.set_access_token(OAUTH_TOKEN,OAUTH_TOKEN_SECRET)
2325
api = FiveHundredPXAPI(handler)
2426
api.users()
25-
26-
Methods
27-
----
27+
28+
## Authentication
29+
30+
- ** initialize **
31+
32+
--
33+
handler = OAuthHandler(CONSUMER_KEY,CONSUMER_SECRET)
34+
35+
- **handler.get_authorization_url()** - get a url for authorization. **[authorize][]**
36+
- **handler.get_access_token(verifier)** - get an access token. **[access_token][]**
37+
38+
--
39+
token = handler.get_access_token(verifier)
40+
print "this is your access token:\n%s" % token.key
41+
print "this is your access token secret:\n%s" % token.secret
42+
43+
- **handler.get_xauth_access_token(username,password)** - get an access token by using xAuth.
44+
45+
46+
## Methods
47+
2848
* api.photos()
2949
* api.photos_search()
3050
* api.photos_id()
@@ -60,3 +80,9 @@ Methods
6080

6181
please check test.py
6282

83+
84+
[authorize]: https://github.com/500px/api-documentation/blob/master/authentication/POST_oauth_authorize.md
85+
[request_token]: https://github.com/500px/api-documentation/blob/master/authentication/POST_oauth_requesttoken.md
86+
[access_token]: https://github.com/500px/api-documentation/blob/master/authentication/POST_oauth_accesstoken.md
87+
88+

0 commit comments

Comments
 (0)