ckanapi-harvesters 0.0.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 ifpen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.4
2
+ Name: ckanapi_harvesters
3
+ Version: 0.0.0
4
+ Summary: Adaptation of the template for github.
5
+ License: MIT License
6
+
7
+ Copyright (c) 2024 ifpen
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
26
+
27
+ Classifier: Programming Language :: Python :: 3.12
28
+ Classifier: License :: OSI Approved :: MIT License
29
+ Classifier: Operating System :: OS Independent
30
+ Requires-Python: >=3.12
31
+ Description-Content-Type: text/markdown
32
+ Requires-Dist: pytest==8.0.1
33
+
34
+ # ckanapi_harvesters
35
+
36
+ ---
37
+
38
+ ## Description
39
+
40
+ This "Python Package" template is a complete template designed to create a Python package according to IFPEN's development standards, deployable internally within IFPEN or on the Cloud. This template provides developers with a Python project architecture in which they can contribute, document, and make it available to all IFPEN developers.
41
+
42
+ This package includes:
43
+ - A unit test structure based on the [Pytest](https://docs.pytest.org/en/stable/) library
44
+ - Automatic documentation generation based on the [Sphinx](https://www.sphinx-doc.org/en/master/) library
45
+ - A CI/CD pipeline for deploying the Python package to a Python server
46
+
47
+ ## Github Pages
48
+
49
+ Your automaticly generated documentation (with Sphinx) is [Here](https://mobidec.github.io/ckanapi_harvesters/)
50
+
51
+ ## Python Package Template Architecture
52
+
53
+
54
+ ```
55
+ .
56
+ ├── sphinx
57
+ │ ├── conf.py
58
+ │ │ └── Sphinx documentation configuration file
59
+ │ └── index.rst
60
+ │ └── Root file for Sphinx documentation, structuring and linking source documents into complete documentation.
61
+ ├── src
62
+ │ └── ckanapi_harvesters
63
+ │ ├── __init__.py
64
+ │ ├── main.py
65
+ │ │ └── Main file of your package, it references what is usable in your package
66
+ │ └── module_name
67
+ │ ├── __init__.py
68
+ │ └── module.py
69
+ │ └── Module file, each module holds a logic of the package
70
+ ├── tests
71
+ │ └── Directory for testing the package and verifying that everything works
72
+ ├── .gitattributes
73
+ │ └── Ensures that all text files use LF as the line ending, improving consistency across different development environments.
74
+ ├── .bumpversion.toml
75
+ │ └── Configuration file for bumping the package version
76
+ ├── .gitignore
77
+ │ └── File explicitly instructed for Git to ignore
78
+ ├── .github
79
+ │ └── workflows
80
+ │ └── Github Ci/CD files
81
+ ├── .pre-commit-config.yaml
82
+ │ └── Pre-commit configuration file
83
+ ├── CONTRIBUTING.md
84
+ │ └── Contribution guidelines file
85
+ ├── LICENSE
86
+ ├── README.md
87
+ │ └── File with general information about the project
88
+ ├── pyproject.toml
89
+ │ └── Package configuration file
90
+ └── tox.ini
91
+ └── Configuration file for `tox`, used to automate testing and linting tasks across multiple Python environments. This file is configured to use Python 3.12 and runs commands for the linter `ruff` as well as for tests with `pytest`. The specified commands check code style, format files according to defined standards, and run unit tests to ensure the code works as expected. This file is also used to facilitate version management tasks with `bump-my-version`.
92
+ ```
93
+
94
+ ## Getting Started
95
+
96
+ ### Prerequisites
97
+
98
+ This project requires **Python 3.12**. Python 3.12 introduces many new features and improvements that are essential for the proper functioning of this project. Ensure that Python is correctly installed on your system by running `python --version`.
99
+
100
+ ### About the `pyproject.toml` File
101
+
102
+ The `pyproject.toml` file is a central configuration file for the Python project. It contains TOML tables specifying the basic metadata of the project, the dependencies needed to build your project, and specific configurations for the tools used.
103
+ The `[project]` table is used to specify the basic metadata of your project, such as dependencies, your name, etc. The `[tool]` table contains sub-tables specific to each tool, such as `[tool.setuptools]` or `[tool.ruff]`. For more information on configuring your `pyproject.toml`, refer to the [Python documentation](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/).
104
+
105
+ ### Installing Dependencies
106
+
107
+ The `pyproject.toml` file is used to manage the dependencies of this project. To install these dependencies, follow these steps:
108
+
109
+ 1. Open a terminal and navigate to the project directory.
110
+ 2. Run the command `pip install .` to install the necessary dependencies for the project.
111
+
112
+ This process ensures that all required dependencies are correctly installed in your environment, allowing you to work on the project with all necessary resources.
113
+
114
+ To add or modify project dependencies, you must list them in your `pyproject.toml` file under the `dependencies` section.
115
+
116
+ ```bash
117
+ dependencies = [
118
+ "pytest == 8.0.1",
119
+ # add necessary dependencies
120
+ ]
121
+ ```
122
+
123
+ ### Developing the Package
124
+
125
+ The `CONTRIBUTING.md` file is an essential guide for developing this Python package. It describes the steps to set up the development environment, the coding conventions to follow, and how to submit changes.
126
+ Once your changes are ready, push your contribution to the desired branch to trigger the integration pipeline, which will create the Python package and deploy it to the Python server.
127
+ For more details on contributing and best practices, please refer to the `CONTRIBUTING.md` file.
128
+
129
+ ## Using the Python Package
130
+
131
+ ### Installation
132
+
133
+ If you are using the provided `pip.conf`, you can simply run:
134
+
135
+ ```bash
136
+ pip install ckanapi_harvesters
137
+ ```
138
+
139
+ Otherwise, you can specify the package index depending on whether you are in an internal (on-premise) or external (cloud) environment.
140
+
141
+ ```bash
142
+ # On-premise
143
+ pip install ckanapi_harvesters --extra-index-url https://nexus.ifpen.fr/repository/fast-it/simple
144
+
145
+ # On Cloud
146
+ pip install ckanapi_harvesters --extra-index-url https://nexus.fastit.dev/repository/fast-it/simple
147
+ ```
148
+
149
+ Alternatively, you can set the package index URL as an environment variable:
150
+
151
+ ```bash
152
+ # On-premise
153
+ export PIP_EXTRA_INDEX_URL=https://nexus.fastit.dev/repository/fast-it/simple
154
+
155
+ # On Cloud
156
+ export PIP_EXTRA_INDEX_URL=https://nexus.ifpen.fr/repository/fast-it/simple
157
+ ```
158
+
159
+ ### Example Usage of the Python Package in Your Code
160
+
161
+ After installation, you can import and use your package and its functions in your Python code:
162
+
163
+ ```python
164
+ from package import hello_world
165
+
166
+ hello_world()
167
+ ```
168
+
169
+ To use sub-modules defined in the package:
170
+
171
+ ```python
172
+ from package.divider import divide
173
+
174
+ a = 4.0
175
+ b = 2.0
176
+
177
+ c = divide(4., 2.)
178
+ ```
179
+
180
+ These instructions will allow you to access the package and utilize its features effectively and in line with your development configuration.
181
+
182
+ ## License
183
+
184
+ This project is licensed under the MIT License, which means it is freely usable for personal and commercial purposes. The MIT License is one of the most permissive open source licenses. It allows you to do almost anything with the source code, as long as you retain the original license notice and copyright information when redistributing the software or substantial portions of it. This license comes without any warranties, so the software is provided "as is." For more details, please refer to the included LICENSE file.
185
+
186
+ ---
@@ -0,0 +1,153 @@
1
+ # ckanapi_harvesters
2
+
3
+ ---
4
+
5
+ ## Description
6
+
7
+ This "Python Package" template is a complete template designed to create a Python package according to IFPEN's development standards, deployable internally within IFPEN or on the Cloud. This template provides developers with a Python project architecture in which they can contribute, document, and make it available to all IFPEN developers.
8
+
9
+ This package includes:
10
+ - A unit test structure based on the [Pytest](https://docs.pytest.org/en/stable/) library
11
+ - Automatic documentation generation based on the [Sphinx](https://www.sphinx-doc.org/en/master/) library
12
+ - A CI/CD pipeline for deploying the Python package to a Python server
13
+
14
+ ## Github Pages
15
+
16
+ Your automaticly generated documentation (with Sphinx) is [Here](https://mobidec.github.io/ckanapi_harvesters/)
17
+
18
+ ## Python Package Template Architecture
19
+
20
+
21
+ ```
22
+ .
23
+ ├── sphinx
24
+ │ ├── conf.py
25
+ │ │ └── Sphinx documentation configuration file
26
+ │ └── index.rst
27
+ │ └── Root file for Sphinx documentation, structuring and linking source documents into complete documentation.
28
+ ├── src
29
+ │ └── ckanapi_harvesters
30
+ │ ├── __init__.py
31
+ │ ├── main.py
32
+ │ │ └── Main file of your package, it references what is usable in your package
33
+ │ └── module_name
34
+ │ ├── __init__.py
35
+ │ └── module.py
36
+ │ └── Module file, each module holds a logic of the package
37
+ ├── tests
38
+ │ └── Directory for testing the package and verifying that everything works
39
+ ├── .gitattributes
40
+ │ └── Ensures that all text files use LF as the line ending, improving consistency across different development environments.
41
+ ├── .bumpversion.toml
42
+ │ └── Configuration file for bumping the package version
43
+ ├── .gitignore
44
+ │ └── File explicitly instructed for Git to ignore
45
+ ├── .github
46
+ │ └── workflows
47
+ │ └── Github Ci/CD files
48
+ ├── .pre-commit-config.yaml
49
+ │ └── Pre-commit configuration file
50
+ ├── CONTRIBUTING.md
51
+ │ └── Contribution guidelines file
52
+ ├── LICENSE
53
+ ├── README.md
54
+ │ └── File with general information about the project
55
+ ├── pyproject.toml
56
+ │ └── Package configuration file
57
+ └── tox.ini
58
+ └── Configuration file for `tox`, used to automate testing and linting tasks across multiple Python environments. This file is configured to use Python 3.12 and runs commands for the linter `ruff` as well as for tests with `pytest`. The specified commands check code style, format files according to defined standards, and run unit tests to ensure the code works as expected. This file is also used to facilitate version management tasks with `bump-my-version`.
59
+ ```
60
+
61
+ ## Getting Started
62
+
63
+ ### Prerequisites
64
+
65
+ This project requires **Python 3.12**. Python 3.12 introduces many new features and improvements that are essential for the proper functioning of this project. Ensure that Python is correctly installed on your system by running `python --version`.
66
+
67
+ ### About the `pyproject.toml` File
68
+
69
+ The `pyproject.toml` file is a central configuration file for the Python project. It contains TOML tables specifying the basic metadata of the project, the dependencies needed to build your project, and specific configurations for the tools used.
70
+ The `[project]` table is used to specify the basic metadata of your project, such as dependencies, your name, etc. The `[tool]` table contains sub-tables specific to each tool, such as `[tool.setuptools]` or `[tool.ruff]`. For more information on configuring your `pyproject.toml`, refer to the [Python documentation](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/).
71
+
72
+ ### Installing Dependencies
73
+
74
+ The `pyproject.toml` file is used to manage the dependencies of this project. To install these dependencies, follow these steps:
75
+
76
+ 1. Open a terminal and navigate to the project directory.
77
+ 2. Run the command `pip install .` to install the necessary dependencies for the project.
78
+
79
+ This process ensures that all required dependencies are correctly installed in your environment, allowing you to work on the project with all necessary resources.
80
+
81
+ To add or modify project dependencies, you must list them in your `pyproject.toml` file under the `dependencies` section.
82
+
83
+ ```bash
84
+ dependencies = [
85
+ "pytest == 8.0.1",
86
+ # add necessary dependencies
87
+ ]
88
+ ```
89
+
90
+ ### Developing the Package
91
+
92
+ The `CONTRIBUTING.md` file is an essential guide for developing this Python package. It describes the steps to set up the development environment, the coding conventions to follow, and how to submit changes.
93
+ Once your changes are ready, push your contribution to the desired branch to trigger the integration pipeline, which will create the Python package and deploy it to the Python server.
94
+ For more details on contributing and best practices, please refer to the `CONTRIBUTING.md` file.
95
+
96
+ ## Using the Python Package
97
+
98
+ ### Installation
99
+
100
+ If you are using the provided `pip.conf`, you can simply run:
101
+
102
+ ```bash
103
+ pip install ckanapi_harvesters
104
+ ```
105
+
106
+ Otherwise, you can specify the package index depending on whether you are in an internal (on-premise) or external (cloud) environment.
107
+
108
+ ```bash
109
+ # On-premise
110
+ pip install ckanapi_harvesters --extra-index-url https://nexus.ifpen.fr/repository/fast-it/simple
111
+
112
+ # On Cloud
113
+ pip install ckanapi_harvesters --extra-index-url https://nexus.fastit.dev/repository/fast-it/simple
114
+ ```
115
+
116
+ Alternatively, you can set the package index URL as an environment variable:
117
+
118
+ ```bash
119
+ # On-premise
120
+ export PIP_EXTRA_INDEX_URL=https://nexus.fastit.dev/repository/fast-it/simple
121
+
122
+ # On Cloud
123
+ export PIP_EXTRA_INDEX_URL=https://nexus.ifpen.fr/repository/fast-it/simple
124
+ ```
125
+
126
+ ### Example Usage of the Python Package in Your Code
127
+
128
+ After installation, you can import and use your package and its functions in your Python code:
129
+
130
+ ```python
131
+ from package import hello_world
132
+
133
+ hello_world()
134
+ ```
135
+
136
+ To use sub-modules defined in the package:
137
+
138
+ ```python
139
+ from package.divider import divide
140
+
141
+ a = 4.0
142
+ b = 2.0
143
+
144
+ c = divide(4., 2.)
145
+ ```
146
+
147
+ These instructions will allow you to access the package and utilize its features effectively and in line with your development configuration.
148
+
149
+ ## License
150
+
151
+ This project is licensed under the MIT License, which means it is freely usable for personal and commercial purposes. The MIT License is one of the most permissive open source licenses. It allows you to do almost anything with the source code, as long as you retain the original license notice and copyright information when redistributing the software or substantial portions of it. This license comes without any warranties, so the software is provided "as is." For more details, please refer to the included LICENSE file.
152
+
153
+ ---
@@ -0,0 +1,66 @@
1
+ [project]
2
+ name = "ckanapi_harvesters"
3
+ version = '0.0.0'
4
+ authors = [
5
+ ]
6
+ maintainers = [
7
+ ]
8
+ description = "Adaptation of the template for github."
9
+ readme = "README.md"
10
+ requires-python = ">=3.12"
11
+ classifiers = [
12
+ "Programming Language :: Python :: 3.12",
13
+ "License :: OSI Approved :: MIT License",
14
+ "Operating System :: OS Independent",
15
+ ]
16
+ dependencies = [
17
+ "pytest == 8.0.1",
18
+ # ajouter les dépendances necessaires
19
+ ]
20
+
21
+ license = { file = "LICENSE" }
22
+
23
+ [tool.ckanapi_harvesters]
24
+ version = "1.0.2"
25
+
26
+ [tool.setuptools.packages.find]
27
+ where = ["src"]
28
+
29
+ [tool.setuptools_scm]
30
+ version_scheme = "guess-next-dev"
31
+ local_scheme = "dirty-tag"
32
+
33
+ [tool.setuptools]
34
+ py-modules = []
35
+ license-files = []
36
+
37
+ [tool.ruff]
38
+ # Set the maximum line length to 140.
39
+ line-length = 140
40
+ exclude = [
41
+ "tests"
42
+ ]
43
+
44
+ [tool.ruff.lint]
45
+ # See documentation: https://docs.astral.sh/ruff/rules/
46
+ extend-select = [
47
+ "UP",
48
+ "E501",
49
+ "I",
50
+ "B",
51
+ "F",
52
+ "E",
53
+ "N",
54
+ "A",
55
+ "PL",
56
+ "D"
57
+ ]
58
+
59
+
60
+ [tool.ruff.lint.pydocstyle]
61
+ convention = "numpy"
62
+
63
+ [tool.ruff.format]
64
+ quote-style = "single"
65
+ indent-style = "space"
66
+ docstring-code-format = true
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,15 @@
1
+ """
2
+ Module for demonstrating a simple 'Hello World' function.
3
+
4
+ This module imports the hello_world function from the main module
5
+ and makes it available for public use.
6
+
7
+ Functions
8
+ ---------
9
+ hello_world()
10
+ Print 'Hello World!' to the console.
11
+ """
12
+
13
+ from .main import hello_world
14
+
15
+ __all__ = ['hello_world']
@@ -0,0 +1,27 @@
1
+ """
2
+ Module for division operations and custom exceptions.
3
+
4
+ This module provides functions and exceptions related to division operations.
5
+ It imports the `divide` function and the `CantDivideByZeroError` exception from
6
+ other modules and makes them available for use in this module.
7
+
8
+ Functions
9
+ ---------
10
+ divide(a, b)
11
+ Divide two numbers, raising a custom exception if the divisor is zero.
12
+
13
+ Exceptions
14
+ ----------
15
+ CantDivideByZeroError
16
+ Raised when an attempt is made to divide by zero.
17
+
18
+ Imports
19
+ --------
20
+ - divide: Function for performing division operations.
21
+ - CantDivideByZeroError: Exception raised for division by zero errors.
22
+ """
23
+
24
+ from .divider import divide
25
+ from .divider_error import CantDivideByZeroError
26
+
27
+ __all__ = ['divide', 'CantDivideByZeroError']
@@ -0,0 +1,53 @@
1
+ """
2
+ Module for division operations with custom exceptions.
3
+
4
+ This module provides a function for performing division
5
+ and raises a custom exception when attempting to divide by zero.
6
+
7
+ Functions
8
+ ---------
9
+ divide(a, b)
10
+ Divide two numbers, raising a custom exception if the divisor is zero.
11
+
12
+ Exceptions
13
+ ----------
14
+ CantDivideByZeroError
15
+ Raised when an attempt is made to divide by zero.
16
+ """
17
+
18
+ from .divider_error import CantDivideByZeroError
19
+
20
+
21
+ def divide(a, b):
22
+ """
23
+ Divide two numbers, raising a custom exception if the divisor is zero.
24
+
25
+ Parameters
26
+ ----------
27
+ a : float
28
+ The dividend.
29
+ b : float
30
+ The divisor.
31
+
32
+ Returns
33
+ -------
34
+ float
35
+ The result of the division.
36
+
37
+ Raises
38
+ ------
39
+ CantDivideByZeroError
40
+ If the divisor (b) is zero.
41
+
42
+ Examples
43
+ --------
44
+ >>> divide(10, 2)
45
+ 5.0
46
+ >>> divide(10, 0)
47
+ Traceback (most recent call last):
48
+ ...
49
+ CantDivideByZeroError
50
+ """
51
+ if b == 0:
52
+ raise CantDivideByZeroError()
53
+ return a / b
@@ -0,0 +1,59 @@
1
+ """
2
+ Module for custom exceptions related to calculator operations.
3
+
4
+ This module defines custom exceptions used in calculator operations,
5
+ including a base exception class and a specific exception for division by zero errors.
6
+
7
+ Classes
8
+ -------
9
+ CalculatorError
10
+ Base class for exceptions in calculator operations.
11
+ CantDivideByZeroError
12
+ Exception raised when an attempt is made to divide by zero.
13
+
14
+ Exceptions
15
+ ----------
16
+ CalculatorError
17
+ Base class for exceptions in the calculator domain.
18
+ CantDivideByZeroError
19
+ Raised specifically for division by zero errors.
20
+ """
21
+
22
+
23
+ class CalculatorError(Exception):
24
+ """
25
+ Base class for exceptions in calculator operations.
26
+
27
+ This class is intended to be used as a base class for other calculator-related
28
+ exceptions. It inherits from the built-in Exception class and allows for custom
29
+ exception handling in the calculator domain.
30
+
31
+ Parameters
32
+ ----------
33
+ args : tuple
34
+ Variable length argument list passed to the base Exception class.
35
+ """
36
+
37
+ def __init__(self, *args):
38
+ super().__init__(args)
39
+
40
+
41
+ class CantDivideByZeroError(CalculatorError):
42
+ """
43
+ Exception raised when an attempt is made to divide by zero.
44
+
45
+ This exception is a specific subclass of CalculatorError and is intended to be
46
+ used when a division by zero error occurs. It provides a custom error message
47
+ indicating that division by zero is not allowed.
48
+
49
+ Parameters
50
+ ----------
51
+ None
52
+
53
+ Notes
54
+ -----
55
+ The default message for this exception is "tu ne peux pas diviser par zéro".
56
+ """
57
+
58
+ def __init__(self):
59
+ super().__init__('tu ne peux pas diviser par zéro')
@@ -0,0 +1,30 @@
1
+ """
2
+ Module containing simple demonstration functions.
3
+
4
+ This module provides basic example functions to demonstrate
5
+ simple Python functionality.
6
+
7
+ Functions
8
+ ---------
9
+ hello_world()
10
+ Print 'Hello World!' to the console.
11
+ """
12
+
13
+
14
+ def hello_world():
15
+ """
16
+ Print 'Hello World!' to the console.
17
+
18
+ Parameters
19
+ ----------
20
+ None
21
+
22
+ Returns
23
+ -------
24
+ None
25
+
26
+ Notes
27
+ -----
28
+ - This function simply prints the message 'Hello World!' to the standard output.
29
+ """
30
+ print('Hello World!')
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.4
2
+ Name: ckanapi_harvesters
3
+ Version: 0.0.0
4
+ Summary: Adaptation of the template for github.
5
+ License: MIT License
6
+
7
+ Copyright (c) 2024 ifpen
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
26
+
27
+ Classifier: Programming Language :: Python :: 3.12
28
+ Classifier: License :: OSI Approved :: MIT License
29
+ Classifier: Operating System :: OS Independent
30
+ Requires-Python: >=3.12
31
+ Description-Content-Type: text/markdown
32
+ Requires-Dist: pytest==8.0.1
33
+
34
+ # ckanapi_harvesters
35
+
36
+ ---
37
+
38
+ ## Description
39
+
40
+ This "Python Package" template is a complete template designed to create a Python package according to IFPEN's development standards, deployable internally within IFPEN or on the Cloud. This template provides developers with a Python project architecture in which they can contribute, document, and make it available to all IFPEN developers.
41
+
42
+ This package includes:
43
+ - A unit test structure based on the [Pytest](https://docs.pytest.org/en/stable/) library
44
+ - Automatic documentation generation based on the [Sphinx](https://www.sphinx-doc.org/en/master/) library
45
+ - A CI/CD pipeline for deploying the Python package to a Python server
46
+
47
+ ## Github Pages
48
+
49
+ Your automaticly generated documentation (with Sphinx) is [Here](https://mobidec.github.io/ckanapi_harvesters/)
50
+
51
+ ## Python Package Template Architecture
52
+
53
+
54
+ ```
55
+ .
56
+ ├── sphinx
57
+ │ ├── conf.py
58
+ │ │ └── Sphinx documentation configuration file
59
+ │ └── index.rst
60
+ │ └── Root file for Sphinx documentation, structuring and linking source documents into complete documentation.
61
+ ├── src
62
+ │ └── ckanapi_harvesters
63
+ │ ├── __init__.py
64
+ │ ├── main.py
65
+ │ │ └── Main file of your package, it references what is usable in your package
66
+ │ └── module_name
67
+ │ ├── __init__.py
68
+ │ └── module.py
69
+ │ └── Module file, each module holds a logic of the package
70
+ ├── tests
71
+ │ └── Directory for testing the package and verifying that everything works
72
+ ├── .gitattributes
73
+ │ └── Ensures that all text files use LF as the line ending, improving consistency across different development environments.
74
+ ├── .bumpversion.toml
75
+ │ └── Configuration file for bumping the package version
76
+ ├── .gitignore
77
+ │ └── File explicitly instructed for Git to ignore
78
+ ├── .github
79
+ │ └── workflows
80
+ │ └── Github Ci/CD files
81
+ ├── .pre-commit-config.yaml
82
+ │ └── Pre-commit configuration file
83
+ ├── CONTRIBUTING.md
84
+ │ └── Contribution guidelines file
85
+ ├── LICENSE
86
+ ├── README.md
87
+ │ └── File with general information about the project
88
+ ├── pyproject.toml
89
+ │ └── Package configuration file
90
+ └── tox.ini
91
+ └── Configuration file for `tox`, used to automate testing and linting tasks across multiple Python environments. This file is configured to use Python 3.12 and runs commands for the linter `ruff` as well as for tests with `pytest`. The specified commands check code style, format files according to defined standards, and run unit tests to ensure the code works as expected. This file is also used to facilitate version management tasks with `bump-my-version`.
92
+ ```
93
+
94
+ ## Getting Started
95
+
96
+ ### Prerequisites
97
+
98
+ This project requires **Python 3.12**. Python 3.12 introduces many new features and improvements that are essential for the proper functioning of this project. Ensure that Python is correctly installed on your system by running `python --version`.
99
+
100
+ ### About the `pyproject.toml` File
101
+
102
+ The `pyproject.toml` file is a central configuration file for the Python project. It contains TOML tables specifying the basic metadata of the project, the dependencies needed to build your project, and specific configurations for the tools used.
103
+ The `[project]` table is used to specify the basic metadata of your project, such as dependencies, your name, etc. The `[tool]` table contains sub-tables specific to each tool, such as `[tool.setuptools]` or `[tool.ruff]`. For more information on configuring your `pyproject.toml`, refer to the [Python documentation](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/).
104
+
105
+ ### Installing Dependencies
106
+
107
+ The `pyproject.toml` file is used to manage the dependencies of this project. To install these dependencies, follow these steps:
108
+
109
+ 1. Open a terminal and navigate to the project directory.
110
+ 2. Run the command `pip install .` to install the necessary dependencies for the project.
111
+
112
+ This process ensures that all required dependencies are correctly installed in your environment, allowing you to work on the project with all necessary resources.
113
+
114
+ To add or modify project dependencies, you must list them in your `pyproject.toml` file under the `dependencies` section.
115
+
116
+ ```bash
117
+ dependencies = [
118
+ "pytest == 8.0.1",
119
+ # add necessary dependencies
120
+ ]
121
+ ```
122
+
123
+ ### Developing the Package
124
+
125
+ The `CONTRIBUTING.md` file is an essential guide for developing this Python package. It describes the steps to set up the development environment, the coding conventions to follow, and how to submit changes.
126
+ Once your changes are ready, push your contribution to the desired branch to trigger the integration pipeline, which will create the Python package and deploy it to the Python server.
127
+ For more details on contributing and best practices, please refer to the `CONTRIBUTING.md` file.
128
+
129
+ ## Using the Python Package
130
+
131
+ ### Installation
132
+
133
+ If you are using the provided `pip.conf`, you can simply run:
134
+
135
+ ```bash
136
+ pip install ckanapi_harvesters
137
+ ```
138
+
139
+ Otherwise, you can specify the package index depending on whether you are in an internal (on-premise) or external (cloud) environment.
140
+
141
+ ```bash
142
+ # On-premise
143
+ pip install ckanapi_harvesters --extra-index-url https://nexus.ifpen.fr/repository/fast-it/simple
144
+
145
+ # On Cloud
146
+ pip install ckanapi_harvesters --extra-index-url https://nexus.fastit.dev/repository/fast-it/simple
147
+ ```
148
+
149
+ Alternatively, you can set the package index URL as an environment variable:
150
+
151
+ ```bash
152
+ # On-premise
153
+ export PIP_EXTRA_INDEX_URL=https://nexus.fastit.dev/repository/fast-it/simple
154
+
155
+ # On Cloud
156
+ export PIP_EXTRA_INDEX_URL=https://nexus.ifpen.fr/repository/fast-it/simple
157
+ ```
158
+
159
+ ### Example Usage of the Python Package in Your Code
160
+
161
+ After installation, you can import and use your package and its functions in your Python code:
162
+
163
+ ```python
164
+ from package import hello_world
165
+
166
+ hello_world()
167
+ ```
168
+
169
+ To use sub-modules defined in the package:
170
+
171
+ ```python
172
+ from package.divider import divide
173
+
174
+ a = 4.0
175
+ b = 2.0
176
+
177
+ c = divide(4., 2.)
178
+ ```
179
+
180
+ These instructions will allow you to access the package and utilize its features effectively and in line with your development configuration.
181
+
182
+ ## License
183
+
184
+ This project is licensed under the MIT License, which means it is freely usable for personal and commercial purposes. The MIT License is one of the most permissive open source licenses. It allows you to do almost anything with the source code, as long as you retain the original license notice and copyright information when redistributing the software or substantial portions of it. This license comes without any warranties, so the software is provided "as is." For more details, please refer to the included LICENSE file.
185
+
186
+ ---
@@ -0,0 +1,15 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/ckanapi_harvesters/__init__.py
5
+ src/ckanapi_harvesters/main.py
6
+ src/ckanapi_harvesters.egg-info/PKG-INFO
7
+ src/ckanapi_harvesters.egg-info/SOURCES.txt
8
+ src/ckanapi_harvesters.egg-info/dependency_links.txt
9
+ src/ckanapi_harvesters.egg-info/requires.txt
10
+ src/ckanapi_harvesters.egg-info/top_level.txt
11
+ src/ckanapi_harvesters/divider/__init__.py
12
+ src/ckanapi_harvesters/divider/divider.py
13
+ src/ckanapi_harvesters/divider/divider_error.py
14
+ tests/test_divider.py
15
+ tests/test_helloworld.py
@@ -0,0 +1 @@
1
+ ckanapi_harvesters
@@ -0,0 +1,11 @@
1
+ import pytest
2
+ from ckanapi_harvesters.divider import CantDivideByZeroError, divide
3
+
4
+
5
+ def test_devide_by_zero():
6
+ with pytest.raises(CantDivideByZeroError):
7
+ divide(1, 0)
8
+
9
+
10
+ def test_devide_by_one():
11
+ assert divide(1, 1) == 1
@@ -0,0 +1,5 @@
1
+ from ckanapi_harvesters import hello_world
2
+
3
+
4
+ def test_hello_world():
5
+ assert hello_world() is None