icalreporting 0.1.2__tar.gz → 0.1.3__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.2 → icalreporting-0.1.3}/PKG-INFO +1 -1
- icalreporting-0.1.3/icalreporting/__init__.py +1 -0
- {icalreporting-0.1.2 → icalreporting-0.1.3}/icalreporting/reporting.py +9 -3
- {icalreporting-0.1.2 → icalreporting-0.1.3}/icalreporting.egg-info/PKG-INFO +1 -1
- {icalreporting-0.1.2 → icalreporting-0.1.3}/pyproject.toml +2 -2
- icalreporting-0.1.3/tests/test_icalimport.py +34 -0
- icalreporting-0.1.2/icalreporting/__init__.py +0 -1
- icalreporting-0.1.2/tests/test_icalimport.py +0 -16
- {icalreporting-0.1.2 → icalreporting-0.1.3}/LICENSE +0 -0
- {icalreporting-0.1.2 → icalreporting-0.1.3}/README.md +0 -0
- {icalreporting-0.1.2 → icalreporting-0.1.3}/icalreporting.egg-info/SOURCES.txt +0 -0
- {icalreporting-0.1.2 → icalreporting-0.1.3}/icalreporting.egg-info/dependency_links.txt +0 -0
- {icalreporting-0.1.2 → icalreporting-0.1.3}/icalreporting.egg-info/requires.txt +0 -0
- {icalreporting-0.1.2 → icalreporting-0.1.3}/icalreporting.egg-info/top_level.txt +0 -0
- {icalreporting-0.1.2 → icalreporting-0.1.3}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.3"
|
|
@@ -57,6 +57,9 @@ def ical_to_dframe(filename: Path, startdate: datetime, enddate: datetime):
|
|
|
57
57
|
class Project():
|
|
58
58
|
"""Class Project, can read ICAL file, define tags and create worksheet
|
|
59
59
|
"""
|
|
60
|
+
|
|
61
|
+
_WP_model = r"WP[0-9]*[A-Z]*"
|
|
62
|
+
|
|
60
63
|
def __init__(
|
|
61
64
|
self, name: str, folder=None, start: str = _default_startdate, end: str = _default_enddate, default_WP="No_WP"
|
|
62
65
|
):
|
|
@@ -70,6 +73,7 @@ class Project():
|
|
|
70
73
|
print(f" will include {self._start.date()} to {self._end.date()} (not included)")
|
|
71
74
|
|
|
72
75
|
def load_ics(self):
|
|
76
|
+
"""load ICS fils and create pandas dataframe associated to member"""
|
|
73
77
|
framedict = {}
|
|
74
78
|
filelist = list(Path(self._folder).glob("*.ics"))
|
|
75
79
|
for filename in filelist:
|
|
@@ -103,12 +107,13 @@ class Project():
|
|
|
103
107
|
return slot
|
|
104
108
|
|
|
105
109
|
def _set_wp(self, default=None):
|
|
106
|
-
|
|
110
|
+
"""set WP properties using regexp in event name"""
|
|
111
|
+
rewp = re.compile(self._WP_model)
|
|
107
112
|
self._dframe["WP"] = self._dframe["name"].apply(lambda s: rewp.findall(s))
|
|
108
113
|
self._dframe["WP"] = self._dframe["WP"].apply(lambda wplist: wplist[0] if wplist else default)
|
|
109
114
|
|
|
110
115
|
def _clean_wp(self):
|
|
111
|
-
rewp = re.compile(r"
|
|
116
|
+
rewp = re.compile(self._WP_model + r". *-* *")
|
|
112
117
|
self._dframe["name"] = self._dframe["name"].apply(lambda s: rewp.sub("", s))
|
|
113
118
|
return
|
|
114
119
|
|
|
@@ -128,7 +133,8 @@ class Project():
|
|
|
128
133
|
dfwp = self._dframe[self._dframe["WP"] == wp].loc[
|
|
129
134
|
:, ["date", "Member", "duration", "WP", "name", "year", "month"]
|
|
130
135
|
]
|
|
131
|
-
|
|
136
|
+
monthformat = lambda m : f"{m:02}"
|
|
137
|
+
dfwp["YearMonth"] = dfwp.year.map(str) + "-" + dfwp.month.map(monthformat)
|
|
132
138
|
dfpiv = dfwp.pivot_table(
|
|
133
139
|
values="duration", index="Member", columns="YearMonth", aggfunc="sum"
|
|
134
140
|
).fillna(0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "icalreporting"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.3"
|
|
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.3"
|
|
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,34 @@
|
|
|
1
|
+
import icalreporting.reporting as ir
|
|
2
|
+
from datetime import datetime, timedelta
|
|
3
|
+
|
|
4
|
+
def test_init():
|
|
5
|
+
prjname = "my_original_name"
|
|
6
|
+
path = "examples/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_open():
|
|
16
|
+
prjname = "my_original_name"
|
|
17
|
+
path = "examples/ProjectA"
|
|
18
|
+
project = ir.Project(name=prjname, folder=path)
|
|
19
|
+
project.load_ics()
|
|
20
|
+
assert len(project.members()) == 2
|
|
21
|
+
assert len(project.work_packages()) == 6
|
|
22
|
+
|
|
23
|
+
def test_properties():
|
|
24
|
+
prjname = "my_original_name"
|
|
25
|
+
path = "examples/ProjectA"
|
|
26
|
+
project = ir.Project(name=prjname, folder=path)
|
|
27
|
+
project.load_ics()
|
|
28
|
+
|
|
29
|
+
def test_write_workbook():
|
|
30
|
+
prjname = "my_original_name"
|
|
31
|
+
path = "examples/ProjectA"
|
|
32
|
+
project = ir.Project(name=prjname, folder=path)
|
|
33
|
+
project.load_ics()
|
|
34
|
+
wb = project.workbook()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.2"
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|