Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nriver committed Feb 25, 2022
1 parent bffac10 commit 0956b02
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
34 changes: 30 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Python client for ETAPI of Trilium Note.
python3 -m pip install trilium-py --user
```

# Usage
# (Basic) Usage

Down below are some simple example code to use this package.
These are basic function that Trilium's ETAPI provides. Down below are some simple example code to use this package.

## initialize

Expand Down Expand Up @@ -111,7 +111,24 @@ Simply delete a note by id.
ea.delete_note("note1")
```

# TODO List
## Day note

You can get the content of a certain date with `get_day_note`. The date string should be in format of "%Y-%m-%d", e.g. "
2022-02-25".

```
es.get_day_note("2022-02-25")
```

Then set/update a day note with `set_day_note`. The content should be a (html) string.

```
self.set_day_note(date, new_content)
```

# (Advanced Usage) TODO List

With the power of Python, I have expanded the basic usage of ETAPI. You can do something with todo list now.

## Add TODO item

Expand All @@ -138,14 +155,23 @@ Use `update_todo` to update a TODO item description at certain index.
ea.update_todo(0, "去码头整点薯条")
```

# Delete a TDOO item
## Delete a TDOO item

Remove a TODO item by its index.

```
ea.delete_todo(1)
```

## Move yesterday's unfinished todo to today

As the title suggests, you can move yesterday's unfinished things to today. Unfinished todos will be deleted from
yesterday's note.

```
ea.move_yesterday_unfinished_todo_to_today()
```

# Develop

Install with pip egg link to make package change without reinstall.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/guides/single-sourcing-package-version/
version='0.6.0', # Required
version='0.6.1', # Required

# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:
Expand Down
2 changes: 1 addition & 1 deletion src/trilium_py/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def set_yesterday_note_content(self, content):
def get_day_note(self, date):
"""
get note content by date
:param date: date string in format of "%Y-%m-%d", e.g. 2022-02-25
:param date: date string in format of "%Y-%m-%d", e.g. "2022-02-25"
:return:
"""
url = f'{self.server_url}/etapi/calendar/days/{date}'
Expand Down

0 comments on commit 0956b02

Please sign in to comment.