yieldplotlib.generate_docs
==========================

.. py:module:: yieldplotlib.generate_docs

.. autoapi-nested-parse::

   Generate parameter table documentation from Google Sheets data.

   This script downloads a specified Google Sheet and generates a markdown table
   from its contents, focusing on parameter names and descriptions. The table
   is generated without a header so it can be included in other documentation files.

   Usage Examples:
   1. Generate from a local CSV file:
      ```
      python generate_docs.py --csv sheet.csv --output ../../docs/user/parameters_table.md
      ```

   2. Download from Google Sheets using temporary credentials:
      ```
      python generate_docs.py --sheets SHEET_ID        --output ../../docs/user/parameters_table.md        --temp
      ```



Functions
---------

.. autoapisummary::

   yieldplotlib.generate_docs.parse_args
   yieldplotlib.generate_docs.download_from_google_sheets
   yieldplotlib.generate_docs.read_csv_file
   yieldplotlib.generate_docs.generate_markdown_table
   yieldplotlib.generate_docs.main


Module Contents
---------------

.. py:function:: parse_args()

   Parse command line arguments.


.. py:function:: download_from_google_sheets(sheet_id, credentials_json_path = None)

   Download a CSV file from Google Sheets.

   Args:
       sheet_id:
         The ID of the Google Sheet to download.
       credentials_json_path:
         Path to a service account credentials JSON file. If None,
         credentials will be loaded from GOOGLE_CREDENTIALS_B64
         environment variable.

   Returns:
       CSV content as a string.


.. py:function:: read_csv_file(file_path)

   Read a CSV file from disk.

   Args:
       file_path:
         Path to the CSV file to read.

   Returns:
       CSV content as a string.


.. py:function:: generate_markdown_table(csv_content)

   Generate a markdown table from CSV content without a header.

   Args:
       csv_content:
         CSV content as a string.

   Returns:
       Markdown table as a string.


.. py:function:: main()

   Main function to generate docs.


