A Python library to extract and organize Firefox browser tabs
Project description
Firefox Tab Extractor ๐ฅ
A powerful Python library to extract and organize Firefox browser tabs for productivity, study organization, and workflow management.
๐ฏ Why Firefox Tab Extractor?
Tired of losing track of important tabs? This library helps you:
- ๐ Organize study materials - Extract all your research tabs into structured formats
- ๐ Productivity tracking - See which sites you visit most and optimize your workflow
- ๐ Session backup - Save your browsing sessions before major cleanup
- ๐ Notion integration - Export tabs directly to Notion for task management
- ๐ Learning management - Create structured study schedules from your open tabs
โจ Features
- ๐ Smart profile detection - Automatically finds Firefox profiles across different OS
- ๐ Multiple output formats - JSON for developers, CSV for Notion/Excel
- ๐ท๏ธ Rich metadata - Tab titles, URLs, access times, pinned status, domains
- ๐ Statistics & analytics - Get insights about your browsing patterns
- ๐ ๏ธ Developer-friendly - Clean API, type hints, comprehensive error handling
- ๐ CLI & Library - Use as command-line tool or import in your Python code
๐ Quick Start
Installation
pip install firefox-tab-extractor
Command Line Usage
# Extract all tabs to default files
firefox-tab-extractor
# Save to specific files
firefox-tab-extractor --json my_tabs.json --csv my_tabs.csv
# Show statistics only
firefox-tab-extractor --stats-only
# Verbose output with preview
firefox-tab-extractor --verbose --preview 10
Python Library Usage
from firefox_tab_extractor import FirefoxTabExtractor
# Initialize extractor
extractor = FirefoxTabExtractor()
# Extract tabs
tabs = extractor.extract_tabs()
# Get statistics
stats = extractor.get_statistics(tabs)
print(f"Found {stats['total_tabs']} tabs across {stats['total_windows']} windows")
# Save to files
extractor.save_to_json(tabs, "my_tabs.json")
extractor.save_to_csv(tabs, "my_tabs.csv")
# Group by windows
windows = extractor.get_windows(tabs)
for window in windows:
print(f"Window {window.window_index}: {window.tab_count} tabs")
๐ Output Formats
JSON Output
{
"extraction_time": "2024-01-15T10:30:00",
"total_tabs": 25,
"windows": 3,
"pinned_tabs": 5,
"hidden_tabs": 2,
"tabs": [
{
"window_index": 1,
"tab_index": 1,
"title": "GitHub - Your Repository",
"url": "https://github.com/username/repo",
"last_accessed": 1705312200000,
"last_accessed_readable": "2024-01-15 10:30:00",
"pinned": true,
"hidden": false,
"domain": "github.com"
}
]
}
CSV Output (Notion-ready)
window_index,tab_index,title,url,last_accessed_readable,pinned,hidden,domain
1,1,GitHub - Your Repository,https://github.com/username/repo,2024-01-15 10:30:00,true,false,github.com
๐ Study Organization Workflow
1. Extract Your Tabs
firefox-tab-extractor --csv study_materials.csv
2. Import to Notion
- Create a new Notion database
- Import the CSV file
- Add custom properties:
- Category (JavaScript, Python, System Design, etc.)
- Priority (High, Medium, Low)
- Estimated Reading Time (15min, 30min, 1hr)
- Status (Not Started, In Progress, Completed)
- Study Day (Monday, Wednesday, Friday, Weekend)
3. Create Study Schedule
Monday (1 hour):
- 1 book chapter (30 min)
- 2-3 short articles (30 min)
Wednesday (1 hour):
- 1 book chapter (30 min)
- 1 long technical article (30 min)
Friday (1 hour):
- 1 book chapter (30 min)
- Practice problems/coding (30 min)
Weekend (2 hours):
- 1 book chapter (30 min)
- 2-3 comprehensive tutorials (90 min)
๐ ๏ธ Advanced Usage
Custom Firefox Profile
extractor = FirefoxTabExtractor(profile_path="~/.mozilla/firefox/custom.profile")
Filtering and Analysis
# Get only pinned tabs
pinned_tabs = [tab for tab in tabs if tab.pinned]
# Get tabs by domain
github_tabs = [tab for tab in tabs if tab.domain == "github.com"]
# Get recently accessed tabs
from datetime import datetime, timedelta
recent_tabs = [
tab for tab in tabs
if tab.last_accessed_datetime > datetime.now() - timedelta(days=7)
]
Error Handling
from firefox_tab_extractor import FirefoxTabExtractor
from firefox_tab_extractor.exceptions import FirefoxProfileNotFoundError
try:
extractor = FirefoxTabExtractor()
tabs = extractor.extract_tabs()
except FirefoxProfileNotFoundError:
print("Firefox profile not found. Make sure Firefox is installed.")
๐ง Troubleshooting
Firefox Profile Not Found
- Make sure Firefox has been run at least once
- Check if Firefox is installed via snap:
snap list firefox - Use
--profileto specify custom profile path
Permission Issues
- Ensure you have read access to Firefox profile directory
- On some systems, you might need to close Firefox first
No Tabs Found
- Ensure Firefox has active tabs open
- Try closing and reopening Firefox to refresh session data
- Check if Firefox is in private browsing mode (private tabs aren't saved)
๐ค Contributing
We welcome contributions! Here's how you can help:
๐ Reporting Bugs
- Use the GitHub issue tracker
- Include your OS, Firefox version, and Python version
- Provide error messages and steps to reproduce
๐ก Feature Requests
- Open an issue with the "enhancement" label
- Describe the feature and its use case
- Consider contributing the implementation
๐ง Development Setup
# Clone the repository
git clone https://github.com/ViniciusPuerto/firefox-tab-extractor.git
cd firefox-tab-extractor
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black firefox_tab_extractor/
# Type checking
mypy firefox_tab_extractor/
๐ Code Style
- Follow PEP 8 style guidelines
- Use type hints for all functions
- Add docstrings for all public methods
- Write tests for new features
๐ Roadmap
Planned Features
- Chrome/Edge support - Extract tabs from other browsers
- Tab categorization - AI-powered content classification
- Reading time estimation - Based on content analysis
- Duplicate detection - Find and merge similar tabs
- Scheduled extraction - Automatically extract tabs at intervals
- Web interface - Browser-based tab management
- Cloud sync - Backup and sync across devices
- Tab analytics - Detailed browsing pattern analysis
Integration Ideas
- Notion API - Direct integration with Notion
- Obsidian - Export to Obsidian vault
- Roam Research - Integration with Roam
- Todoist - Create tasks from tabs
- Slack - Share tab collections with teams
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Firefox - For providing an accessible session storage format
- LZ4 - For the compression library used by Firefox
- Python community - For the excellent ecosystem of tools and libraries
๐ Support
- ๐ง Email: vinicius.alves.porto@gmail.com
- ๐ Issues: GitHub Issues
- ๐ Documentation: GitHub Wiki
- ๐ฌ Discussions: GitHub Discussions
Made with โค๏ธ for the productivity community
If this project helps you organize your digital life, consider giving it a โญ on GitHub!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file firefox_tab_extractor-1.0.0.tar.gz.
File metadata
- Download URL: firefox_tab_extractor-1.0.0.tar.gz
- Upload date:
- Size: 26.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3618c8d70dd7ea968362e0c7fc5edc2192cc8e5d9ae56e7d75f5907dba903eae
|
|
| MD5 |
a77d31889a9c3d850cd26f7859a2a426
|
|
| BLAKE2b-256 |
7a07c9ed3fb846ab6b2d0df0ece0b0b17b1439efe827a315015f44b8a0b67e4d
|
File details
Details for the file firefox_tab_extractor-1.0.0-py3-none-any.whl.
File metadata
- Download URL: firefox_tab_extractor-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd613fdb1c7cf03c645b79d4b0b73e601ad802c4dcf8db2f02ab828a8690a6a7
|
|
| MD5 |
455681714fa506d5eb4186330238d41f
|
|
| BLAKE2b-256 |
ac4a297729723ea5224c1b56dfaeebc6f1708cddb49b946fca5ea209ab35702c
|