https://github.com/jpf/gannet
A Python parser for the Amazon Kindle "My Clippings.txt" file
https://github.com/jpf/gannet
Last synced: 2 months ago
JSON representation
A Python parser for the Amazon Kindle "My Clippings.txt" file
- Host: GitHub
- URL: https://github.com/jpf/gannet
- Owner: jpf
- License: other
- Created: 2014-12-30T09:48:09.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-02T01:06:32.000Z (over 11 years ago)
- Last Synced: 2025-12-20T01:40:20.055Z (6 months ago)
- Language: Python
- Size: 355 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# About
This is *yet another* Python library to parse the "My Clippings.txt" files generated by the Amazon Kindle.
The name "gannet" is inspired by the Monty Python "[Bookshop](http://youtu.be/p62uutgNN4c)" sketch.
In the hopes of making a more flexible and understandable parser, this one makes use of the [Pyparsing](http://pyparsing.wikispaces.com/) library for parsing the various parts of a "My Clippings.txt" file.
# Installing
```
pip install -r requirements.txt
```
# Using
```python
from gannet import parse_my_clippings
import codecs
clippings = []
with codecs.open(sys.argv[1], 'r', 'utf-8') as f:
clippings = parse_my_clippings(f)
```
# To convert a "My Clippings.txt" file to JSON
```
$ python clippings-to-json.py "My Clippings.txt"
```
# Testing
```
$ nosetests
```