spio 0.0.6.post12__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.
Potentially problematic release.
This version of spio might be problematic. Click here for more details.
- spio-0.0.6.post12/LICENSE.md +19 -0
- spio-0.0.6.post12/PKG-INFO +157 -0
- spio-0.0.6.post12/README.md +137 -0
- spio-0.0.6.post12/pyproject.toml +26 -0
- spio-0.0.6.post12/src/marvin/__init__.py +0 -0
- spio-0.0.6.post12/src/marvin/tools/default_config.ini +11 -0
- spio-0.0.6.post12/src/marvin/tools/spio.py +1316 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: spio
|
|
3
|
+
Version: 0.0.6.post12
|
|
4
|
+
Summary: Magical Marvin SharePoint Library
|
|
5
|
+
Author: Roeland Maes
|
|
6
|
+
Author-email: roeland.maes@vito.be
|
|
7
|
+
Requires-Python: >=3.10,<4.0
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Provides-Extra: full
|
|
13
|
+
Provides-Extra: pandas
|
|
14
|
+
Provides-Extra: pandas-parquet
|
|
15
|
+
Provides-Extra: pandas-xlsx
|
|
16
|
+
Requires-Dist: Office365-REST-Python-Client (>=2.3,<3.0)
|
|
17
|
+
Requires-Dist: msal_extensions (>=0.3,<0.4)
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# Spio
|
|
22
|
+
|
|
23
|
+
## Description
|
|
24
|
+
|
|
25
|
+
Spio is a Python package that provides functionalities for reading and writing data to a SharePoint.
|
|
26
|
+
It can also handle various types of spatial and non-spatial data formats such as GeoTIFF, GeoPackage, NetCDF, CSV, Excel, and more.
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
To install the package, you can use the following command:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip config set global.extra-index-url https://repo.vito.be/artifactory/api/pypi/marvin-projects-pypi-local/simple
|
|
34
|
+
pip install spio
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
If you want to install the package with all the dependencies, you can use the following command:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install spio[full]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Building from Source
|
|
44
|
+
|
|
45
|
+
To build the package from source you can use the following commands:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
git clone https://git.vito.be/projects/MARVIN/repos/sharepoint_tools
|
|
49
|
+
cd sharepoint_tools
|
|
50
|
+
conda create -f conda_env.yml
|
|
51
|
+
conda activate spio
|
|
52
|
+
poetry install
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Configuration
|
|
56
|
+
|
|
57
|
+
Before using the package, you need to configure the settings to match your environment.
|
|
58
|
+
The configuration is managed through a `settings` module which should include all the necessary configurations.
|
|
59
|
+
|
|
60
|
+
### **Settings Configuration**:
|
|
61
|
+
Ensure you have a `settings` file (e.g., `.secrets.yaml` or `settings.yaml`) that provides the necessary configuration options. Example:
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from dynaconf import Dynaconf
|
|
65
|
+
|
|
66
|
+
settings = Dynaconf(
|
|
67
|
+
settings_files=['settings.yaml', '.secrets.yaml']
|
|
68
|
+
)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The settings file should include the following configurations:
|
|
72
|
+
|
|
73
|
+
```yaml
|
|
74
|
+
user_account: your.name@vito.be
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### **Initialize Spio with Settings**:
|
|
78
|
+
You need to initialize Spio with your settings before using any functionalities.
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from config import settings
|
|
82
|
+
from marvin.tools import spio
|
|
83
|
+
|
|
84
|
+
spio.init_spio(settings)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Usage
|
|
88
|
+
|
|
89
|
+
Here are some example usages of the package:
|
|
90
|
+
|
|
91
|
+
### Reading Data
|
|
92
|
+
|
|
93
|
+
- **Read GeoTIFF using Rasterio**:
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
from marvin.tools.spio import read_geotiff_rasterio
|
|
97
|
+
|
|
98
|
+
geotiff_data = read_geotiff_rasterio('path/to/your/geotiff/file.tif')
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
- **Read GeoPackage**:
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
from marvin.tools.spio import read_geopackage
|
|
105
|
+
|
|
106
|
+
geopackage_data = read_geopackage('path/to/your/geopackage/file.gpkg')
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
- **Read NetCDF**:
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
from marvin.tools.spio import read_netcdf
|
|
113
|
+
|
|
114
|
+
netcdf_data = read_netcdf('path/to/your/netcdf/file.nc')
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
- **Read CSV**:
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
from marvin.tools.spio import read_csv
|
|
121
|
+
|
|
122
|
+
csv_data = read_csv('path/to/your/csv/file.csv')
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Writing Data
|
|
126
|
+
|
|
127
|
+
- **Write CSV**:
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
from marvin.tools.spio import write_csv
|
|
131
|
+
|
|
132
|
+
write_csv('path/to/your/output/file.csv', csv_data)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
- **Write Excel**:
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
from marvin.tools.spio import write_excel
|
|
139
|
+
|
|
140
|
+
write_excel('path/to/your/output/file.xlsx', excel_data)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Additional Functionalities
|
|
144
|
+
|
|
145
|
+
Spio also provides additional functions to handle different data formats and processes.
|
|
146
|
+
You can explore these in the https://git.vito.be/projects/MARVIN/repos/sharepoint_tools/browse/test/tst_spio.py file for more complex scenarios such as writing to OneDrive, processing NetCDF4 files, and more.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
## Contributing
|
|
150
|
+
|
|
151
|
+
If you want to contribute to spio, please follow the standard contributing guidelines and push your changes to a new branch in
|
|
152
|
+
https://git.vito.be/projects/MARVIN/repos/sharepoint_tools
|
|
153
|
+
|
|
154
|
+
## License
|
|
155
|
+
|
|
156
|
+
This project is licensed under the MIT License - see the LICENSE.md file for details.
|
|
157
|
+
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
|
|
2
|
+
# Spio
|
|
3
|
+
|
|
4
|
+
## Description
|
|
5
|
+
|
|
6
|
+
Spio is a Python package that provides functionalities for reading and writing data to a SharePoint.
|
|
7
|
+
It can also handle various types of spatial and non-spatial data formats such as GeoTIFF, GeoPackage, NetCDF, CSV, Excel, and more.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
To install the package, you can use the following command:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip config set global.extra-index-url https://repo.vito.be/artifactory/api/pypi/marvin-projects-pypi-local/simple
|
|
15
|
+
pip install spio
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
If you want to install the package with all the dependencies, you can use the following command:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install spio[full]
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Building from Source
|
|
25
|
+
|
|
26
|
+
To build the package from source you can use the following commands:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://git.vito.be/projects/MARVIN/repos/sharepoint_tools
|
|
30
|
+
cd sharepoint_tools
|
|
31
|
+
conda create -f conda_env.yml
|
|
32
|
+
conda activate spio
|
|
33
|
+
poetry install
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Configuration
|
|
37
|
+
|
|
38
|
+
Before using the package, you need to configure the settings to match your environment.
|
|
39
|
+
The configuration is managed through a `settings` module which should include all the necessary configurations.
|
|
40
|
+
|
|
41
|
+
### **Settings Configuration**:
|
|
42
|
+
Ensure you have a `settings` file (e.g., `.secrets.yaml` or `settings.yaml`) that provides the necessary configuration options. Example:
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from dynaconf import Dynaconf
|
|
46
|
+
|
|
47
|
+
settings = Dynaconf(
|
|
48
|
+
settings_files=['settings.yaml', '.secrets.yaml']
|
|
49
|
+
)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The settings file should include the following configurations:
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
user_account: your.name@vito.be
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### **Initialize Spio with Settings**:
|
|
59
|
+
You need to initialize Spio with your settings before using any functionalities.
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
from config import settings
|
|
63
|
+
from marvin.tools import spio
|
|
64
|
+
|
|
65
|
+
spio.init_spio(settings)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
Here are some example usages of the package:
|
|
71
|
+
|
|
72
|
+
### Reading Data
|
|
73
|
+
|
|
74
|
+
- **Read GeoTIFF using Rasterio**:
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from marvin.tools.spio import read_geotiff_rasterio
|
|
78
|
+
|
|
79
|
+
geotiff_data = read_geotiff_rasterio('path/to/your/geotiff/file.tif')
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- **Read GeoPackage**:
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
from marvin.tools.spio import read_geopackage
|
|
86
|
+
|
|
87
|
+
geopackage_data = read_geopackage('path/to/your/geopackage/file.gpkg')
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- **Read NetCDF**:
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from marvin.tools.spio import read_netcdf
|
|
94
|
+
|
|
95
|
+
netcdf_data = read_netcdf('path/to/your/netcdf/file.nc')
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
- **Read CSV**:
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from marvin.tools.spio import read_csv
|
|
102
|
+
|
|
103
|
+
csv_data = read_csv('path/to/your/csv/file.csv')
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Writing Data
|
|
107
|
+
|
|
108
|
+
- **Write CSV**:
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
from marvin.tools.spio import write_csv
|
|
112
|
+
|
|
113
|
+
write_csv('path/to/your/output/file.csv', csv_data)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
- **Write Excel**:
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
from marvin.tools.spio import write_excel
|
|
120
|
+
|
|
121
|
+
write_excel('path/to/your/output/file.xlsx', excel_data)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Additional Functionalities
|
|
125
|
+
|
|
126
|
+
Spio also provides additional functions to handle different data formats and processes.
|
|
127
|
+
You can explore these in the https://git.vito.be/projects/MARVIN/repos/sharepoint_tools/browse/test/tst_spio.py file for more complex scenarios such as writing to OneDrive, processing NetCDF4 files, and more.
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## Contributing
|
|
131
|
+
|
|
132
|
+
If you want to contribute to spio, please follow the standard contributing guidelines and push your changes to a new branch in
|
|
133
|
+
https://git.vito.be/projects/MARVIN/repos/sharepoint_tools
|
|
134
|
+
|
|
135
|
+
## License
|
|
136
|
+
|
|
137
|
+
This project is licensed under the MIT License - see the LICENSE.md file for details.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
[tool.poetry]
|
|
3
|
+
name = "spio"
|
|
4
|
+
version = "0.0.0"
|
|
5
|
+
description = "Magical Marvin SharePoint Library"
|
|
6
|
+
authors = ["Roeland Maes <roeland.maes@vito.be>", "Thomas Danckaert <thomas.danckaert@vito.be>"]
|
|
7
|
+
packages = [
|
|
8
|
+
{ include = "src/marvin" }
|
|
9
|
+
]
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
|
|
12
|
+
[tool.poetry.dependencies]
|
|
13
|
+
python = "^3.10"
|
|
14
|
+
msal_extensions = "^0.3"
|
|
15
|
+
Office365-REST-Python-Client = "^2.3"
|
|
16
|
+
|
|
17
|
+
[tool.poetry.extras]
|
|
18
|
+
pandas = ["pandas"]
|
|
19
|
+
pandas_xlsx = ["pandas", "xlsxwriter"]
|
|
20
|
+
pandas_parquet = ["pandas", "pyarrow"]
|
|
21
|
+
full = ["numpy", "pyproj", "gdal", "cfgrib", "dynaconf", "pandas", "netcdf4", "h5netcdf", "pyarrow", "geopandas", "fiona", "rasterio", "matplotlib", "openpyxl", "xlsxwriter", "pyexcelerate"]
|
|
22
|
+
|
|
23
|
+
[tool.poetry-git-version-plugin]
|
|
24
|
+
make_alpha_version = true
|
|
25
|
+
|
|
26
|
+
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
[default]
|
|
3
|
+
graph_url=https://graph.microsoft.com/
|
|
4
|
+
sharepoint_host=yourhost.sharepoint.com
|
|
5
|
+
user_account=some.user@mail.abc
|
|
6
|
+
|
|
7
|
+
[msal]
|
|
8
|
+
client_id=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
9
|
+
authority=https://login.microsoftonline.com/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
10
|
+
auth_method=device
|
|
11
|
+
scopes=["Files.ReadWrite", "User.ReadWrite"]
|