ae-cloud-storage 0.3.2__tar.gz → 0.3.4__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.
- {ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4}/LICENSE.md +1 -1
- {ae_cloud_storage-0.3.2/ae_cloud_storage.egg-info → ae_cloud_storage-0.3.4}/PKG-INFO +7 -6
- {ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4}/README.md +5 -5
- {ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4}/ae/cloud_storage.py +29 -21
- {ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4/ae_cloud_storage.egg-info}/PKG-INFO +7 -6
- {ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4}/setup.py +1 -1
- {ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4}/tests/test_cloud_storage.py +1 -1
- {ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4}/ae_cloud_storage.egg-info/SOURCES.txt +0 -0
- {ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4}/ae_cloud_storage.egg-info/dependency_links.txt +0 -0
- {ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4}/ae_cloud_storage.egg-info/requires.txt +0 -0
- {ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4}/ae_cloud_storage.egg-info/top_level.txt +0 -0
- {ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4}/ae_cloud_storage.egg-info/zip-safe +0 -0
- {ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4}/setup.cfg +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ae_cloud_storage
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: ae namespace module portion cloud_storage: distribute files to and retrieve them from cloud storage hosts.
|
|
5
5
|
Home-page: https://gitlab.com/ae-group/ae_cloud_storage
|
|
6
6
|
Author: AndiEcker
|
|
7
7
|
Author-email: aecker2@gmail.com
|
|
8
8
|
License: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
9
|
+
Project-URL: Bug Tracker, https://gitlab.com/ae-group/ae_cloud_storage/-/issues
|
|
9
10
|
Project-URL: Documentation, https://ae.readthedocs.io/en/latest/_autosummary/ae.cloud_storage.html
|
|
10
11
|
Project-URL: Repository, https://gitlab.com/ae-group/ae_cloud_storage
|
|
11
12
|
Project-URL: Source, https://ae.readthedocs.io/en/latest/_modules/ae/cloud_storage.html
|
|
@@ -58,19 +59,19 @@ Requires-Dist: types-setuptools; extra == "tests"
|
|
|
58
59
|
Requires-Dist: wheel; extra == "tests"
|
|
59
60
|
Requires-Dist: twine; extra == "tests"
|
|
60
61
|
|
|
61
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae V0.3.
|
|
62
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae V0.3.95 -->
|
|
62
63
|
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_namespace_root V0.3.14 -->
|
|
63
|
-
# cloud_storage 0.3.
|
|
64
|
+
# cloud_storage 0.3.4
|
|
64
65
|
|
|
65
66
|
[](
|
|
66
67
|
https://gitlab.com/ae-group/ae_cloud_storage)
|
|
67
68
|
[](
|
|
70
|
+
https://gitlab.com/ae-group/ae_cloud_storage/-/tree/release0.3.3)
|
|
70
71
|
[](
|
|
71
72
|
https://pypi.org/project/ae-cloud-storage/#history)
|
|
72
73
|
|
|
73
|
-
>ae_cloud_storage module 0.3.
|
|
74
|
+
>ae_cloud_storage module 0.3.4.
|
|
74
75
|
|
|
75
76
|
[](
|
|
76
77
|
https://ae-group.gitlab.io/ae_cloud_storage/coverage/index.html)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae V0.3.
|
|
1
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae V0.3.95 -->
|
|
2
2
|
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_namespace_root V0.3.14 -->
|
|
3
|
-
# cloud_storage 0.3.
|
|
3
|
+
# cloud_storage 0.3.4
|
|
4
4
|
|
|
5
5
|
[](
|
|
6
6
|
https://gitlab.com/ae-group/ae_cloud_storage)
|
|
7
7
|
[](
|
|
9
|
+
https://gitlab.com/ae-group/ae_cloud_storage/-/tree/release0.3.3)
|
|
10
10
|
[](
|
|
11
11
|
https://pypi.org/project/ae-cloud-storage/#history)
|
|
12
12
|
|
|
13
|
-
>ae_cloud_storage module 0.3.
|
|
13
|
+
>ae_cloud_storage module 0.3.4.
|
|
14
14
|
|
|
15
15
|
[](
|
|
16
16
|
https://ae-group.gitlab.io/ae_cloud_storage/coverage/index.html)
|
|
@@ -33,7 +33,7 @@ from googleapiclient.http import MediaFileUpload, MediaIoBaseDownload
|
|
|
33
33
|
from ae.base import os_path_basename, os_path_isfile, os_path_join, read_file, ErrorMsgMixin # type: ignore
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
__version__ = '0.3.
|
|
36
|
+
__version__ = '0.3.4'
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
_registered_csh_classes = {} #: cloud storage class ids map to their related api classes, used by :func:`csh_api_class`
|
|
@@ -65,7 +65,8 @@ class CshApiBase(ErrorMsgMixin, ABC):
|
|
|
65
65
|
""" add or update a binary file to the cloud storage host.
|
|
66
66
|
|
|
67
67
|
:param file_path: path (relative to the host root) and name of the file to be deployed (added or updated).
|
|
68
|
-
:param source_path: source path if differs from the destination path given in
|
|
68
|
+
:param source_path: source path if differs from the destination path given in
|
|
69
|
+
:paramref:`~deploy_file.file_path`.
|
|
69
70
|
:return: created/updated file path or empty string on error (see self.error_message for details).
|
|
70
71
|
"""
|
|
71
72
|
|
|
@@ -83,8 +84,8 @@ class CshApiBase(ErrorMsgMixin, ABC):
|
|
|
83
84
|
def csh_api_class(csh_id: str) -> Type[CshApiBase]:
|
|
84
85
|
""" determine from the specified cloud storage host id the associated api class
|
|
85
86
|
|
|
86
|
-
:param csh_id:
|
|
87
|
-
:return:
|
|
87
|
+
:param csh_id: id of the cloud storage api class.
|
|
88
|
+
:return: cloud storage api class if registered/declared, else the abstract class CshApiClass.
|
|
88
89
|
"""
|
|
89
90
|
return _registered_csh_classes.get(csh_id, CshApiBase)
|
|
90
91
|
|
|
@@ -107,10 +108,8 @@ class DigiApi(CshApiBase):
|
|
|
107
108
|
self.base_url = 'https://digistorage.es'
|
|
108
109
|
self.session = requests.Session()
|
|
109
110
|
token = self.session.get(self.base_url + '/token',
|
|
110
|
-
headers={
|
|
111
|
-
|
|
112
|
-
'X-Koofr-Password': password
|
|
113
|
-
}).headers['X-Koofr-Token']
|
|
111
|
+
headers={'X-Koofr-Email': email, 'X-Koofr-Password': password},
|
|
112
|
+
).headers['X-Koofr-Token']
|
|
114
113
|
self.session.headers['Authorization'] = 'Token ' + token
|
|
115
114
|
|
|
116
115
|
api_prefix = '/api/v2/mounts'
|
|
@@ -173,7 +172,8 @@ class DigiApi(CshApiBase):
|
|
|
173
172
|
""" add or update a binary file to the cloud storage host.
|
|
174
173
|
|
|
175
174
|
:param file_path: path (relative to the host root) and name of the file to be deployed (added or updated).
|
|
176
|
-
:param source_path: source path if differs from the destination path given in
|
|
175
|
+
:param source_path: source path if differs from the destination path given in
|
|
176
|
+
:paramref:`~deploy_file.file_path`.
|
|
177
177
|
:return: created/updated file path or empty string on error (see self.error_message for details).
|
|
178
178
|
"""
|
|
179
179
|
if ':' in file_path:
|
|
@@ -234,7 +234,7 @@ class DigiApi(CshApiBase):
|
|
|
234
234
|
self.session.close()
|
|
235
235
|
|
|
236
236
|
|
|
237
|
-
class GoodriveApi(CshApiBase
|
|
237
|
+
class GoodriveApi(CshApiBase):
|
|
238
238
|
""" upload, update, download and delete files from a Google Drive.
|
|
239
239
|
|
|
240
240
|
to prepare Google Drive host api instance (root folder and authentication), create in your console (at
|
|
@@ -391,12 +391,14 @@ class GoodriveApi(CshApiBase, ErrorMsgMixin):
|
|
|
391
391
|
""" add or update a binary file to the cloud storage host.
|
|
392
392
|
|
|
393
393
|
:param file_path: path (relative to the host root) and name of the file to be deployed (added or updated).
|
|
394
|
-
:param source_path: source path if differs from the destination path given in
|
|
394
|
+
:param source_path: source path if differs from the destination path given in
|
|
395
|
+
:paramref:`~deploy_file.file_path`.
|
|
395
396
|
:return: created/updated file id or empty string on error (check self.error_message for details).
|
|
396
397
|
|
|
397
398
|
.. note::
|
|
398
399
|
sometimes :meth:`.folder_file_ids` fails to see a deployed file directly after the deployment. on subsequent
|
|
399
400
|
bulk deployments use :meth:`.wait_for_deployment_finish` to wait for finished/completed deployment.
|
|
401
|
+
|
|
400
402
|
"""
|
|
401
403
|
if ':' in file_path:
|
|
402
404
|
self.error_message = f"invalid character ':' in remote file name/path '{file_path}'"
|
|
@@ -415,21 +417,27 @@ class GoodriveApi(CshApiBase, ErrorMsgMixin):
|
|
|
415
417
|
def folder_file_ids(self, file_path: str, folder_id: str = '', create_folders: bool = False) -> tuple[str, str]:
|
|
416
418
|
""" convert Google Drive file path into the related folder and file ids.
|
|
417
419
|
|
|
418
|
-
:param file_path: path of a file or folder, relative to the folder specified in
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
420
|
+
:param file_path: path of a file or folder, relative to the folder specified in
|
|
421
|
+
:paramref:`~folder_file_ids.folder_id`.
|
|
422
|
+
:param folder_id: Google Drive folder id of the root folder where :paramref:`~folder_file_ids.folder_path`
|
|
423
|
+
is underneath of. if not passed then it defaults to the root folder (specified via
|
|
424
|
+
__init__()).
|
|
425
|
+
|
|
426
|
+
.. note::
|
|
427
|
+
MyDrive GOOGLE_DRIVE_DEFAULT_ROOT_FOLDER/'root' id is working for OAuth2,
|
|
428
|
+
but not for service accounts authentication.
|
|
423
429
|
:param create_folders: pass True to create non-existing folders in the specified file path.
|
|
424
430
|
:return: tuple of ids of the specified folder and of the basename file/folder.
|
|
425
431
|
if the second tuple item is an empty string then an error occurred, because either
|
|
426
432
|
the specified folder/file does not exist,
|
|
427
433
|
or the specified basename ends with a slash, although it is a file.
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
434
|
+
|
|
435
|
+
.. note::
|
|
436
|
+
if :paramref:`~folder_file_ids.folder_path` specifies a Google Drive cloud mimetype, like
|
|
437
|
+
Google Doc/Sheet/.., then although the file id get returned, an error
|
|
438
|
+
message get set (stating that Google Docs cannot be downloaded as files via
|
|
439
|
+
:meth:`.deployed_file_content`).
|
|
440
|
+
|
|
433
441
|
"""
|
|
434
442
|
if not folder_id:
|
|
435
443
|
folder_id = self.root_folder_id_default
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ae_cloud_storage
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: ae namespace module portion cloud_storage: distribute files to and retrieve them from cloud storage hosts.
|
|
5
5
|
Home-page: https://gitlab.com/ae-group/ae_cloud_storage
|
|
6
6
|
Author: AndiEcker
|
|
7
7
|
Author-email: aecker2@gmail.com
|
|
8
8
|
License: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
|
|
9
|
+
Project-URL: Bug Tracker, https://gitlab.com/ae-group/ae_cloud_storage/-/issues
|
|
9
10
|
Project-URL: Documentation, https://ae.readthedocs.io/en/latest/_autosummary/ae.cloud_storage.html
|
|
10
11
|
Project-URL: Repository, https://gitlab.com/ae-group/ae_cloud_storage
|
|
11
12
|
Project-URL: Source, https://ae.readthedocs.io/en/latest/_modules/ae/cloud_storage.html
|
|
@@ -58,19 +59,19 @@ Requires-Dist: types-setuptools; extra == "tests"
|
|
|
58
59
|
Requires-Dist: wheel; extra == "tests"
|
|
59
60
|
Requires-Dist: twine; extra == "tests"
|
|
60
61
|
|
|
61
|
-
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae V0.3.
|
|
62
|
+
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project ae.ae V0.3.95 -->
|
|
62
63
|
<!-- THIS FILE IS EXCLUSIVELY MAINTAINED by the project aedev.tpl_namespace_root V0.3.14 -->
|
|
63
|
-
# cloud_storage 0.3.
|
|
64
|
+
# cloud_storage 0.3.4
|
|
64
65
|
|
|
65
66
|
[](
|
|
66
67
|
https://gitlab.com/ae-group/ae_cloud_storage)
|
|
67
68
|
[](
|
|
70
|
+
https://gitlab.com/ae-group/ae_cloud_storage/-/tree/release0.3.3)
|
|
70
71
|
[](
|
|
71
72
|
https://pypi.org/project/ae-cloud-storage/#history)
|
|
72
73
|
|
|
73
|
-
>ae_cloud_storage module 0.3.
|
|
74
|
+
>ae_cloud_storage module 0.3.4.
|
|
74
75
|
|
|
75
76
|
[](
|
|
76
77
|
https://ae-group.gitlab.io/ae_cloud_storage/coverage/index.html)
|
|
@@ -11,7 +11,7 @@ from ae.cloud_storage import DigiApi, GoodriveApi, csh_api_class
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
load_dotenvs()
|
|
14
|
-
tst_digi_root_folder = os.environ.get('
|
|
14
|
+
tst_digi_root_folder = os.environ.get('TEST_DIGI_ROOT_FOLDER_PATH')
|
|
15
15
|
tst_digi_email = os.environ.get('TEST_DIGI_API_EMAIL')
|
|
16
16
|
tst_digi_password = os.environ.get('TEST_DIGI_API_PASSWORD')
|
|
17
17
|
|
|
File without changes
|
{ae_cloud_storage-0.3.2 → ae_cloud_storage-0.3.4}/ae_cloud_storage.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|