A multi-modal web scraping package for extracting text, images, audio, and video.
Project description
๐ฎ morph
A multi-modal web scraping package for Python.
Extract text, images, audio, and video from any website. Convert media with OCR, speech recognition, and video processing.
โจ Features
- ๐ Text Scraping โ Extract all visible text from any webpage
- ๐ผ๏ธ Image Scraping โ Find and download all images (JPG, PNG, etc.)
- ๐ต Audio Scraping โ Detect and download audio files (MP3, WAV)
- ๐ฌ Video Scraping โ Find and download video files (MP4, WEBM, MOV)
- ๐ค Image โ Text โ OCR using Tesseract to read text from images
- ๐ค Audio โ Text โ Speech recognition to transcribe audio
- ๐๏ธ Video Processing โ Extract audio, text, or frames from videos
- ๐ฆ Export โ Save results as TXT, CSV, JSON, or ZIP
- ๐ป CLI โ Full command-line interface
- ๐ Web Interface โ Beautiful dark-themed browser UI
๐ Quick Start
Installation
# Clone the repository
git clone https://github.com/chiragferwani/morph.git
cd morph
# Install the package
pip install .
# Or install with all optional features
pip install ".[all]"
Python API
from morph import scrape_text, scrape_images
# Scrape text from a website
result = scrape_text("https://example.com")
print(result["text"])
# Scrape images
result = scrape_images("https://example.com")
for image in result["images"]:
print(image["src"])
CLI
# Scrape text
morph scrape text https://example.com --output json
# Scrape and download images
morph scrape images https://example.com --download
# Convert image to text (OCR)
morph convert image-to-text screenshot.png
# Start the web interface
morph web
Web Interface
morph web --port 5000
Then open http://localhost:5000 in your browser.
๐ Project Structure
morph-nlp1/
โโโ morph/ # Main package
โ โโโ __init__.py # Package init, exports all public functions
โ โโโ cli/ # Command-line interface
โ โ โโโ main.py # CLI entry point (argparse)
โ โโโ core/ # Shared configuration
โ โ โโโ config.py # Constants (timeouts, headers, formats)
โ โโโ scrapers/ # Web scraping modules
โ โ โโโ text_scraper.py # scrape_text()
โ โ โโโ image_scraper.py # scrape_images()
โ โ โโโ audio_scraper.py # scrape_audio()
โ โ โโโ video_scraper.py # scrape_video()
โ โโโ converters/ # Media conversion modules
โ โ โโโ image_converter.py # image_to_text() โ OCR
โ โ โโโ audio_converter.py # audio_to_text() โ Speech Recognition
โ โ โโโ video_converter.py # video_to_audio/text/images()
โ โโโ utils/ # Utility functions
โ โ โโโ downloader.py # download_file()
โ โ โโโ exporter.py # export_to_txt/csv/json/zip()
โ โ โโโ validator.py # validate_url(), check_connection()
โ โโโ web/ # Web interface
โ โโโ app.py # Flask backend
โ โโโ templates/ # HTML templates
โ โโโ static/ # CSS and JavaScript
โโโ examples/ # Usage examples
โโโ tests/ # Unit tests
โโโ docs/ # Documentation
โโโ setup.py # Installation script
โโโ pyproject.toml # Modern packaging config
โโโ requirements.txt # Dependencies
โโโ README.md # This file
๐ Requirements
Core (Required)
- Python 3.8+
requestsโ HTTP librarybeautifulsoup4โ HTML parserflaskโ Web framework
Optional
pytesseract+Pillowโ For OCR (image to text)SpeechRecognition+pydubโ For audio to textmoviepyโ For video processing
System Dependencies
- Tesseract OCR โ
sudo apt install tesseract-ocr - FFmpeg โ
sudo apt install ffmpeg
๐ License
MIT License โ see LICENSE for details.
๐ค Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -am 'Add my feature') - Push to the branch (
git push origin feature/my-feature) - Open a Pull Request
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
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 morphscrapper-0.1.0.tar.gz.
File metadata
- Download URL: morphscrapper-0.1.0.tar.gz
- Upload date:
- Size: 37.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b16329346b9d8b8c780239f4f86636290343667caba2b488d99bd05e0a60b7a2
|
|
| MD5 |
5d3e1bc00e284dcda0afce16954f559d
|
|
| BLAKE2b-256 |
184200c311c44fba509ecc5a106307307727f734058f18041533f4fc662a0851
|
File details
Details for the file morphscrapper-0.1.0-py3-none-any.whl.
File metadata
- Download URL: morphscrapper-0.1.0-py3-none-any.whl
- Upload date:
- Size: 45.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47bac870dc6052c41517cb629b6599be9578bf6e746da7e5b6735a55c96c7efc
|
|
| MD5 |
ea24ad59b427e93b264cdf7f4084a6d8
|
|
| BLAKE2b-256 |
06d86dae99428b2925872396f1c5fee5a2fc758c2edaea4874f7f239ddc1b834
|