icalreporting 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {icalreporting-0.1.0 → icalreporting-0.1.2}/LICENSE +1 -1
- {icalreporting-0.1.0 → icalreporting-0.1.2}/PKG-INFO +28 -18
- icalreporting-0.1.2/README.md +41 -0
- icalreporting-0.1.2/icalreporting/__init__.py +1 -0
- {icalreporting-0.1.0 → icalreporting-0.1.2}/icalreporting/reporting.py +26 -7
- {icalreporting-0.1.0 → icalreporting-0.1.2}/icalreporting.egg-info/PKG-INFO +28 -18
- {icalreporting-0.1.0 → icalreporting-0.1.2}/icalreporting.egg-info/SOURCES.txt +2 -1
- {icalreporting-0.1.0 → icalreporting-0.1.2}/pyproject.toml +2 -2
- icalreporting-0.1.2/tests/test_icalimport.py +16 -0
- icalreporting-0.1.0/README.md +0 -31
- icalreporting-0.1.0/icalreporting/__init__.py +0 -1
- {icalreporting-0.1.0 → icalreporting-0.1.2}/icalreporting.egg-info/dependency_links.txt +0 -0
- {icalreporting-0.1.0 → icalreporting-0.1.2}/icalreporting.egg-info/requires.txt +0 -0
- {icalreporting-0.1.0 → icalreporting-0.1.2}/icalreporting.egg-info/top_level.txt +0 -0
- {icalreporting-0.1.0 → icalreporting-0.1.2}/setup.cfg +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: icalreporting
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Reporting tools from ical files
|
|
5
5
|
Author-email: "J. Gressier" <jeremie.gressier@isae-supaero.fr>
|
|
6
6
|
License: MIT License
|
|
7
7
|
|
|
8
|
-
Copyright (c)
|
|
8
|
+
Copyright (c) 2023 Jérémie GRESSIER
|
|
9
9
|
|
|
10
10
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
11
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -46,34 +46,44 @@ Requires-Dist: pytest>=6.0; extra == "dev"
|
|
|
46
46
|
Requires-Dist: pytest-cov>=2.11.1; extra == "dev"
|
|
47
47
|
Requires-Dist: pylint>=2.6.0; extra == "dev"
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
icalreporting
|
|
50
50
|
-----
|
|
51
51
|
|
|
52
|
-
[](https://pypi.org/project/icalreporting)
|
|
53
|
+
[](https://pypi.org/pypi/icalreporting/)
|
|
54
|
+
[](https://github.com/jgressier/icalreporting)
|
|
55
|
+
[](https://pypistats.org/packages/icalreporting)
|
|
56
|
+
[](https://codecov.io/gh/jgressier/icalreporting)
|
|
57
57
|
|
|
58
|
-
[](https://app.codacy.com/gh/jgressier/
|
|
58
|
+
[](https://app.codacy.com/gh/jgressier/icalreporting/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[](https://readthedocs.org/projects/icalreporting/)
|
|
59
59
|
[](https://join.slack.com/t/isae-opendev/shared_invite/zt-obqywf6r-UUuHR4_hc5iTzyL5bFCwpw
|
|
60
60
|
)
|
|
61
61
|
|
|
62
62
|
### Features
|
|
63
63
|
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
- generic format command line: `cfdinfo`, `cfdwrite_ic3v3`
|
|
68
|
-
- specific IC3 command line: `ic3brief`
|
|
69
|
-
- specific VTK command line: `vtkbrief`, `vtkpack`
|
|
64
|
+
- able to load ical files and fill a pandas database
|
|
65
|
+
- parse the pandas database to identify project and creates a worksheet tables
|
|
66
|
+
- export to open document XLSX file
|
|
70
67
|
|
|
71
|
-
### Installation
|
|
68
|
+
### Installation
|
|
72
69
|
|
|
73
70
|
```bash
|
|
74
|
-
pip install
|
|
71
|
+
pip install --upgrade icalreporting
|
|
75
72
|
```
|
|
73
|
+
This automatic installation will get needed dependencies.
|
|
76
74
|
|
|
77
75
|
### Requirements
|
|
78
76
|
|
|
79
|
-
see [requirements.txt](https://github.com/jgressier/
|
|
77
|
+
see [requirements.txt](https://github.com/jgressier/icalreporting/blob/master/requirements.txt)
|
|
78
|
+
|
|
79
|
+
### Usage
|
|
80
|
+
|
|
81
|
+
When installed, you just need to put a set a ical files in a folder for a project. You will be able to create a reporting file with the following lines.
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from icalreporting.reporting import Project
|
|
85
|
+
prj = Project(name="Big-Project", folder="examples/projectA", start="2023-01-01", end="2024-01-01")
|
|
86
|
+
prj.load_ics() # read files
|
|
87
|
+
wb = prj.workbook() # create workbook
|
|
88
|
+
wb.save("projectA.xlsx") # save it to file
|
|
89
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
icalreporting
|
|
2
|
+
-----
|
|
3
|
+
|
|
4
|
+
[](https://pypi.org/project/icalreporting)
|
|
5
|
+
[](https://pypi.org/pypi/icalreporting/)
|
|
6
|
+
[](https://github.com/jgressier/icalreporting)
|
|
7
|
+
[](https://pypistats.org/packages/icalreporting)
|
|
8
|
+
[](https://codecov.io/gh/jgressier/icalreporting)
|
|
9
|
+
|
|
10
|
+
[](https://app.codacy.com/gh/jgressier/icalreporting/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[](https://readthedocs.org/projects/icalreporting/)
|
|
11
|
+
[](https://join.slack.com/t/isae-opendev/shared_invite/zt-obqywf6r-UUuHR4_hc5iTzyL5bFCwpw
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- able to load ical files and fill a pandas database
|
|
17
|
+
- parse the pandas database to identify project and creates a worksheet tables
|
|
18
|
+
- export to open document XLSX file
|
|
19
|
+
|
|
20
|
+
### Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install --upgrade icalreporting
|
|
24
|
+
```
|
|
25
|
+
This automatic installation will get needed dependencies.
|
|
26
|
+
|
|
27
|
+
### Requirements
|
|
28
|
+
|
|
29
|
+
see [requirements.txt](https://github.com/jgressier/icalreporting/blob/master/requirements.txt)
|
|
30
|
+
|
|
31
|
+
### Usage
|
|
32
|
+
|
|
33
|
+
When installed, you just need to put a set a ical files in a folder for a project. You will be able to create a reporting file with the following lines.
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from icalreporting.reporting import Project
|
|
37
|
+
prj = Project(name="Big-Project", folder="examples/projectA", start="2023-01-01", end="2024-01-01")
|
|
38
|
+
prj.load_ics() # read files
|
|
39
|
+
wb = prj.workbook() # create workbook
|
|
40
|
+
wb.save("projectA.xlsx") # save it to file
|
|
41
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.2"
|
|
@@ -20,8 +20,21 @@ from pathlib import Path
|
|
|
20
20
|
import openpyxl as xl
|
|
21
21
|
from openpyxl.utils.dataframe import dataframe_to_rows
|
|
22
22
|
|
|
23
|
+
_default_startdate = "2020-01-01"
|
|
24
|
+
_default_enddate = "2030-01-01"
|
|
23
25
|
|
|
24
26
|
def ical_to_dframe(filename: Path, startdate: datetime, enddate: datetime):
|
|
27
|
+
"""read a file in ICAL format and create events between 2 dates
|
|
28
|
+
can handle recurrent events
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
filename (Path): path name of ICAL file
|
|
32
|
+
startdate (datetime): starting date for events
|
|
33
|
+
enddate (datetime): ending date (included) for events
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
DataFrame: as member of the class (date, year, month, h_begin, duration, name, description, begin) properties
|
|
37
|
+
"""
|
|
25
38
|
with filename.open() as ics_file:
|
|
26
39
|
calendar = IcsCalendarStream.calendar_from_ics(ics_file.read())
|
|
27
40
|
return pd.DataFrame(
|
|
@@ -41,9 +54,11 @@ def ical_to_dframe(filename: Path, startdate: datetime, enddate: datetime):
|
|
|
41
54
|
)
|
|
42
55
|
|
|
43
56
|
|
|
44
|
-
class Project:
|
|
57
|
+
class Project():
|
|
58
|
+
"""Class Project, can read ICAL file, define tags and create worksheet
|
|
59
|
+
"""
|
|
45
60
|
def __init__(
|
|
46
|
-
self, name: str, folder=None, start: str =
|
|
61
|
+
self, name: str, folder=None, start: str = _default_startdate, end: str = _default_enddate, default_WP="No_WP"
|
|
47
62
|
):
|
|
48
63
|
self._name = name
|
|
49
64
|
self._folder = name if folder is None else folder
|
|
@@ -52,24 +67,27 @@ class Project:
|
|
|
52
67
|
self._default_WP = default_WP
|
|
53
68
|
print(self._end)
|
|
54
69
|
print(f"> init project {self._name} in folder {self._folder}")
|
|
55
|
-
print(f" will include {self._start.date()} to {self._end.date()}")
|
|
70
|
+
print(f" will include {self._start.date()} to {self._end.date()} (not included)")
|
|
56
71
|
|
|
57
72
|
def load_ics(self):
|
|
58
73
|
framedict = {}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
for filename in list(Path(self._folder).glob("*.ics")):
|
|
74
|
+
filelist = list(Path(self._folder).glob("*.ics"))
|
|
75
|
+
for filename in filelist:
|
|
62
76
|
print(f"- reading {filename}")
|
|
63
77
|
framedict[filename.stem] = ical_to_dframe(filename, self._start, self._end)
|
|
64
78
|
framedict[filename.stem]["Member"] = filename.stem # file name without path nor extension
|
|
79
|
+
if len(filelist) == 0:
|
|
80
|
+
raise FileNotFoundError("no *.ics file found")
|
|
65
81
|
self._dframe = pd.concat(tuple(framedict.values()))
|
|
66
82
|
self._set_wp(default=self._default_WP)
|
|
67
83
|
self._clean_wp()
|
|
68
84
|
|
|
69
85
|
def members(self):
|
|
86
|
+
"""returns set (unordered list) of members"""
|
|
70
87
|
return set(self._dframe["Member"])
|
|
71
88
|
|
|
72
89
|
def work_packages(self):
|
|
90
|
+
"""returns set (unordered list) of Work Packages"""
|
|
73
91
|
return set(self._dframe["WP"])
|
|
74
92
|
|
|
75
93
|
def _df_to_tab(self, wb: xl.Workbook, df, title=None):
|
|
@@ -95,6 +113,7 @@ class Project:
|
|
|
95
113
|
return
|
|
96
114
|
|
|
97
115
|
def filter(self, start: str, end: str):
|
|
116
|
+
"""replace DataFrame with selected dates"""
|
|
98
117
|
self._dframe = self._df_slot(start, end)
|
|
99
118
|
|
|
100
119
|
def add_tabdetail_member(self, wb, member: str):
|
|
@@ -140,7 +159,7 @@ class Project:
|
|
|
140
159
|
|
|
141
160
|
|
|
142
161
|
if __name__ == "__main__":
|
|
143
|
-
prj = Project(name="mambo", folder="examples/
|
|
162
|
+
prj = Project(name="mambo", folder="examples/projectA", start="2023-01-01", end="2024-01-01")
|
|
144
163
|
prj.load_ics() # lecture des .ics
|
|
145
164
|
# prj.filter(start="2023-01-01", end="2023-12-31") # filtre des dates
|
|
146
165
|
wb = prj.workbook() # création du tableur
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: icalreporting
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Reporting tools from ical files
|
|
5
5
|
Author-email: "J. Gressier" <jeremie.gressier@isae-supaero.fr>
|
|
6
6
|
License: MIT License
|
|
7
7
|
|
|
8
|
-
Copyright (c)
|
|
8
|
+
Copyright (c) 2023 Jérémie GRESSIER
|
|
9
9
|
|
|
10
10
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
11
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -46,34 +46,44 @@ Requires-Dist: pytest>=6.0; extra == "dev"
|
|
|
46
46
|
Requires-Dist: pytest-cov>=2.11.1; extra == "dev"
|
|
47
47
|
Requires-Dist: pylint>=2.6.0; extra == "dev"
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
icalreporting
|
|
50
50
|
-----
|
|
51
51
|
|
|
52
|
-
[](https://pypi.org/project/icalreporting)
|
|
53
|
+
[](https://pypi.org/pypi/icalreporting/)
|
|
54
|
+
[](https://github.com/jgressier/icalreporting)
|
|
55
|
+
[](https://pypistats.org/packages/icalreporting)
|
|
56
|
+
[](https://codecov.io/gh/jgressier/icalreporting)
|
|
57
57
|
|
|
58
|
-
[](https://app.codacy.com/gh/jgressier/
|
|
58
|
+
[](https://app.codacy.com/gh/jgressier/icalreporting/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[](https://readthedocs.org/projects/icalreporting/)
|
|
59
59
|
[](https://join.slack.com/t/isae-opendev/shared_invite/zt-obqywf6r-UUuHR4_hc5iTzyL5bFCwpw
|
|
60
60
|
)
|
|
61
61
|
|
|
62
62
|
### Features
|
|
63
63
|
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
- generic format command line: `cfdinfo`, `cfdwrite_ic3v3`
|
|
68
|
-
- specific IC3 command line: `ic3brief`
|
|
69
|
-
- specific VTK command line: `vtkbrief`, `vtkpack`
|
|
64
|
+
- able to load ical files and fill a pandas database
|
|
65
|
+
- parse the pandas database to identify project and creates a worksheet tables
|
|
66
|
+
- export to open document XLSX file
|
|
70
67
|
|
|
71
|
-
### Installation
|
|
68
|
+
### Installation
|
|
72
69
|
|
|
73
70
|
```bash
|
|
74
|
-
pip install
|
|
71
|
+
pip install --upgrade icalreporting
|
|
75
72
|
```
|
|
73
|
+
This automatic installation will get needed dependencies.
|
|
76
74
|
|
|
77
75
|
### Requirements
|
|
78
76
|
|
|
79
|
-
see [requirements.txt](https://github.com/jgressier/
|
|
77
|
+
see [requirements.txt](https://github.com/jgressier/icalreporting/blob/master/requirements.txt)
|
|
78
|
+
|
|
79
|
+
### Usage
|
|
80
|
+
|
|
81
|
+
When installed, you just need to put a set a ical files in a folder for a project. You will be able to create a reporting file with the following lines.
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from icalreporting.reporting import Project
|
|
85
|
+
prj = Project(name="Big-Project", folder="examples/projectA", start="2023-01-01", end="2024-01-01")
|
|
86
|
+
prj.load_ics() # read files
|
|
87
|
+
wb = prj.workbook() # create workbook
|
|
88
|
+
wb.save("projectA.xlsx") # save it to file
|
|
89
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "icalreporting"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.2"
|
|
4
4
|
description = "Reporting tools from ical files"
|
|
5
5
|
authors = [{name="J. Gressier", email="jeremie.gressier@isae-supaero.fr"}]
|
|
6
6
|
readme = "README.md"
|
|
@@ -45,7 +45,7 @@ testpaths = [
|
|
|
45
45
|
]
|
|
46
46
|
|
|
47
47
|
[tool.bumpver]
|
|
48
|
-
current_version = "v0.1.
|
|
48
|
+
current_version = "v0.1.2"
|
|
49
49
|
version_pattern = "vMAJOR.MINOR.PATCH"
|
|
50
50
|
commit_message = "bump version {old_version} to {new_version}"
|
|
51
51
|
commit = true
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import icalreporting.reporting as ir
|
|
2
|
+
from datetime import datetime, timedelta
|
|
3
|
+
|
|
4
|
+
def test_open():
|
|
5
|
+
prjname = "my_original_name"
|
|
6
|
+
path = "example/ProjectA"
|
|
7
|
+
project = ir.Project(name=prjname, folder=path)
|
|
8
|
+
assert project._name == prjname
|
|
9
|
+
assert project._folder == path
|
|
10
|
+
for d in (project._start, project._end):
|
|
11
|
+
assert isinstance(d, datetime)
|
|
12
|
+
assert project._start.date().isoformat() == ir._default_startdate
|
|
13
|
+
assert (project._end-timedelta(days=1)).date().isoformat() == ir._default_enddate
|
|
14
|
+
|
|
15
|
+
def test_properties():
|
|
16
|
+
assert True
|
icalreporting-0.1.0/README.md
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
cfdtools
|
|
2
|
-
-----
|
|
3
|
-
|
|
4
|
-
[](https://pypi.org/project/cfdtools)
|
|
5
|
-
[](https://pypi.org/pypi/cfdtools/)
|
|
6
|
-
[](https://github.com/jgressier/cfdtools)
|
|
7
|
-
[](https://pypistats.org/packages/cfdtools)
|
|
8
|
-
[](https://codecov.io/gh/jgressier/cfdtools)
|
|
9
|
-
|
|
10
|
-
[](https://app.codacy.com/gh/jgressier/cfdtools/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[](https://readthedocs.org/projects/cfdtools/)
|
|
11
|
-
[](https://join.slack.com/t/isae-opendev/shared_invite/zt-obqywf6r-UUuHR4_hc5iTzyL5bFCwpw
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
### Features
|
|
15
|
-
|
|
16
|
-
- readers: IC3 (v2, v3), GMSH (v2, v4), CGNS (hdf5)
|
|
17
|
-
- writers: IC3 (v2, v3), VTK
|
|
18
|
-
- generic options for command line writers: extrusion
|
|
19
|
-
- generic format command line: `cfdinfo`, `cfdwrite_ic3v3`
|
|
20
|
-
- specific IC3 command line: `ic3brief`
|
|
21
|
-
- specific VTK command line: `vtkbrief`, `vtkpack`
|
|
22
|
-
|
|
23
|
-
### Installation and usage
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
pip install cfdtools
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### Requirements
|
|
30
|
-
|
|
31
|
-
see [requirements.txt](https://github.com/jgressier/cfdtools/blob/master/requirements.txt)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|