Standalone, reusable web scraping services for GitHub, Dev.to, and Medium — extracted from the ResuMesh project.
Project description
resumesh-scrapers
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 failuresMediumScraperError— Medium RSS failuresDevToScraperError— 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ad472b451f6168b0cb7ca1df2cd24ef2ac6c4775272f33077e5da9f0bb4a073
|
|
| MD5 |
756339bb53926508704720318671f1d9
|
|
| BLAKE2b-256 |
c6fea45fe67ea77e04545e291d951403c643dc5faa059be12559d1a2f80eb4f9
|
Provenance
The following attestation bundles were made for resumesh_scrapers-0.1.0.tar.gz:
Publisher:
cd.yml on AtaCanYmc/resumesh-scrapers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
resumesh_scrapers-0.1.0.tar.gz -
Subject digest:
3ad472b451f6168b0cb7ca1df2cd24ef2ac6c4775272f33077e5da9f0bb4a073 - Sigstore transparency entry: 2169210051
- Sigstore integration time:
-
Permalink:
AtaCanYmc/resumesh-scrapers@7fe68fe3a31b68a52fbde70fc8d401a1ceddf0c2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AtaCanYmc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7fe68fe3a31b68a52fbde70fc8d401a1ceddf0c2 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file resumesh_scrapers-0.1.0-py3-none-any.whl.
File metadata
- Download URL: resumesh_scrapers-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d36f2285a7b8eada7653c7d938b8aaa846c73aaf4b2c3599e43bb89e04b6523a
|
|
| MD5 |
1139b3a1e651a32e2816437d13ae62e7
|
|
| BLAKE2b-256 |
01763b2fad8f690f4be05081edd5249cc1cb5fdc9b9caf5950f5d87099b5a28b
|
Provenance
The following attestation bundles were made for resumesh_scrapers-0.1.0-py3-none-any.whl:
Publisher:
cd.yml on AtaCanYmc/resumesh-scrapers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
resumesh_scrapers-0.1.0-py3-none-any.whl -
Subject digest:
d36f2285a7b8eada7653c7d938b8aaa846c73aaf4b2c3599e43bb89e04b6523a - Sigstore transparency entry: 2169210266
- Sigstore integration time:
-
Permalink:
AtaCanYmc/resumesh-scrapers@7fe68fe3a31b68a52fbde70fc8d401a1ceddf0c2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AtaCanYmc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@7fe68fe3a31b68a52fbde70fc8d401a1ceddf0c2 -
Trigger Event:
workflow_dispatch
-
Statement type: