Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #9 from Doist/update_readme
Browse files Browse the repository at this point in the history
Update the API usage example in README.md
  • Loading branch information
Eleftherios Chatzimparmpas committed Sep 3, 2015
2 parents 61ed42b + df6f948 commit e40b711
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Requirements:

Clone the repo:

$ git clone git@github.com:Doist/todoist-python.git
$ git clone git@github.com:Doist/todoist-python.git

Create an environment:

Expand Down Expand Up @@ -41,16 +41,23 @@ Read the built documentation by opening:

Import the library and try some commands:

$ python
[...]
>>> import todoist
>>> api = todoist.TodoistAPI()
>>> api.login('me', 'secret')
[...]
>>> api.ping('mytoken')
[...]
>>> api.get()
[...]
```python
$ python
>>> import todoist
>>> api = todoist.TodoistAPI()
>>> user = api.login('john.doe@gmail.com', 'secret')
>>> print(user['full_name'])
John Doe
>>> response = api.sync(resource_types=['all'])
>>> for project in response['Projects']:
... print(project['name'])
...
Personal
Shopping
Work
Errands
Movies to watch
```


## Testing the library
Expand Down

0 comments on commit e40b711

Please sign in to comment.