• Stars
    star
    190
  • Rank 202,675 (Top 5 %)
  • Language
    Python
  • License
    ISC License
  • Created over 13 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python scripts to convert Google Chrome’s bookmarks and history to the standard HTML-ish bookmarks file format.

chrome-export Build status

Formerly called py-chrome-bookmarks

Python scripts to convert Google Chrome’s bookmarks and history to the standard HTML-ish bookmarks file format.

The functionality to do this for bookmarks is already built into Chrome (select Bookmarks → Bookmarks Manager, then click “Organize” and select “Export Bookmarks…”). I wrote this script to be able to perform this conversion in a cron script.

Installation

Homebrew

If you have Homebrew installed, you can install these scripts with

brew install chrome-export

Nix

If you’re using the Nix package manager, run

nix-env -i -A nixpkgs.chrome-export

If you use NixOS, run

nix-env -i -A nixos.chrome-export

Manual installation

Download the .zip or .tar.gz file for the latest release, extract it, and move the export-chrome-bookmarks and/or export-chrome-history files to somewhere on your PATH. You may also want to move export-chrome-bookmarks.1 and export-chrome-history.1 from the man_pages directory to somewhere on your MANPATH (e.g. /usr/local/share/man/man1).

Usage

These scripts require Python, either version 2.7.x or else version 3.2 or later. They should work on Linux, macOS, and Windows.

Bookmarks script

The usage is

export-chrome-bookmarks [input_file] output_file

If you do not specify an input file, the script will try to open the default Chrome bookmarks file.

The script will ignore URLs that start with “javascript:”.

History script

The usage is

export-chrome-history [input_file] output_file

If you do not specify an input file, the script will try to open the default Chrome history file.

The script will ignore history entries with empty titles.

Notes for developers

To test changes to the scripts, run bash test/run_tests. This script runs both programs and verifies that their output is identical to what is expected. If you have already installed the programs somewhere and want to test those copies, run bash test/run_tests /path/to/bin, where /path/to/bin is the directory where export-chrome-bookmarks and export-chrome-history are located.

The man pages are written in Markdown; run make man to use Pandoc to convert them into the man format. The generated versions are checked into Git so that users don’t have to install Pandoc.

Version history

  • 2.0.2 (2019-06-15)
    • Added man pages and made the testing script more flexible. No changes to functionality.
  • 2.0.1 (2018-02-09)
    • Fixed an error that occurred when trying to open the default bookmarks file under Python 2.7. (Thanks Hridoy Sankar Dutta!)
  • 2.0 (2018-02-05)
    • Renamed the project from “py-chrome-bookmarks” to “chrome-export”; renamed “py-chrome-bookmarks.py” to “export-chrome-bookmarks”; and renamed “py-chrome-history.py” to “export-chrome-history”. There were no changes in functionality.
  • 1.2.1 (2017-06-02)
  • 1.2 (2017-01-26)
    • Added support for Python 3, dropped support for Python 2.6 and earlier, and made this all clear in the readme.
    • Giving an input filename is now optional for both scripts. If you omit the input filename then the scripts will try to open Chrome’s bookmarks or history file automatically.
    • The history script now makes a copy of the input file before opening it. Previously, it was necessary either to make a copy yourself or to quit Chrome before running the script. (The history file is a SQLite database and it isn’t possible for two programs to have it open at the same time.)
  • 1.1 (2011-04-06)
    • Added help and version text (and started counting versions).
    • Added some checking for errors while opening the input or output files.
  • 1.0
    • Initial release

Author

These programs were created by Benjamin Esham.

This project is hosted on GitHub. Please feel free to submit pull requests.

License

Copyright © 2011, 2017–2018 Benjamin D. Esham. This program is released under the ISC license, which you can find in the file LICENSE.md.

More Repositories

1

reading_time

A Liquid filter to estimate how long a passage of text will take to read.
Ruby
115
star
2

pinboard-notes-backup

Back up the notes you’ve saved to Pinboard
Haskell
81
star
3

zenburn-terminal

An adaptation of the Zenburn color scheme for the OS X Terminal app
59
star
4

pluralize

A Liquid filter to make it easy to form correct plurals.
Ruby
29
star
5

inline_highlight

A tag for inline syntax highlighting in Jekyll.
Ruby
29
star
6

the-hacker-crackdown

An ebook of “The Hacker Crackdown: Law and Disorder on the Electronic Frontier” by Bruce Sterling
HTML
26
star
7

clj-plist

A property list (.plist) parser for Clojure
HTML
11
star
8

simple-queue

Process a queue of tasks, pausing after each one
HTML
8
star
9

clj-schulze

A Clojure implementation of the Schulze voting method
Clojure
8
star
10

biogoo

A color scheme for Vim with colorful text on a light gray background.
Vim Script
7
star
11

hitting-set

A Clojure library to find hitting sets and set covers
HTML
6
star
12

microformats2-on-a-map

A web application to extract microformats2-formatted locations from webpages and display them on a map
JavaScript
4
star
13

py-pinboard2html

A Python script to convert your Pinboard bookmarks into an HTML bookmarks file
Python
2
star
14

x-sistemo-widget

A simple Dashboard widget to convert between the X-system and Unicode for Esperanto text.
JavaScript
1
star
15

py-abemails

A Python script to extract all e-mail addresses from the Mac OS X address book
Python
1
star
16

cu-busboard

A slick Dashboard widget to tell you when your CUMTD bus is coming.
JavaScript
1
star