yieldplotlib.generate_docs#
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 `
Download from Google Sheets using temporary credentials:
` python generate_docs.py --sheets SHEET_ID --output ../../docs/user/parameters_table.md --temp `
Functions#
Parse command line arguments. |
|
|
Download a CSV file from Google Sheets. |
|
Read a CSV file from disk. |
|
Generate a markdown table from CSV content without a header. |
|
Main function to generate docs. |
Module Contents#
- yieldplotlib.generate_docs.parse_args()#
Parse command line arguments.
- yieldplotlib.generate_docs.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.
- Parameters:
sheet_id (str)
credentials_json_path (str | None)
- Return type:
str
- yieldplotlib.generate_docs.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.
- Parameters:
file_path (str)
- Return type:
str
- yieldplotlib.generate_docs.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.
- Parameters:
csv_content (str)
- Return type:
str
- yieldplotlib.generate_docs.main()#
Main function to generate docs.