Skip to main content

A Simple and clean way to explore Bookmarks Data.

Project description

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) :

pip install BookmarkParser

or

via pip + github :

pip install git+https://github.com/AidenEllis/BookmarkParser.git

๐Ÿค“ Docs:

Let's import the moduele and show you along :

from BookmarkParser import Bookmarks

bookmarks = 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

from BookmarkParser import Bookmarks

bookmarks = 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

from BookmarkParser import Bookmarks

bookmarks = 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

from BookmarkParser import Bookmarks

bookmarks = 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 (ใฅ๏ฝก โ—•โ€ฟโ€ฟโ—•๏ฝก) ใฅ๐Ÿช

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BookmarkParser-1.0.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

BookmarkParser-1.0.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file BookmarkParser-1.0.0.tar.gz.

File metadata

  • Download URL: BookmarkParser-1.0.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for BookmarkParser-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e71a8c49b4c8e7d3159b4116c496970e04d2f077f83086d39d9e1f988399174a
MD5 cba0d6884e92d5db4d87b1078fc15cc7
BLAKE2b-256 e5050495967c68095429c0934d0479824cf809e1c977fe0c8426d8147b4e4052

See more details on using hashes here.

File details

Details for the file BookmarkParser-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for BookmarkParser-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d800ad7752d56e14a5ab9fc971be99845614e7508cab311c798d5e2ee4dce3e2
MD5 9a7c38f59d0fb93a4003bedb129cc6ae
BLAKE2b-256 ec6e6b3fc3f90d5f5e1a5a9bcf38d99a72c99207c3991fdb9dd45a9a57fb6ef7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page