https://github.com/aidenellis/bookmarkparser
A Python API to go through your browser Bookmarks file DATA.
https://github.com/aidenellis/bookmarkparser
aidenellis bookmarks brave-extension browser chrome-extension parser python
Last synced: 3 months ago
JSON representation
A Python API to go through your browser Bookmarks file DATA.
- Host: GitHub
- URL: https://github.com/aidenellis/bookmarkparser
- Owner: AidenEllis
- License: mit
- Created: 2022-06-24T06:54:21.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-24T15:57:31.000Z (almost 3 years ago)
- Last Synced: 2025-02-20T05:45:51.980Z (4 months ago)
- Topics: aidenellis, bookmarks, brave-extension, browser, chrome-extension, parser, python
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Bookmark Parser - Explore Your Browser Bookmark Data ๐
COC
ยท
Community
ยท
Docs (Below)## ๐ซ Introduction :
The main goal of BookmarkParser Module is to allow people to easily explore and play with their bookmarks' data in an
easy-structured way with a variety of functionality.## โซ Browsers tested on:
* `Google Chrome`
* `Brave`### Installing BookmarkParser :
`via pip (recommended) :`
```shell
pip install BookmarkParser
```or
`via pip + github : `
```shell
pip install git+https://github.com/AidenEllis/BookmarkParser.git
```## ๐ค Docs:
Let's import the moduele and show you along :
```python
from BookmarkParser import Bookmarksbookmarks = Bookmarks()
```#### ๐ฅจ Bookmarks class:
* Arguments:
* `filepath: str`: file path of the Bookmarks file. Usually used for manually assign a file. Google it with your specific browser brand.
####
* `browser: str`: Automatically finding your browser file path. Currently, only works with `'Chrome', 'Brave'` just pass in either of these browser name and it'll find the `Bookmarks` file.Setting up out Class
```python
from BookmarkParser import Bookmarksbookmarks = Bookmarks(browser='Chrome').setup() # Automatic Path setup
# or
bookmarks = Bookmarks(filepath="C://File/to/somewhere/Bookmarks").setup() # Manual File setup```
Let's actually use it
```python
from BookmarkParser import Bookmarksbookmarks = Bookmarks(filepath="C://File/to/somewhere/Bookmarks").setup() # Manual File insert
a = bookmarks.bookmark_bar # --> List
b = bookmarks.synced # --> List
c = bookmarks.other # --> List# These are the 3 types of ROOT Bookamarks Folder
```you can iterate through it
```python
from BookmarkParser import Bookmarksbookmarks = Bookmarks(filepath="C://File/to/somewhere/Bookmarks").setup() # Manual File insert
for bookmark in bookmarks.bookmark_bar:
print(bookmark) # Returns a list of Bookmarked items (urls and folders)
```> `BookmarkFolder` Attribute & Attributes Functions :
* `name`: Name of the folder or the link
###
* `path`: Path to the bookmarked item e.g. "Bookmarks/bookmarks_tab/title"
###
* `url` : Returns url of the bookmarked item (different urls for folders and links)
###
* `datetime`: Returns the date-time of when it was added
###
* `children` (only available for folders) (returns urls and child folders)
###
* `is_folder`: Cheks the if the bookmark item is folder or not.
###
* `url`: Gives back the browser url of the bookmark item.
###
* `urls`: returns all the urls (objects) within the current folder๐ Self (Parent)
โโโ ๐ Child 1
โ โโโ ๐ Link 1 โ
โ โโโ ๐ Link 2 โ
โ
โโโ ๐ Link 3 โ
โโโ ๐ Link 4 โ
โโโ ๐ Link 5 โ
โโโ ๐ Link 6 โ
###
* `num_urls`: Returns the total amount of urls within the current folder. (this does not contains urls from nested folders)
###
* `nestedUrls`: returns all the urls within the current folder and also from the nested folders.๐ Self (Parent)
โโโ ๐ Child 1
โ โโโ ๐ Link 1 โ
โ โโโ ๐ Link 2 โ
โ
โโโ ๐ Link 3 โ
โโโ ๐ Link 4 โ
โโโ ๐ Link 5 โ
โโโ ๐ Link 6 โ
###
* `folders`: Returns all the child folders (This does not contain any nested folders)๐ Self (Parent)
โโโ ๐ Child 1 โ
โ โโโ ๐ Child 1's child (1) โ
โโโ ๐ Child 2 โ
โ โโโ ๐ Child 2's child (1) โ
โ โโโ ๐ Child 2's child (2) โ
โโโ
###
* `num_folders`: Returns the total number of only child folders.
###
* `subfolders`: Returns all the child and its nested subfolders within the chosen directory.๐ Self (Parent)
โโโ ๐ Child 1 โ
โ โโโ ๐ Child 1's child (1) โ
โโโ ๐ Child 2 โ
โ โโโ ๐ Child 2's child (1) โ
โ โโโ ๐ Child 2's child (2) โ
โ โโโ ๐ Child 2's child (2)'s child(1) โ
โโโ
###
* `num_subfolders`: Returns the total number of subfolders (including child and nested folders)#### Here, have a cookie (ใฅ๏ฝก โโฟโฟโ๏ฝก) ใฅ๐ช