This guide describes how to test the doc-scraper package locally and publish it to PyPI.
Ensure you have build and twine installed:
pip install build twineBefore publishing, it's good practice to install the package in editable mode and run tests.
pip install -e .pytestdoc-scraper --help
doc-scraper https://example.com --output-dir ./test_contextTo create the distribution artifacts (Source Distribution and Wheel), run:
python -m buildThis will create a dist/ directory containing:
doc_scraper-0.1.0.tar.gz(Source)doc_scraper-0.1.0-py3-none-any.whl(Wheel)
Check that the distribution files are valid:
twine check dist/*Upload to TestPyPI to verify everything looks correct without affecting the real PyPI index.
twine upload --repository testpypi dist/*You can then try installing it:
pip install --index-url https://test.pypi.org/simple/ doc-scraperOnce verified, upload to the official Python Package Index:
twine upload dist/*Remember that users will need to run playwright install after installing this package, as noted in the README.md.