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.
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Jérémie GRESSIER
3
+ Copyright (c) 2023 Jérémie GRESSIER
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: icalreporting
3
- Version: 0.1.0
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) 2022 Jérémie GRESSIER
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
- cfdtools
49
+ icalreporting
50
50
  -----
51
51
 
52
- [![PyPi Version](https://img.shields.io/pypi/v/cfdtools.svg?style=flat)](https://pypi.org/project/cfdtools)
53
- [![PyPI pyversions](https://img.shields.io/pypi/pyversions/cfdtools.svg?style=flat)](https://pypi.org/pypi/cfdtools/)
54
- [![GitHub stars](https://img.shields.io/github/stars/jgressier/cfdtools.svg?style=flat&logo=github&label=Stars&logoColor=white)](https://github.com/jgressier/cfdtools)
55
- [![PyPi downloads](https://img.shields.io/pypi/dm/cfdtools.svg?style=flat)](https://pypistats.org/packages/cfdtools)
56
- [![codecov](https://img.shields.io/codecov/c/github/jgressier/cfdtools.svg?style=flat)](https://codecov.io/gh/jgressier/cfdtools)
52
+ [![PyPi Version](https://img.shields.io/pypi/v/icalreporting.svg?style=flat)](https://pypi.org/project/icalreporting)
53
+ [![PyPI pyversions](https://img.shields.io/pypi/pyversions/icalreporting.svg?style=flat)](https://pypi.org/pypi/icalreporting/)
54
+ [![GitHub stars](https://img.shields.io/github/stars/jgressier/icalreporting.svg?style=flat&logo=github&label=Stars&logoColor=white)](https://github.com/jgressier/icalreporting)
55
+ [![PyPi downloads](https://img.shields.io/pypi/dm/icalreporting.svg?style=flat)](https://pypistats.org/packages/icalreporting)
56
+ [![codecov](https://img.shields.io/codecov/c/github/jgressier/icalreporting.svg?style=flat)](https://codecov.io/gh/jgressier/icalreporting)
57
57
 
58
- [![Codacy Badge](https://app.codacy.com/project/badge/Grade/d32cf67a5fa242c88bb1568277f1d60e)](https://app.codacy.com/gh/jgressier/cfdtools/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Doc](https://readthedocs.org/projects/cfdtools/badge/?version=latest)](https://readthedocs.org/projects/cfdtools/)
58
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/d32cf67a5fa242c88bb1568277f1d60e)](https://app.codacy.com/gh/jgressier/icalreporting/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Doc](https://readthedocs.org/projects/icalreporting/badge/?version=latest)](https://readthedocs.org/projects/icalreporting/)
59
59
  [![Slack](https://img.shields.io/static/v1?logo=slack&label=slack&message=contact&style=flat)](https://join.slack.com/t/isae-opendev/shared_invite/zt-obqywf6r-UUuHR4_hc5iTzyL5bFCwpw
60
60
  )
61
61
 
62
62
  ### Features
63
63
 
64
- - readers: IC3 (v2, v3), GMSH (v2, v4), CGNS (hdf5)
65
- - writers: IC3 (v2, v3), VTK
66
- - generic options for command line writers: extrusion
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 and usage
68
+ ### Installation
72
69
 
73
70
  ```bash
74
- pip install cfdtools
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/cfdtools/blob/master/requirements.txt)
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
+ [![PyPi Version](https://img.shields.io/pypi/v/icalreporting.svg?style=flat)](https://pypi.org/project/icalreporting)
5
+ [![PyPI pyversions](https://img.shields.io/pypi/pyversions/icalreporting.svg?style=flat)](https://pypi.org/pypi/icalreporting/)
6
+ [![GitHub stars](https://img.shields.io/github/stars/jgressier/icalreporting.svg?style=flat&logo=github&label=Stars&logoColor=white)](https://github.com/jgressier/icalreporting)
7
+ [![PyPi downloads](https://img.shields.io/pypi/dm/icalreporting.svg?style=flat)](https://pypistats.org/packages/icalreporting)
8
+ [![codecov](https://img.shields.io/codecov/c/github/jgressier/icalreporting.svg?style=flat)](https://codecov.io/gh/jgressier/icalreporting)
9
+
10
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/d32cf67a5fa242c88bb1568277f1d60e)](https://app.codacy.com/gh/jgressier/icalreporting/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Doc](https://readthedocs.org/projects/icalreporting/badge/?version=latest)](https://readthedocs.org/projects/icalreporting/)
11
+ [![Slack](https://img.shields.io/static/v1?logo=slack&label=slack&message=contact&style=flat)](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 = "2020-01-01", end: str = "2030-01-01", default_WP="No_WP"
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
- # print(Path(self._folder), Path(self._folder).exists(), Path(self._folder).is_dir())
60
- # print(list(Path(self._folder).glob("*.ics")))
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/projetA", start="2023-01-01", end="2024-01-01")
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.0
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) 2022 Jérémie GRESSIER
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
- cfdtools
49
+ icalreporting
50
50
  -----
51
51
 
52
- [![PyPi Version](https://img.shields.io/pypi/v/cfdtools.svg?style=flat)](https://pypi.org/project/cfdtools)
53
- [![PyPI pyversions](https://img.shields.io/pypi/pyversions/cfdtools.svg?style=flat)](https://pypi.org/pypi/cfdtools/)
54
- [![GitHub stars](https://img.shields.io/github/stars/jgressier/cfdtools.svg?style=flat&logo=github&label=Stars&logoColor=white)](https://github.com/jgressier/cfdtools)
55
- [![PyPi downloads](https://img.shields.io/pypi/dm/cfdtools.svg?style=flat)](https://pypistats.org/packages/cfdtools)
56
- [![codecov](https://img.shields.io/codecov/c/github/jgressier/cfdtools.svg?style=flat)](https://codecov.io/gh/jgressier/cfdtools)
52
+ [![PyPi Version](https://img.shields.io/pypi/v/icalreporting.svg?style=flat)](https://pypi.org/project/icalreporting)
53
+ [![PyPI pyversions](https://img.shields.io/pypi/pyversions/icalreporting.svg?style=flat)](https://pypi.org/pypi/icalreporting/)
54
+ [![GitHub stars](https://img.shields.io/github/stars/jgressier/icalreporting.svg?style=flat&logo=github&label=Stars&logoColor=white)](https://github.com/jgressier/icalreporting)
55
+ [![PyPi downloads](https://img.shields.io/pypi/dm/icalreporting.svg?style=flat)](https://pypistats.org/packages/icalreporting)
56
+ [![codecov](https://img.shields.io/codecov/c/github/jgressier/icalreporting.svg?style=flat)](https://codecov.io/gh/jgressier/icalreporting)
57
57
 
58
- [![Codacy Badge](https://app.codacy.com/project/badge/Grade/d32cf67a5fa242c88bb1568277f1d60e)](https://app.codacy.com/gh/jgressier/cfdtools/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Doc](https://readthedocs.org/projects/cfdtools/badge/?version=latest)](https://readthedocs.org/projects/cfdtools/)
58
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/d32cf67a5fa242c88bb1568277f1d60e)](https://app.codacy.com/gh/jgressier/icalreporting/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Doc](https://readthedocs.org/projects/icalreporting/badge/?version=latest)](https://readthedocs.org/projects/icalreporting/)
59
59
  [![Slack](https://img.shields.io/static/v1?logo=slack&label=slack&message=contact&style=flat)](https://join.slack.com/t/isae-opendev/shared_invite/zt-obqywf6r-UUuHR4_hc5iTzyL5bFCwpw
60
60
  )
61
61
 
62
62
  ### Features
63
63
 
64
- - readers: IC3 (v2, v3), GMSH (v2, v4), CGNS (hdf5)
65
- - writers: IC3 (v2, v3), VTK
66
- - generic options for command line writers: extrusion
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 and usage
68
+ ### Installation
72
69
 
73
70
  ```bash
74
- pip install cfdtools
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/cfdtools/blob/master/requirements.txt)
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
+ ```
@@ -7,4 +7,5 @@ icalreporting.egg-info/PKG-INFO
7
7
  icalreporting.egg-info/SOURCES.txt
8
8
  icalreporting.egg-info/dependency_links.txt
9
9
  icalreporting.egg-info/requires.txt
10
- icalreporting.egg-info/top_level.txt
10
+ icalreporting.egg-info/top_level.txt
11
+ tests/test_icalimport.py
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "icalreporting"
3
- version = "0.1.0"
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.0"
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
@@ -1,31 +0,0 @@
1
- cfdtools
2
- -----
3
-
4
- [![PyPi Version](https://img.shields.io/pypi/v/cfdtools.svg?style=flat)](https://pypi.org/project/cfdtools)
5
- [![PyPI pyversions](https://img.shields.io/pypi/pyversions/cfdtools.svg?style=flat)](https://pypi.org/pypi/cfdtools/)
6
- [![GitHub stars](https://img.shields.io/github/stars/jgressier/cfdtools.svg?style=flat&logo=github&label=Stars&logoColor=white)](https://github.com/jgressier/cfdtools)
7
- [![PyPi downloads](https://img.shields.io/pypi/dm/cfdtools.svg?style=flat)](https://pypistats.org/packages/cfdtools)
8
- [![codecov](https://img.shields.io/codecov/c/github/jgressier/cfdtools.svg?style=flat)](https://codecov.io/gh/jgressier/cfdtools)
9
-
10
- [![Codacy Badge](https://app.codacy.com/project/badge/Grade/d32cf67a5fa242c88bb1568277f1d60e)](https://app.codacy.com/gh/jgressier/cfdtools/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![Doc](https://readthedocs.org/projects/cfdtools/badge/?version=latest)](https://readthedocs.org/projects/cfdtools/)
11
- [![Slack](https://img.shields.io/static/v1?logo=slack&label=slack&message=contact&style=flat)](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