| title | API Reference |
|---|---|
| description | Complete reference for the solarfarmer Python SDK |
The SolarFarmer Python SDK is the official Python client for the SolarFarmer energy calculation service. This page documents all publicly exported functions and classes.
The SolarFarmer SDK is organized into the following main categories:
- Endpoint Functions: Core functions for making API calls
- Main Classes: Key data models for calculations and plant design
- Plant Configuration Classes: Location, layout, and inverter specifications
- Module and Equipment Specifications: Mounting types, trackers, and component files
- Advanced System Configuration: Transformers, grid limits, and auxiliary losses
- Additional Configuration Classes: Albedo and other environmental factors
These are the primary functions for interacting with the SolarFarmer API.
::: solarfarmer.endpoint_modelchains.run_energy_calculation options: extra: show_root_toc_entry: false show_root_members: true
::: solarfarmer.endpoint_about.about options: extra: show_root_toc_entry: false show_root_members: true
::: solarfarmer.endpoint_service.service options: extra: show_root_toc_entry: false show_root_members: true
::: solarfarmer.endpoint_terminate_async.terminate_calculation options: extra: show_root_toc_entry: false show_root_members: true
The core classes handle the complete workflow from plant design to results analysis:
- PVSystem: Main class for constructing approximated PV plant designs from high-level specifications (location, capacity, equipment). Infers layout geometry and losses using simplified assumptions; results are suitable for screening, not detailed design
- EnergyCalculationInputs: Root Pydantic model composing all inputs for a calculation run
- PVPlant: Pydantic model describing the PV plant structure (transformers, mounting specs, etc.)
- ModelChainResponse: Container for raw API response data from energy calculations
- CalculationResults: Analysis tools for exploring and visualizing energy yield results
::: solarfarmer.PVSystem options: extra: show_root_toc_entry: false show_root_members: true
::: solarfarmer.EnergyCalculationInputs options: extra: show_root_toc_entry: false show_root_members: true
::: solarfarmer.PVPlant options: extra: show_root_toc_entry: false show_root_members: true
::: solarfarmer.ModelChainResponse options: extra: show_root_toc_entry: false show_root_members: true
::: solarfarmer.CalculationResults options: extra: show_root_toc_entry: false show_root_members: true
View in SolarFarmer API Reference{ target="_blank" .external }
View in SolarFarmer API Reference{ target="_blank" .external }
View in SolarFarmer API Reference{ target="_blank" .external }
View in SolarFarmer API Reference{ target="_blank" .external }
View in SolarFarmer API Reference{ target="_blank" .external }
View in SolarFarmer API Reference{ target="_blank" .external }
View in SolarFarmer API Reference{ target="_blank" .external }
View in SolarFarmer API Reference{ target="_blank" .external }
View in SolarFarmer API Reference{ target="_blank" .external }
View in SolarFarmer API Reference{ target="_blank" .external }
View in SolarFarmer API Reference{ target="_blank" .external }
View in SolarFarmer API Reference{ target="_blank" .external }
View in SolarFarmer API Reference{ target="_blank" .external }
::: solarfarmer.version options: extra: show_root_toc_entry: false show_root_members: true
The SDK can be configured using environment variables:
SF_API_KEY: Your SolarFarmer API authentication key (imported from environment)SF_API_URL: Override the default SolarFarmer API URL
You can also pass these values directly as keyword arguments to the endpoint functions.