Skip to main content

Parse and analyze Chromium-based browser session files (Chrome, Vivaldi, Brave, Edge) with workspace support, history, bookmarks, and tab organization

Project description

chromium-session

PyPI version Python 3.12+ License: MIT

Parse and analyze session files from Chromium-based browsers (Chrome, Vivaldi, Brave, Edge) with support for workspaces, profiles, bookmarks, history, and tab management.

Features

  • ๐Ÿ” Auto-detection: Automatically finds and uses the most recently modified session
  • ๐ŸŒ Multi-browser support: Chrome, Vivaldi, Brave, Edge, Opera, Arc, and more
  • ๐Ÿ‘ค Profile detection: Automatically detects and lists all browser profiles
  • ๐Ÿ“ Workspace support: Parse Vivaldi workspaces and group tabs accordingly
  • ๐Ÿ“Š Session analysis: View active/deleted tabs, windows, and session statistics
  • ๐Ÿ’พ Multiple export formats: Rich terminal display, JSON, or CSV export
  • ๐Ÿ”– Bookmarks parser: View bookmarks with folder structure
  • ๐Ÿ“œ History parser: Browse browsing history with search and filtering
  • ๐Ÿ—‚๏ธ Tab organization: Reorganize tabs by domain or title and write back to session files

Installation

From PyPI (Coming Soon)

pip install chromium-session

Using uv (recommended)

uv pip install chromium-session

From Source

git clone https://github.com/Asseel-Naji/chromium-session.git
cd chromium-session
uv pip install -e .

Requirements

  • Python 3.12+
  • Linux (primary support)
  • Chromium-based browser(s) installed

Usage

Quick Start with Auto-Detection

All commands support auto-detection - just omit the browser parameter:

# Automatically detects and uses the most recent session
chromium-session summary
chromium-session parse
chromium-session bookmarks
chromium-session history --limit 20

List Detected Browsers

Show all detected Chromium-based browsers and their profiles:

chromium-session list

Example output:

                               Detected Browsers
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ ID            โ”ƒ Name           โ”ƒ Profiles                         โ”ƒ Sessions โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ chrome        โ”‚ Google Chrome  โ”‚ Default                          โ”‚ 1/1      โ”‚
โ”‚ vivaldi       โ”‚ Vivaldi        โ”‚ Default, Profile 2, Profile 4    โ”‚ 5/5      โ”‚
โ”‚ brave         โ”‚ Brave          โ”‚ Default                          โ”‚ 1/1      โ”‚
โ”‚ edge          โ”‚ Microsoft Edge โ”‚ Default                          โ”‚ 1/1      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

List Browser Profiles

Show all profiles for a specific browser:

chromium-session profiles vivaldi

View Session Summary

Get a quick overview of tabs and windows:

chromium-session summary vivaldi

Example output:

Vivaldi / Default
Session: Session_13402871234567

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Metric      โ”ƒ Value โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ Total tabs  โ”‚ 127   โ”‚
โ”‚ Active tabs โ”‚ 115   โ”‚
โ”‚ Deleted tabsโ”‚ 12    โ”‚
โ”‚ Windows     โ”‚ 3     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

                 Tabs by Workspace
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Workspace          โ”ƒ                       Tabs โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ Work               โ”‚                         42 โ”‚
โ”‚ Research           โ”‚                         38 โ”‚
โ”‚ Personal           โ”‚                         35 โ”‚
โ”‚ No Workspace       โ”‚                         12 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Parse Session Files

Parse and display all tabs in the latest session:

# Parse latest session (default)
chromium-session parse vivaldi

# Parse specific profile
chromium-session parse vivaldi --profile "Default"

# Parse multiple recent sessions
chromium-session parse vivaldi --latest 3

# Show deleted tabs as well
chromium-session parse vivaldi --show-deleted

# Group tabs by workspace (Vivaldi)
chromium-session parse vivaldi --by-workspace

List Workspaces (Vivaldi)

Show all defined workspaces:

chromium-session workspaces vivaldi

Example output:

        Workspaces in Vivaldi / Default
โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
โ”ƒ Emoji โ”ƒ Name                 โ”ƒ ID         โ”ƒ
โ”กโ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ
โ”‚ ๐Ÿ’ผ    โ”‚ Work                 โ”‚ 1          โ”‚
โ”‚ ๐Ÿ”ฌ    โ”‚ Research             โ”‚ 2          โ”‚
โ”‚ ๐Ÿ     โ”‚ Personal             โ”‚ 3          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Browse Bookmarks

Display bookmarks with folder structure:

# Auto-detect browser
chromium-session bookmarks

# Specific browser
chromium-session bookmarks --browser chrome

# Export as JSON
chromium-session bookmarks --json > bookmarks.json

Browse History

View browsing history with search and filtering:

# Show last 50 entries (default)
chromium-session history

# Search for specific term
chromium-session history --search "python"

# Filter by domain
chromium-session history --domain "github.com"

# Limit results
chromium-session history --limit 100

# Export as JSON
chromium-session history --json > history.json

Organize Tabs

Reorganize tabs by domain or title and write back to session files:

# Organize by domain (preview)
chromium-session organize --by-domain --dry-run

# Organize by domain (apply)
chromium-session organize --by-domain

# Sort alphabetically by title
chromium-session organize --by-title

# Organize specific browser
chromium-session organize --browser vivaldi --by-domain

Note: Automatic backup is created before modifying session files.

CSV Export

Export session data to CSV format:

# Export to CSV
chromium-session parse --csv > sessions.csv

# Include deleted tabs
chromium-session parse --csv --show-deleted > all_tabs.csv

JSON Output

Export session data as JSON:

# Export session data
chromium-session parse vivaldi --json > session.json

# Export workspaces
chromium-session workspaces vivaldi --json > workspaces.json

Command Reference

Global Options

Option Description
--help Show help message
--install-completion Install shell completion

Commands

list

List all detected Chromium-based browsers.

chromium-session list

profiles <browser>

List all profiles for a specific browser.

chromium-session profiles vivaldi

Arguments:

  • browser: Browser ID (e.g., chrome, vivaldi, brave, edge)

summary <browser>

Show quick summary statistics for the latest session.

chromium-session summary vivaldi [OPTIONS]

Arguments:

  • browser: Browser ID

Options:

  • --profile, -p: Specific profile name

parse <browser>

Parse and display session files.

chromium-session parse vivaldi [OPTIONS]

Arguments:

  • browser: Browser ID

Options:

  • --profile, -p: Specific profile name
  • --latest, -n: Number of recent sessions to parse (default: 1)
  • --json, -j: Output as JSON
  • --show-deleted: Include deleted tabs and windows
  • --by-workspace, -W: Group tabs by workspace (Vivaldi only)

workspaces <browser>

List defined workspaces (Vivaldi only).

chromium-session workspaces vivaldi [OPTIONS]

Arguments:

  • browser: Browser ID

Options:

  • --profile, -p: Specific profile name
  • --json, -j: Output as JSON

Use Cases

Session Recovery

Recover tabs after a browser crash:

# View all tabs from the latest session
chromium-session parse vivaldi --show-deleted

# Export to JSON for processing
chromium-session parse vivaldi --json > crashed-session.json

Tab Management

Analyze your browsing habits:

# See how many tabs you have per workspace
chromium-session summary vivaldi

# Find specific tabs
chromium-session parse vivaldi --json | jq '.windows[].tabs[] | select(.title | contains("Python"))'

Multi-Profile Management

Work with multiple browser profiles:

# List all profiles
chromium-session profiles vivaldi

# Parse specific profile
chromium-session parse vivaldi --profile "Work"

Browser Support

Browser ID Session Support Workspace Support
Google Chrome chrome โœ… โŒ
Vivaldi vivaldi โœ… โœ…
Brave brave โœ… โŒ
Brave Nightly brave-nightly โœ… โŒ
Microsoft Edge edge โœ… โŒ

Running as a Module

You can also run the package as a Python module:

python -m chromium_session list

Development

Setup Development Environment

git clone https://github.com/yourusername/chromium-session.git
cd chromium-session
uv venv
source .venv/bin/activate
uv pip install -e .

Project Structure

chromium-session/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ chromium_session/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ __main__.py      # Module entry point
โ”‚       โ”œโ”€โ”€ cli.py           # Typer CLI interface
โ”‚       โ”œโ”€โ”€ parser.py        # Session file parser
โ”‚       โ””โ”€โ”€ browsers.py      # Browser detection logic
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

Troubleshooting

No browsers detected

Problem: chromium-session list shows no browsers.

Solution: Ensure you have at least one Chromium-based browser installed in the default location:

  • Chrome: ~/.config/google-chrome/
  • Vivaldi: ~/.config/vivaldi/
  • Brave: ~/.config/BraveSoftware/Brave-Browser/
  • Edge: ~/.config/microsoft-edge/

Session files not found

Problem: Browser is detected but sessions show 0/N.

Solution: The browser must have been run at least once. Session files are created in:

<browser-config-dir>/<profile>/Sessions/

Import errors after moving project

Problem: python -m chromium_session fails with import errors.

Solution: Reinstall the package in the new location:

uv pip install -e .

License

MIT License - See LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Author

Asseel Naji

Acknowledgments

  • Built with Typer for the CLI
  • Rich for beautiful terminal output

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

chromium_session-0.2.0.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chromium_session-0.2.0-py3-none-any.whl (25.7 kB view details)

Uploaded Python 3

File details

Details for the file chromium_session-0.2.0.tar.gz.

File metadata

  • Download URL: chromium_session-0.2.0.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chromium_session-0.2.0.tar.gz
Algorithm Hash digest
SHA256 36f82f6c14a52427a9a58f2bae825b612cc88f722bbeb3fc745cea53fcbe93b6
MD5 d19f9f5e3cccdbf8918c6a1d7c9c6494
BLAKE2b-256 22240bfc3f2fc07586adcf9a0cc48338a125bd36237b0bcb4619798cf356de91

See more details on using hashes here.

Provenance

The following attestation bundles were made for chromium_session-0.2.0.tar.gz:

Publisher: workflow.yml on Asseel-Naji/chromium-session

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chromium_session-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chromium_session-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a8042593d15c656832aedf0d1bd686b3a95248933135727794396a9b94c98e1
MD5 417e9edc15a0f40cebbafa3a35d4abdb
BLAKE2b-256 601082463eea21571611c6f295f851310b6317c92d77e8d430befb75734effca

See more details on using hashes here.

Provenance

The following attestation bundles were made for chromium_session-0.2.0-py3-none-any.whl:

Publisher: workflow.yml on Asseel-Naji/chromium-session

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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