Documentation#

About documentation#

  • yfinance documentation is written in reStructuredText (rst) and built using Sphinx.

  • The documentation file is in doc/source/...

  • Most of the notes under API References read from class and methods docstrings. These documentations, found in doc/source/reference/api is autogenerated by Sphinx and not included in git.

Building documentation locally#

To build the documentation locally, follow these steps:

  1. Install Required Dependencies:

    • Install the package along with all development dependencies (includes Sphinx and related tools):

    pip install -e ".[dev]"
    
  2. Build with Sphinx:

    • After dependencies are installed, use the sphinx-build command to generate HTML documentation.

    sphinx-build -b html doc/source doc/_build/html
    
  3. View Documentation Locally:

    python -m http.server -d ./doc/_build/html
    

    Then open “localhost:8000” in browser

Publishing documentation#

Merge into main branch triggers auto-generating documentation by action .github/workflows/deploy_doc.yml. This publishes the generated HTML into branch documentation.

  1. Review the changes locally and push to dev.

  2. When dev gets merged to main, GitHub Actions workflow is automated to build documentation.