GithubHelp home page GithubHelp logo

huigith / chrome-bookmark-clustering Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iuyo5678/chrome-bookmark-clustering

1.0 0.0 0.0 6.78 MB

chrome 书签自动分类工具 Chrome bookmark auto classification

License: Apache License 2.0

Python 5.65% HTML 94.35%
bookmark chrome

chrome-bookmark-clustering's Introduction

说明

Fork From

Readme Card

一个聚簇的简单demo,对chrom导出书签进行简单分类。

在大佬已有的基础上进行改动:

  1. Python2升级为Python3,使用 Python3.9.12在macos上使用验证通过。
  2. Chrome现在不支持导入JSON格式的书签,借助模块bookmarks_converter,将JSON格式的数据转换为HTML格式,支持导入。
  3. 关键地方捕获一些异常

使用前准备

首先需要导出你的chrome书签。在chrome地址栏输入:

chrome://bookmarks/

在打开页面中点击organize ---->>> Export bookmarks to HTML file

如下图:

保存文件后可以将文件路径作为命令的书签文件路径即可运行。

分类之前的书签:
img.png

安装依赖

在文件夹下输入命令:

pip install -r requirements.txt

安装使用

文件下输入下面命令,查看帮助文档:

python ./cluster.py -h
usage: cluster.py [-h] [-k KVALUE] -m {hierarchical,kmeans} -f FILE [-d] [-p PROXY]

chrome 书签自动分类工具

optional arguments:
  -h, --help            show this help message and exit
  -k KVALUE, --kvalue KVALUE
                        聚簇的个数,将书签分为多少个簇
  -m {hierarchical,kmeans}, --method {hierarchical,kmeans}
                        选择聚类方法只有两种可选,kmeans和hierarchical
  -f FILE, --file FILE  书签文件的路径
  -d, --debug           开启调试模式
  -p PROXY, --proxy PROXY
                        页面抓取时使用代理

例如使用文件包自带的例子使用如下命令:

python cluster.py -m hierarchical -f ./bookmarks_demo.html -k 15

上述命令的含义是使用层次聚簇,聚为15个簇,将bookmarks_demo.html中的书签分类为15个文件夹到output_data_001.html

output_data_001.html导入到浏览器

分类后的书签:
img.png

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.