This repo is still a small personal automation tool, not a generic scraping platform. Keep changes tight, readable, and easy to verify.
- Python 3.10+
- Git
git clone https://github.com/CGFixIT/Scrape-n-Email.git
cd Scrape-n-Email
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"PowerShell:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"For live email runs:
EMAIL_USEREMAIL_PASS- optional
EMAIL_RECIPIENT
Never commit secrets, .env files, or machine-specific scheduler paths.
src/scrape_n_email/contains the real package.tests/unit/contains most focused coverage.tests/integration/test_pipeline.pycovers the offline end-to-end path.main.pyis a compatibility shim, not the preferred entrypoint.
Preferred:
python -m scrape_n_emailOffline-friendly scrape-only path:
python -m scrape_n_email --skip-emailRun the full local gate before opening a PR for behavior changes:
ruff check src/ tests/
ruff format --check src/ tests/
mypy src/scrape_n_email
pytest tests/ --cov=scrape_n_email --cov-report=term-missing --cov-fail-under=80Narrow checks are fine while iterating, but do not stop there for behavior changes:
pytest tests/unit/test_scrapers.py -q
pytest tests/integration/test_pipeline.py -q- Keep parser functions pure where practical so they stay easy to test offline.
- Reuse
scrape_n_email.scrapers.base.get()for HTTP behavior. - Reuse
scrape_n_email.csvhelpers for CSV writes. - Do not remove spreadsheet-formula escaping.
- Use
logging, notprint(), in library code. - Do not add new dependencies for convenience.
- Do not add live-network or real-SMTP tests to normal CI.
- A small, clearly scoped change.
- Updated tests when parser, config, CSV, CLI, or mailer behavior changed.
- The validation commands you actually ran.
- Any manual verification notes, clearly labeled as manual.
- Parser fixes for source HTML drift.
- Better offline coverage for edge cases.
- Small reliability improvements in config, retry, CSV, or mailer logic.
- Documentation fixes that match the actual repo behavior.
- Turning this into a broad scraping framework.
- Introducing new dependencies without a real payoff.
- Committing generated outputs, credentials, or local scratch files.
- Shipping parser changes without updating the matching tests.
If you touch repo-local AI scaffolding, keep these aligned:
AGENTS.md.codex/commands/.claude/CLAUDE.md
Codex command files belong in commands/*.toml. Reusable Codex skill entrypoints belong in .codex/skills/.
Useful bug reports include:
- Python version
- OS
- exact error text
- repro steps
- for scraper bugs, a small HTML snippet or clear description of the site change
By contributing, you agree that your contributions are licensed under the MIT License used by this repository.