π₯ A powerful Python tool to extract Firebase documentation from URLs and convert them to clean Markdown format with intelligent language filtering.
Problem: Most AI models (ChatGPT, GitHub Copilot, etc.) don't have access to the latest Firebase documentation. Firebase is a rapidly evolving platform with frequent updates, new features, and API changes. This creates a gap when trying to implement modern Firebase applications with AI assistance.
Solution: This tool extracts the latest Firebase documentation in a clean, AI-friendly format that you can:
- π Copy-paste into AI conversations for accurate, up-to-date context
- π§ Feed into AI models as reference material for code generation
- π Use as training data or examples for your AI workflows
- π Keep synchronized with Firebase's latest features and changes
Result: Get accurate, current Firebase implementation guidance from AI models using the latest official documentation!
- π Web Scraping: Extracts content from Firebase documentation URLs
- π Markdown Conversion: Converts HTML to clean, formatted Markdown
- π― Language Filtering: Selectively include specific programming languages (Swift, Kotlin, Java, Web, Dart, Unity, Python, Go, PHP, Ruby, Node.js)
- π¨ Interactive Selection: Beautiful color-coded arrow key navigation for language selection
- π§Ή Smart Content Cleaning: Removes navigation, ads, and irrelevant content
- π¦ Proper Code Blocks: Converts code snippets to standard markdown format with triple backticks
- π Cross-Platform: Works on Windows, macOS, and Linux
The tool features an interactive language selection interface with:
- β/β Arrow key navigation
- Space to select/deselect languages
- Enter to confirm selection
- Beautiful colors for better visual feedback
-
Clone the repository:
git clone https://github.com/kavinduUdhara/extract-data-from-firebase-documenations.git cd extract-data-from-firebase-documenations -
Install dependencies:
pip install -r requirements.txt
# Extract with interactive language selection (default)
python firebase_docs_extractor.py "https://firebase.google.com/docs/ai-logic/get-started?api=vertex"
# Extract specific languages only
python firebase_docs_extractor.py "https://firebase.google.com/docs/auth" --languages swift kotlin
# Save to specific directory
python firebase_docs_extractor.py "https://firebase.google.com/docs/firestore" --output ./docs# Extract latest Firebase Auth documentation for AI context
python firebase_docs_extractor.py "https://firebase.google.com/docs/auth/web/start" --languages web
# Get current Firestore examples for your preferred language
python firebase_docs_extractor.py "https://firebase.google.com/docs/firestore/quickstart" --languages swift
# Extract comprehensive AI Logic documentation for modern AI features
python firebase_docs_extractor.py "https://firebase.google.com/docs/ai-logic/get-started?api=vertex"How to use with AI models:
- π Extract the latest documentation for your Firebase feature
- π Copy the relevant sections from the generated Markdown
- π€ Paste into ChatGPT, Claude, or GitHub Copilot with your question
- β¨ Get accurate answers based on current Firebase documentation!
Example prompt:
Based on this latest Firebase documentation:
[paste extracted markdown here]
Help me implement Firebase Authentication in my React app with error handling.
python firebase_docs_extractor.py "https://firebase.google.com/docs/ai-logic/get-started?api=vertex"This will show an interactive menu where you can:
- Navigate with arrow keys
- Select languages with space bar
- Confirm with Enter
# Extract only Swift and Web examples
python firebase_docs_extractor.py "https://firebase.google.com/docs/auth" --languages swift web
# Extract multiple languages
python firebase_docs_extractor.py "https://firebase.google.com/docs/firestore" --languages kotlin java dart# Force interactive mode (same as default)
python firebase_docs_extractor.py "URL" --interactive
# Custom output directory
python firebase_docs_extractor.py "URL" --languages web --output ./my-docsThe tool can detect and filter the following programming languages:
| Language | Aliases | Example Use Case |
|---|---|---|
| Swift | swift, ios |
iOS app development |
| Kotlin | kotlin, android |
Android app development |
| Java | java |
Android/Server development |
| Web | web, javascript, js |
Web development |
| Dart | dart, flutter |
Flutter development |
| Unity | unity, c#, csharp |
Game development |
| Python | python |
Server-side development |
| Go | go, golang |
Server-side development |
| PHP | php |
Web backend development |
| Ruby | ruby |
Web development |
| Node.js | node, nodejs |
Server-side JavaScript |
python firebase_docs_extractor.py <URL> [OPTIONS]
Arguments:
URL Firebase documentation URL to extract
Options:
-l, --languages Specific languages to include (e.g., swift web kotlin)
-i, --interactive Force interactive language selection
-o, --output Output directory for the Markdown file (default: current directory)
-h, --help Show help message and exit
Examples:
python firebase_docs_extractor.py "https://firebase.google.com/docs/ai-logic/get-started?api=vertex"
python firebase_docs_extractor.py "URL" --languages swift web
python firebase_docs_extractor.py "URL" --output ./docs --languages kotlin
- Content Extraction: Uses intelligent selectors to find main documentation content
- Language Detection: Scans headings, code blocks, and class names to identify available languages
- Interactive Selection: Presents a color-coded menu for language selection
- Content Filtering: Removes sections for unselected languages
- Markdown Conversion: Converts HTML to clean Markdown with proper code block formatting
- File Generation: Saves with descriptive filenames including selected languages
extract-data-from-firebase-documenations/
βββ firebase_docs_extractor.py # Main extractor script
βββ requirements.txt # Python dependencies
βββ extract_docs.bat # Windows batch script
βββ example_usage.py # Usage examples
βββ help.py # Help and documentation
βββ ENHANCEMENT_SUMMARY.md # Feature documentation
βββ examples/ # Sample extracted files
β βββ ai-logic-get-started-api-vertex-web.md
β βββ ai-logic-get-started-api-vertex.md
βββ README.md # This file
The interactive interface features:
- Blue highlight: Current navigation position
- Green highlight: Current position when selected
- Green text: Selected languages
- Cyan text: Control instructions
- Yellow text: Help messages
- Red text: Error messages
- Content Extraction: 6.9x improvement over basic extraction (68 β 471 lines)
- Language Filtering: Up to 77% size reduction when filtering specific languages
- Smart Cleaning: Removes navigation and irrelevant content while preserving documentation
This tool is 100% open source and built for the community!
Why Open Source?
- π€ Community-Driven: Everyone benefits from improvements and new features
- π Transparency: You can see exactly how your documentation is processed
- π Innovation: Developers can extend and customize for their specific needs
- π Learning: Study the code to understand web scraping and content extraction
- π§ Reliability: Community testing ensures robustness across different systems
Built by developers, for developers - because keeping up with Firebase's rapid evolution shouldn't be a barrier to building great applications with AI assistance.
We welcome contributions from the community! Whether you're:
- π Fixing bugs in content extraction
- β¨ Adding new features like support for more languages
- π Improving documentation and examples
- π¨ Enhancing the UI with better colors or interactions
- π§ Optimizing performance for faster extraction
Every contribution helps make Firebase development more accessible to everyone.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
See CONTRIBUTING.md for detailed guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Firebase team for their comprehensive and regularly updated documentation
- BeautifulSoup and html2text libraries for excellent HTML processing
- The AI/ML community for highlighting the need for current documentation in AI workflows
- Open source contributors who help make this tool better
If you encounter any issues or have questions:
- Check the examples directory for sample outputs
- Review the ENHANCEMENT_SUMMARY.md for detailed features
- Open an issue on GitHub with details about your use case
Special thanks to the AI development community - this tool exists because we all face the same challenge of keeping AI models updated with the latest Firebase features!
Made with β€οΈ for the Firebase developer community
Bridging the gap between Firebase's rapid innovation and AI-assisted development π₯π€