Skip to main content

Standalone, reusable web scraping services for GitHub, Dev.to, and Medium — extracted from the ResuMesh project.

Project description

resumesh-scrapers

PyPI version Python versions License CI

Standalone, reusable web scraping services for GitHub, Dev.to, and Medium — extracted from the ResuMesh project.

Installation

pip install resumesh-scrapers

Development (editable install)

git clone https://github.com/AtaCanYmc/resumesh-scrapers.git
cd resumesh-scrapers
pip install -e .

Quick Start

import asyncio
from resumesh_scrapers import (
    GitHubScraperService,
    DevToScraperService,
    MediumScraperService,
    ScrapedProject,
    ScrapedArticle,
)

async def main():
    # GitHub
    github = GitHubScraperService()
    projects: list[ScrapedProject] = await github.fetch_data(
        "octocat",
        pat="ghp_...",          # optional — rate limit 60 → 5000/hour
        include_forks=False,    # default
    )
    for p in projects:
        print(f"⭐ {p.stars}  {p.title}")

    # Dev.to
    devto = DevToScraperService()
    articles: list[ScrapedArticle] = await devto.fetch_data(
        "atacanymc",
        api_key="your_key",    # optional
    )

    # Medium
    medium = MediumScraperService()
    articles: list[ScrapedArticle] = await medium.fetch_data("atacanymc")

asyncio.run(main())

Models

Model Description
ScrapedProject GitHub repository data (title, stars, forks, languages, etc.)
ScrapedArticle Blog article data (title, summary, url, platform, etc.)
ArticlePlatform Enum: MEDIUM, DEV_TO

Exceptions

All exceptions inherit from ScraperError:

  • GitHubScraperError — GitHub API failures
  • MediumScraperError — Medium RSS failures
  • DevToScraperError — Dev.to API failures
from resumesh_scrapers.exceptions import ScraperError

try:
    projects = await scraper.fetch_data("invalid user!")
except ScraperError as e:
    print(f"Scraping failed: {e}")
    print(f"HTTP status: {e.status_code}")  # may be None

ResuMesh Backend Integration

1. Install

pip install resumesh-scrapers

2. Update imports

# Before (tightly coupled)
from app.services.scrapers.base import IScraperService
from app.services.scrapers.exceptions import ScraperError
from app.services.scrapers.github_scraper import GitHubScraperService

# After (decoupled)
from resumesh_scrapers import GitHubScraperService, IScraperService
from resumesh_scrapers.exceptions import ScraperError

3. Map scraped data to DB schemas

from resumesh_scrapers import GitHubScraperService, ScrapedProject
from app.schemas.project import ProjectCreate

scraper = GitHubScraperService()
scraped: list[ScrapedProject] = await scraper.fetch_data("octocat")

# Convert to your backend's schema using model_dump()
for project in scraped:
    db_project = ProjectCreate(**project.model_dump())
    await project_repo.upsert_project(db_project)

License

Apache 2.0 — see LICENSE for details.

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

resumesh_scrapers-0.1.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

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

resumesh_scrapers-0.1.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file resumesh_scrapers-0.1.0.tar.gz.

File metadata

  • Download URL: resumesh_scrapers-0.1.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for resumesh_scrapers-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3ad472b451f6168b0cb7ca1df2cd24ef2ac6c4775272f33077e5da9f0bb4a073
MD5 756339bb53926508704720318671f1d9
BLAKE2b-256 c6fea45fe67ea77e04545e291d951403c643dc5faa059be12559d1a2f80eb4f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for resumesh_scrapers-0.1.0.tar.gz:

Publisher: cd.yml on AtaCanYmc/resumesh-scrapers

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

File details

Details for the file resumesh_scrapers-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for resumesh_scrapers-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d36f2285a7b8eada7653c7d938b8aaa846c73aaf4b2c3599e43bb89e04b6523a
MD5 1139b3a1e651a32e2816437d13ae62e7
BLAKE2b-256 01763b2fad8f690f4be05081edd5249cc1cb5fdc9b9caf5950f5d87099b5a28b

See more details on using hashes here.

Provenance

The following attestation bundles were made for resumesh_scrapers-0.1.0-py3-none-any.whl:

Publisher: cd.yml on AtaCanYmc/resumesh-scrapers

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