Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iloveitaly/readwise-to-datasette
Extract readwise highlights into a datasette sqlite DB
https://github.com/iloveitaly/readwise-to-datasette
datasette readwise
Last synced: 2 months ago
JSON representation
Extract readwise highlights into a datasette sqlite DB
- Host: GitHub
- URL: https://github.com/iloveitaly/readwise-to-datasette
- Owner: iloveitaly
- Created: 2023-12-24T18:41:52.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-21T12:01:26.000Z (3 months ago)
- Last Synced: 2024-10-21T17:30:41.242Z (3 months ago)
- Topics: datasette, readwise
- Language: Python
- Homepage: https://github.com/iloveitaly/readwise-to-datasette
- Size: 87.9 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-readwise - readwise-to-datasette - Extract Readwise highlights into a Datasette SQLite database. (Tools / Datasette)
- jimsghstars - iloveitaly/readwise-to-datasette - Extract readwise highlights into a datasette sqlite DB (Python)
README
# Import Readwise Highlights into SQLite
Self-explanatory. Nice and simple importer for readwise highlights into a datasette (SQLite) db.
```shell
pip install readwise-to-datasette
readwise-to-datasette
```Or, from source:
```python
poetry install
poetry run readwise-to-datasette
```## Getting an API Key
Find it here:
## Exploring the data
```shell
pip install datasette
datasette serve data.db
```### Embeddings
```shell
llm embed-multi highlights \
-d highlights.db \
--sql 'SELECT
h.id as id,
h.text AS highlight,
b.title AS book_or_article_name,
b.author AS author,
h.highlighted_at AS date_highlight_was_made
FROM
readwise_highlights h
JOIN
readwise_books b ON h.book_id = b.id'
```And then to search on the collection:
```shell
llm similar highlights -d highlights.db -c "food production"
```Cool!
### Example Queries
Get highlight, book name, author, and highlight date in a single query:
```sql
SELECT
h.id as id,
h.text AS highlight,
b.title AS book_or_article_name,
b.author AS author,
h.highlighted_at AS date_highlight_was_made
FROM
readwise_highlights h
JOIN
readwise_books b ON h.book_id = b.id;
```