Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattstein/literal-export
CLI utility for exporting literal.club library.
https://github.com/mattstein/literal-export
cli literal utility
Last synced: 23 days ago
JSON representation
CLI utility for exporting literal.club library.
- Host: GitHub
- URL: https://github.com/mattstein/literal-export
- Owner: mattstein
- Created: 2024-10-03T04:16:08.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-03T04:49:54.000Z (3 months ago)
- Last Synced: 2024-11-30T22:44:18.857Z (24 days ago)
- Topics: cli, literal, utility
- Language: PHP
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Literal Export CLI Utility
This uses the [Literal](https://literal.club) [GraphQL API](https://literal.club/pages/api) to write your bookshelf items to a JSON file, and include reading start and end dates that aren’t included in the CSV export.
It prompts for your account email address and password in order to get a GraphQL token and make subsequent queries. (These credentials are not stored!)
```
❯ php literal-exportAccount email address:
> [email protected]Account password:
>Logging in...
Fetching reading states...
Fetching book data...
Compiling book information...
220/220 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
Writing JSON...
Done.
```The slow part is where each book is queried for its reading start and end dates, which get folded into the resulting information.
This will write `literal-export.json`, with a single array of book objects:
```json
[
{
"title": "No Time to Spare",
"subtitle": "Thinking about what Matters",
"isbn10": "1328661598",
"isbn13": "9781328661593",
"publisher": null,
"publishedDate": null,
"authors":
[
"Ursula K. Le Guin"
],
"pageCount": 240,
"readingState": "FINISHED",
"started": "2024-09-04",
"finished": "2024-09-15"
}
]
```