Giter Site home page Giter Site logo

brunofpessoa / kindle-highlights Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 12 KB

A Go program that converts Kindle "My Clippings.txt" file into an SQLite database and provides options to filter and display your highlights.

Go 100.00%
go kindle-clippings kindle-highlights

kindle-highlights's Introduction

Kindle Highlights to SQLite Converter

This is my "hello world" in Go.

This Go program is designed to convert Kindle highlights and notes from a text file (typically "My Clippings.txt" generated by a Kindle device) into a SQLite database. It also provides options to filter and display the highlights and notes based on certain criteria.

Note: The program only accept english and brazilian portuguese files due to variations in the date format.

Table of Contents

Getting Started

Before using the program, make sure you have Go installed on your system. You can download and install Go from the official website: https://golang.org/dl/

Once you have Go installed, follow these steps:

  1. Clone the repository:

    git clone https://github.com/brunofpessoa/kindle-highlights.git
  2. Change to the project directory:

    cd kindle-highlights
  3. Build the program:

    go build
  4. Run the program:

    ./kindle-highlights [options]

Usage

The program takes a text file containing Kindle highlights and notes as input and stores them in a SQLite database. You can then query and display the highlights and notes using various filtering options.

Options

  • -db: Specifies the name of the SQLite database file to be created or used. (Default: database.sqlite3)

  • -file: Specifies the path to the text file containing Kindle highlights and notes. (Default: My Clippings.txt)

  • -max: Specifies the maximum length (in characters) of a highlight or note. Highlights exceeding this length will be excluded. (Default: 500)

  • -min: Specifies the minimum length (in characters) of a highlight or note. Highlights shorter than this length will be excluded. (Default: 10)

  • -book: Allows you to filter highlights and notes by specifying the book's name. You can enter either the full name or a partial name of the book.

  • -all: If this flag is set, all highlights and notes will be displayed. You can combine it with other flags

  • -no-duplicate: Restricts insertion of highlights that looks like the same, keeping the last one created. (Default: true)

  • -list-books: List all books. (Default: false)

Examples

  1. Convert Kindle Highlights to SQLite Database:

    To convert the highlights from "My Clippings.txt" into an SQLite database named "my_highlights.db", use the following command:

    ./kindle-highlights -db="my_highlights.db" -file="My Clippings.txt"
  2. Display All Highlights and Notes:

    To display all highlights and notes without any filtering, use the following command:

    ./kindle-highlights -db="my_highlights.db" -all
  3. Display Highlights and Notes for a Specific Book:

    To display highlights and notes for a specific book (e.g., "Os irmãos Karamzov") with a minimum length of 20 and max of 200 characters, use the following command:

    ./kindle-highlights -db="my_highlights.db" -book="Os irmãos Karamázov" -min=20 -max=200
  4. Display All Highlights and Notes from a Specific Book:

    To display all highlights and notes without any filtering, use the following command:

    ./kindle-highlights -db="my_highlights.db" -book="Os irmãos Karamázov" -all
  5. Display All Books:

    To display all books, use the following command:

    ./kindle-highlights -db="my_highlights.db" -list-books

Note: You can combine options as needed to filter and display highlights and notes based on your preferences.

kindle-highlights's People

Contributors

brunofpessoa avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.