Skip to main content

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 library
  • beautifulsoup4 โ€” HTML parser
  • flask โ€” Web framework

Optional

  • pytesseract + Pillow โ€” For OCR (image to text)
  • SpeechRecognition + pydub โ€” For audio to text
  • moviepy โ€” 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

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -am 'Add my feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. 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

morphscrapper-0.1.0.tar.gz (37.1 kB view details)

Uploaded Source

Built Distribution

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

morphscrapper-0.1.0-py3-none-any.whl (45.3 kB view details)

Uploaded Python 3

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

Hashes for morphscrapper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b16329346b9d8b8c780239f4f86636290343667caba2b488d99bd05e0a60b7a2
MD5 5d3e1bc00e284dcda0afce16954f559d
BLAKE2b-256 184200c311c44fba509ecc5a106307307727f734058f18041533f4fc662a0851

See more details on using hashes here.

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

Hashes for morphscrapper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47bac870dc6052c41517cb629b6599be9578bf6e746da7e5b6735a55c96c7efc
MD5 ea24ad59b427e93b264cdf7f4084a6d8
BLAKE2b-256 06d86dae99428b2925872396f1c5fee5a2fc758c2edaea4874f7f239ddc1b834

See more details on using hashes here.

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