-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
299 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Advanced Usage | ||
|
||
## Custom request | ||
|
||
You can use the `get`, `post`, `delete` or `request` methods to make a custom request. | ||
|
||
```python | ||
from readwise import Readwise | ||
|
||
client = Readwise('token') | ||
response = client.get('/books/', params={'category': 'articles'}) | ||
response.raise_for_status() | ||
print(response.json()) | ||
``` | ||
|
||
Custom http method | ||
|
||
```python | ||
from readwise import Readwise | ||
|
||
client = Readwise('token') | ||
response = client.request('get', '/books/', params={'category': 'articles'}) | ||
response.raise_for_status() | ||
print(response.json()) | ||
``` | ||
|
||
## Pagination | ||
|
||
A helper method for pagination is available. | ||
|
||
```python | ||
from readwise import Readwise | ||
|
||
client = Readwise('token') | ||
for response in client.get_pagination('/books/', params={'category': 'articles'}): | ||
response.raise_for_status() | ||
for book in response.json()['results']: | ||
print(book) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pre-commit==3.1.1 | ||
pytest==7.2.2 |
Oops, something went wrong.