Skip to content

Commit 6f995d5

Browse files
author
Dominik Liebler
authored
Beautified README
1 parent a70f2cb commit 6f995d5

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

README.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# python-500px
22

3-
A Python client for 500px API ( https://github.com/500px/api-documentation ).
3+
A Python client for the [500px API](https://github.com/500px/api-documentation).
44

5-
this library was inspired by tweepy(https://github.com/tweepy/tweepy), python-instagram(https://github.com/Instagram/python-instagram)
5+
this library was inspired by [tweepy](https://github.com/tweepy/tweepy) and [python-instagram](https://github.com/Instagram/python-instagram)
66

77
***
88

@@ -13,31 +13,36 @@ this library was inspired by tweepy(https://github.com/tweepy/tweepy), python-in
1313
* simplejson
1414

1515
## Usage
16-
from fivehundredpx.client import FiveHundredPXAPI
17-
from fivehundredpx.auth import *
1816

19-
unauthorized_api = FiveHundredPXAPI(handler)
20-
unauthorized_api.users_show(consumer_key=CONSUMER_KEY, id='727199')
21-
22-
handler = OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
23-
handler.set_access_token(OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
24-
api = FiveHundredPXAPI(handler)
25-
api.users()
17+
```python
18+
from fivehundredpx.client import FiveHundredPXAPI
19+
from fivehundredpx.auth import *
20+
21+
unauthorized_api = FiveHundredPXAPI(handler)
22+
unauthorized_api.users_show(consumer_key=CONSUMER_KEY, id='727199')
23+
24+
handler = OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
25+
handler.set_access_token(OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
26+
api = FiveHundredPXAPI(handler)
27+
api.users()
28+
```
2629

2730
## Authentication
28-
please check 500px's authentication document(https://github.com/500px/api-documentation/tree/master/authentication)
29-
tests/oauth.py shows how to get request/access token.
3031

31-
verifier:
32-
self.handler.get_authorization_url() # go to this url and get verifier
33-
token = self.handler.get_access_token(verifier)
34-
token.key, token.secret
32+
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.
33+
34+
```python
35+
# verifier:
36+
self.handler.get_authorization_url() # go to this url and get verifier
37+
token = self.handler.get_access_token(verifier)
38+
token.key, token.secret
3539

36-
xauth:
37-
token = self.handler.get_request_token()
38-
self.handler.set_request_token(token.key, token.secret)
39-
token = self.handler.get_xauth_access_token(username, password)
40-
token.key, token.secret
40+
# xauth:
41+
token = self.handler.get_request_token()
42+
self.handler.set_request_token(token.key, token.secret)
43+
token = self.handler.get_xauth_access_token(username, password)
44+
token.key, token.secret
45+
```
4146

4247
## Methods
4348

@@ -90,5 +95,3 @@ this library was inspired by tweepy(https://github.com/tweepy/tweepy), python-in
9095
[authorize]: https://github.com/500px/api-documentation/blob/master/authentication/POST_oauth_authorize.md
9196
[request_token]: https://github.com/500px/api-documentation/blob/master/authentication/POST_oauth_requesttoken.md
9297
[access_token]: https://github.com/500px/api-documentation/blob/master/authentication/POST_oauth_accesstoken.md
93-
94-

0 commit comments

Comments
 (0)