Metadata-Version: 2.4
Name: icalreporting
Version: 0.4.0
Summary: Reporting tools from ical files
Author-email: "J. Gressier" <jeremie.gressier@isae-supaero.fr>
License: MIT License
        
        Copyright (c) 2023 Jérémie GRESSIER
        
        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/jgressier/icalreporting
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=2.1
Requires-Dist: openpyxl>=3.1
Requires-Dist: ical>=4.5
Requires-Dist: icalendar
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov>=2.11.1; extra == "dev"
Requires-Dist: pylint>=2.6.0; extra == "dev"
Dynamic: license-file

# icalreporting

[![PyPI version](https://img.shields.io/pypi/v/icalreporting.svg?style=flat)](https://pypi.org/project/icalreporting)
[![Python versions](https://img.shields.io/pypi/pyversions/icalreporting.svg?style=flat)](https://pypi.org/project/icalreporting)
[![Coverage](https://img.shields.io/codecov/c/github/jgressier/icalreporting.svg?style=flat)](https://codecov.io/gh/jgressier/icalreporting)

`icalreporting` converts iCalendar (`.ics`) files into pandas-based activity reports and Excel
workbooks. It expands recurring events and treats each ICS filename stem as a project member.

## Installation

Requires Python 3.9 or later.

```bash
pip install --upgrade icalreporting
```

## Project report

Place one ICS file per member in a directory. Work-package tags such as `WP2` are read from
event summaries.

```python
from icalreporting.reporting import Project

project = Project(
    name="Big Project",
    folder="calendars",
    start="2023-01-01",
    end="2023-12-31",
)
project.load_ics()
project.workbook().save("report.xlsx")
```

The workbook contains a global summary, member details, and monthly work-package totals.
All-day events are reported as 8-hour working days starting at 09:00.

`Hyperplanning` provides the same workflow for course calendars, grouped by course and
teaching type.

## Individual weekly report

`IndividualReporting` expects one calendar whose summaries follow
`SECTOR/SUBSECTOR optional comment`.

```python
from icalreporting.reporting import IndividualReporting

report = IndividualReporting("My activity", "examples/indiv-reporting")
report.load_ics()  # overlaps are corrected by shortening the first event
report.workbook().save("individual-report.xlsx")
```

Weeks run Sunday–Saturday. The workbook puts totals first, groups detail columns by sector then
subsector, and lists excluded malformed summaries in an `Unclassified` tab. It also reports hours
outside Monday–Friday 07:00–19:00. 

## Miscellaneous tools available through Command line

```bash
icalcheck calendar.ics
icalclean calendar.ics  # writes calendar.cleaned.ics

# One ICS file per project member
icalproject calendars project-report.xlsx --start 2023-01-01 --end 2023-12-31

# Exactly one ICS file, with SECTOR/SUBSECTOR summaries
icalindividual my-calendar individual-report.xlsx
```

## Development

```bash
pip install -e ".[dev]"
pytest
```

Released under the MIT License.
