Metadata-Version: 2.4
Name: solar-plant-dgr
Version: 0.1.0
Summary: A Python library for Solar Plant Daily Generation Report (DGR) calculations and performance analysis.
Author: Harshit Chouhan
License: MIT License
        
        Copyright (c) 2026 Harshit Chouhan
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/harshitchouhan2/Solar-Plant-DGR
Project-URL: Repository, https://github.com/harshitchouhan2/Solar-Plant-DGR
Project-URL: Issues, https://github.com/harshitchouhan2/Solar-Plant-DGR/issues
Keywords: solar,solar-energy,solar-plant,solar-power,solar-power-plant,dgr,daily-generation-report,cuf,performance-ratio,specific-yield,renewable-energy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Solar Plant DGR

This is a lightweight Python library for calculating key performance indicators used in Solar Power Plant Daily Generation Reports (DGR).

Solar Plant DGR provides reusable functions for plant-level and inverter-level solar performance calculations such as Performance Ratio (PR), AC CUF, DC CUF, Specific Yield, inverter performance, expected generation, availability, generation deviation, and DC/AC ratio.

This repository have prebuild functions which will help you creating DGR Report in SCADA

## Installation
Install the package from PyPI:

```bash
pip install solar-plant-dgr
```

## Quick Start

```python
from Solar_Plant_DGR import DGR

```

## Features

* Performance Ratio (PR)
* AC Capacity Utilization Factor (AC CUF)
* DC Capacity Utilization Factor (DC CUF)
* Plant Specific Yield
* Inverter-wise Specific Yield
* Inverter-wise Performance Ratio
* Expected Generation
* Generation from meter readings
* Plant internal generation difference
* Cumulative radiation
* Generation deviation
* Grid availability
* Plant availability
* DC/AC ratio
* Basic input validation
* Integer and floating-point input support

## DGR Class

The main class provided by the package is:

```python
from Solar_Plant_DGR import DGR
```

### Constructor

```python
DGR(
    plant_ac_capactity=0.0,
    plant_dc_capactity=0.0,
    generation=0.0,
    poa_radiation=0.0,
    inv_generation=None,
    inv_dc_cap=None
)
```

### Parameters

| Parameter            | Type           | Description                 |
| -------------------- | -------------- | --------------------------- |
| `plant_ac_capactity` | `int \| float` | Installed AC plant capacity |
| `plant_dc_capactity` | `int \| float` | Installed DC plant capacity |
| `generation`         | `int \| float` | Plant generation            |
| `poa_radiation`      | `int \| float` | Plane of Array radiation    |
| `inv_generation`     | `dict`         | Inverter-wise generation    |
| `inv_dc_cap`         | `dict`         | Inverter-wise DC capacity   |

## Units used

The primary units used by the library are:

| Parameter             | Unit    |
| --------------------- | ------- |
| DC Installed Capacity | kWp     |
| DC Power              | kW      |
| POA/GTI/GHI           | Kwh/m2  |
| DC Voltage            | V       |
| DC Current            | A       |
| Frequency             | Hz      |
| Cabinet Temperature   | °C      |
| Specific Yield        | kWh/kWp |
| Energy Till Date      | MWh     |
| Voltage               | V       |
| Current               | A       |
| Today's Energy        | kWh     |
| Active Power          | kW      |
| AC Power Percent      | %       |
| Reactive Power        | kVAR    |
| Temperature           | °C      |
| Specific Power        | kW/kWp  |
| PR                    | %       |
| DC CUF                | %       |
| AC CUF                | %       |

## Input Validation

The library provides:

```python
dg.validate()
```

The validation function checks:

* AC capacity
* DC capacity
* Plant generation
* POA radiation
* Inverter generation dictionary
* Inverter DC capacity dictionary

AC capacity, DC capacity, and POA radiation must be greater than zero for calculations that require them.

## Project Structure

```text
Solar-Plant-DGR/
│
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── Solar_Plant_DGR/
│   ├── __init__.py
│   └── dgr.py
├── pyproject.toml
├── requirements.txt
└── test.py
```

## Development

Clone the repository:

```bash
git clone https://github.com/harshitchouhan2/Solar-Plant-DGR.git
cd Solar-Plant-DGR
```
## Version

Current version:

```text
0.1.0
```

This is the initial Alpha release.

## Roadmap

Future versions may include:

* Inverter availability
* Inverter loss analysis
* Grid loss calculation
* Curtailment loss calculation
* Advanced generation loss analysis
* Weather-based analysis
* Temperature derating
* Reactive power calculations
* Power factor analysis
* SCADA data analysis
* Automated DGR reporting

## License

This project is licensed under the MIT License.

See [LICENSE](LICENSE) for details.

## Author

**Harshit Chouhan**

Solar Energy Engineer | Python Developer

GitHub: https://github.com/harshitchouhan2

## Disclaimer

This library is intended to provide calculation utilities for solar plant analysis and reporting.

Users should verify calculations against their plant's engineering standards, contractual definitions, equipment specifications, and applicable reporting requirements before using the results for official or commercial reporting.
