synapseclient 4.7.0__tar.gz → 4.8.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.
Files changed (126) hide show
  1. {synapseclient-4.7.0/synapseclient.egg-info → synapseclient-4.8.0}/PKG-INFO +13 -11
  2. {synapseclient-4.7.0 → synapseclient-4.8.0}/README.md +2 -2
  3. {synapseclient-4.7.0 → synapseclient-4.8.0}/setup.cfg +11 -9
  4. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/__main__.py +4 -4
  5. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/api/__init__.py +15 -0
  6. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/api/entity_factory.py +128 -73
  7. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/api/entity_services.py +76 -0
  8. synapseclient-4.8.0/synapseclient/api/table_services.py +185 -0
  9. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/client.py +197 -37
  10. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/async_utils.py +1 -1
  11. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/constants/concrete_types.py +14 -1
  12. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/credentials/cred_data.py +2 -1
  13. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/cumulative_transfer_progress.py +34 -37
  14. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/exceptions.py +5 -0
  15. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/remote_file_storage_wrappers.py +2 -0
  16. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/transfer_bar.py +1 -0
  17. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/upload/multipart_upload.py +17 -3
  18. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/upload/multipart_upload_async.py +226 -25
  19. synapseclient-4.8.0/synapseclient/core/upload/upload_utils.py +237 -0
  20. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/utils.py +97 -17
  21. synapseclient-4.8.0/synapseclient/core/version_check.py +308 -0
  22. synapseclient-4.8.0/synapseclient/models/__init__.py +94 -0
  23. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/activity.py +7 -6
  24. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/annotations.py +1 -1
  25. synapseclient-4.8.0/synapseclient/models/dataset.py +2806 -0
  26. synapseclient-4.8.0/synapseclient/models/entityview.py +1180 -0
  27. synapseclient-4.8.0/synapseclient/models/materializedview.py +865 -0
  28. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/mixins/access_control.py +51 -4
  29. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/mixins/asynchronous_job.py +154 -60
  30. synapseclient-4.8.0/synapseclient/models/mixins/table_components.py +3971 -0
  31. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/protocols/access_control_protocol.py +42 -7
  32. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/protocols/agent_protocol.py +12 -12
  33. synapseclient-4.8.0/synapseclient/models/protocols/table_protocol.py +107 -0
  34. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/services/storable_entity_components.py +22 -7
  35. synapseclient-4.8.0/synapseclient/models/submissionview.py +916 -0
  36. synapseclient-4.8.0/synapseclient/models/table.py +1529 -0
  37. synapseclient-4.8.0/synapseclient/models/table_components.py +684 -0
  38. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/synapsePythonClient +1 -1
  39. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/table.py +20 -3
  40. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/wiki.py +5 -0
  41. {synapseclient-4.7.0 → synapseclient-4.8.0/synapseclient.egg-info}/PKG-INFO +13 -11
  42. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient.egg-info/SOURCES.txt +7 -0
  43. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient.egg-info/requires.txt +6 -5
  44. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseutils/describe_functions.py +8 -9
  45. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseutils/monitor.py +13 -3
  46. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseutils/sync.py +37 -37
  47. synapseclient-4.7.0/synapseclient/core/upload/upload_utils.py +0 -70
  48. synapseclient-4.7.0/synapseclient/core/version_check.py +0 -191
  49. synapseclient-4.7.0/synapseclient/models/__init__.py +0 -51
  50. synapseclient-4.7.0/synapseclient/models/protocols/table_protocol.py +0 -134
  51. synapseclient-4.7.0/synapseclient/models/table.py +0 -714
  52. {synapseclient-4.7.0 → synapseclient-4.8.0}/MANIFEST.in +0 -0
  53. {synapseclient-4.7.0 → synapseclient-4.8.0}/pyproject.toml +0 -0
  54. {synapseclient-4.7.0 → synapseclient-4.8.0}/setup.py +0 -0
  55. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/.synapseConfig +0 -0
  56. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/__init__.py +0 -0
  57. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/activity.py +0 -0
  58. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/annotations.py +0 -0
  59. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/api/agent_services.py +0 -0
  60. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/api/annotations.py +0 -0
  61. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/api/configuration_services.py +0 -0
  62. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/api/entity_bundle_services_v2.py +0 -0
  63. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/api/file_services.py +0 -0
  64. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/__init__.py +0 -0
  65. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/cache.py +0 -0
  66. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/config.py +0 -0
  67. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/constants/__init__.py +0 -0
  68. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/constants/config_file_constants.py +0 -0
  69. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/constants/limits.py +0 -0
  70. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/constants/method_flags.py +0 -0
  71. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/credentials/__init__.py +0 -0
  72. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/credentials/credential_provider.py +0 -0
  73. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/download/__init__.py +0 -0
  74. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/download/download_async.py +0 -0
  75. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/download/download_functions.py +0 -0
  76. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/dozer.py +0 -0
  77. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/lock.py +0 -0
  78. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/logging_setup.py +0 -0
  79. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/models/__init__.py +0 -0
  80. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/models/custom_json.py +0 -0
  81. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/models/dict_object.py +0 -0
  82. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/models/permission.py +0 -0
  83. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/multithread_download/__init__.py +0 -0
  84. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/multithread_download/download_threads.py +0 -0
  85. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/pool_provider.py +0 -0
  86. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/retry.py +0 -0
  87. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/sts_transfer.py +0 -0
  88. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/upload/__init__.py +0 -0
  89. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/upload/upload_functions.py +0 -0
  90. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/core/upload/upload_functions_async.py +0 -0
  91. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/entity.py +0 -0
  92. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/evaluation.py +0 -0
  93. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/agent.py +0 -0
  94. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/evaluation.py +0 -0
  95. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/file.py +0 -0
  96. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/folder.py +0 -0
  97. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/mixins/__init__.py +0 -0
  98. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/mixins/storable_container.py +0 -0
  99. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/project.py +0 -0
  100. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/protocols/__init__.py +0 -0
  101. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/protocols/activity_protocol.py +0 -0
  102. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/protocols/annotations_protocol.py +0 -0
  103. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/protocols/file_protocol.py +0 -0
  104. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/protocols/folder_protocol.py +0 -0
  105. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/protocols/project_protocol.py +0 -0
  106. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/protocols/storable_container_protocol.py +0 -0
  107. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/protocols/team_protocol.py +0 -0
  108. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/protocols/user_protocol.py +0 -0
  109. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/services/__init__.py +0 -0
  110. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/services/search.py +0 -0
  111. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/services/storable_entity.py +0 -0
  112. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/team.py +0 -0
  113. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/user.py +0 -0
  114. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/models/wiki.py +0 -0
  115. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/services/__init__.py +0 -0
  116. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/services/json_schema.py +0 -0
  117. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient/team.py +0 -0
  118. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient.egg-info/dependency_links.txt +0 -0
  119. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient.egg-info/entry_points.txt +0 -0
  120. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient.egg-info/not-zip-safe +0 -0
  121. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseclient.egg-info/top_level.txt +0 -0
  122. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseutils/__init__.py +0 -0
  123. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseutils/copy_functions.py +0 -0
  124. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseutils/migrate_functions.py +0 -0
  125. {synapseclient-4.7.0 → synapseclient-4.8.0}/synapseutils/walk_functions.py +0 -0
  126. {synapseclient-4.7.0 → synapseclient-4.8.0}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: synapseclient
3
- Version: 4.7.0
3
+ Version: 4.8.0
4
4
  Summary: A client for Synapse, a collaborative, open-source research platform that allows teams to share data, track analyses, and collaborate.
5
5
  Home-page: https://www.synapse.org
6
6
  Author: The Synapse Engineering Team
@@ -9,7 +9,7 @@ License: Apache-2.0
9
9
  Project-URL: Source, https://github.com/Sage-Bionetworks/synapsePythonClient
10
10
  Project-URL: Tracker, https://github.com/Sage-Bionetworks/synapsePythonClient/issues
11
11
  Project-URL: Documentation, https://python-docs.synapse.org
12
- Project-URL: Changelog, https://python-docs.synapse.org/build/html/index.html#release-notes
12
+ Project-URL: Changelog, https://python-docs.synapse.org/en/stable/news/
13
13
  Platform: any
14
14
  Classifier: Development Status :: 5 - Production/Stable
15
15
  Classifier: Programming Language :: Python
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3.9
17
17
  Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
20
21
  Classifier: Operating System :: MacOS
21
22
  Classifier: Operating System :: Microsoft :: Windows
22
23
  Classifier: Operating System :: Unix
@@ -27,7 +28,7 @@ Classifier: License :: OSI Approved :: Apache Software License
27
28
  Classifier: Topic :: Software Development :: Libraries
28
29
  Classifier: Topic :: Scientific/Engineering
29
30
  Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
30
- Requires-Python: <3.13,>=3.9
31
+ Requires-Python: <3.14,>=3.9
31
32
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
32
33
  Requires-Dist: requests<3.0,>=2.22.0
33
34
  Requires-Dist: urllib3<2,>=1.26.18
@@ -41,15 +42,16 @@ Requires-Dist: opentelemetry-instrumentation-threading>=0.48b0
41
42
  Requires-Dist: opentelemetry-instrumentation-urllib>=0.48b0
42
43
  Requires-Dist: nest-asyncio~=1.6.0
43
44
  Requires-Dist: asyncio-atexit~=1.0.1
44
- Requires-Dist: httpx~=0.27.0
45
+ Requires-Dist: httpx>=0.27.0
46
+ Requires-Dist: httpcore>=1.0.9
45
47
  Requires-Dist: tqdm<5.0,>=4.66.2
46
48
  Requires-Dist: async-lru~=2.0.4
47
49
  Requires-Dist: psutil~=5.9.8
48
50
  Provides-Extra: dev
49
- Requires-Dist: pytest<8.0,>=7.0.0; extra == "dev"
51
+ Requires-Dist: pytest~=8.2.0; extra == "dev"
50
52
  Requires-Dist: pytest-mock<4.0,>=3.0; extra == "dev"
51
53
  Requires-Dist: pytest-socket~=0.6.0; extra == "dev"
52
- Requires-Dist: pytest-asyncio<1.0,>=0.23.6; extra == "dev"
54
+ Requires-Dist: pytest-asyncio<1.0,>=0.25.0; extra == "dev"
53
55
  Requires-Dist: flake8<4.0,>=3.7.0; extra == "dev"
54
56
  Requires-Dist: pytest-xdist[psutil]<3.0.0,>=2.2; extra == "dev"
55
57
  Requires-Dist: pytest-rerunfailures~=12.0; extra == "dev"
@@ -59,10 +61,10 @@ Requires-Dist: black; extra == "dev"
59
61
  Requires-Dist: pre-commit; extra == "dev"
60
62
  Requires-Dist: pandas<3.0,>=1.5; extra == "dev"
61
63
  Provides-Extra: tests
62
- Requires-Dist: pytest<8.0,>=7.0.0; extra == "tests"
64
+ Requires-Dist: pytest~=8.2.0; extra == "tests"
63
65
  Requires-Dist: pytest-mock<4.0,>=3.0; extra == "tests"
64
66
  Requires-Dist: pytest-socket~=0.6.0; extra == "tests"
65
- Requires-Dist: pytest-asyncio<1.0,>=0.23.6; extra == "tests"
67
+ Requires-Dist: pytest-asyncio<1.0,>=0.25.0; extra == "tests"
66
68
  Requires-Dist: flake8<4.0,>=3.7.0; extra == "tests"
67
69
  Requires-Dist: pytest-xdist[psutil]<3.0.0,>=2.2; extra == "tests"
68
70
  Requires-Dist: pytest-rerunfailures~=12.0; extra == "tests"
@@ -88,7 +90,7 @@ Python Synapse Client
88
90
  =====================
89
91
 
90
92
  Branch | Build Status
91
- --------|-------------
93
+ --------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
92
94
  develop | [![Build Status develop branch](https://github.com/Sage-Bionetworks/synapsePythonClient/workflows/build/badge.svg?branch=develop)](https://github.com/Sage-Bionetworks/synapsePythonClient/actions?query=branch%3Adevelop)
93
95
  master | [![Build Status master branch](https://github.com/Sage-Bionetworks/synapsePythonClient/workflows/build/badge.svg?branch=master)](https://github.com/Sage-Bionetworks/synapsePythonClient/actions?query=branch%3Amaster)
94
96
 
@@ -122,7 +124,7 @@ or by sending an email to [python-announce+subscribe@sagebase.org](mailto:python
122
124
  Installation
123
125
  ------------
124
126
 
125
- The Python Synapse client has been tested on versions 3.9, 3.10, 3.11 and 3.12 on Mac OS X, Ubuntu Linux and Windows.
127
+ The Python Synapse client has been tested on versions 3.9, 3.10, 3.11, 3.12 and 3.13 on Mac OS X, Ubuntu Linux and Windows.
126
128
 
127
129
  **Starting from Synapse Python client version 3.0, Synapse Python client requires Python >= 3.9**
128
130
 
@@ -2,7 +2,7 @@ Python Synapse Client
2
2
  =====================
3
3
 
4
4
  Branch | Build Status
5
- --------|-------------
5
+ --------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6
6
  develop | [![Build Status develop branch](https://github.com/Sage-Bionetworks/synapsePythonClient/workflows/build/badge.svg?branch=develop)](https://github.com/Sage-Bionetworks/synapsePythonClient/actions?query=branch%3Adevelop)
7
7
  master | [![Build Status master branch](https://github.com/Sage-Bionetworks/synapsePythonClient/workflows/build/badge.svg?branch=master)](https://github.com/Sage-Bionetworks/synapsePythonClient/actions?query=branch%3Amaster)
8
8
 
@@ -36,7 +36,7 @@ or by sending an email to [python-announce+subscribe@sagebase.org](mailto:python
36
36
  Installation
37
37
  ------------
38
38
 
39
- The Python Synapse client has been tested on versions 3.9, 3.10, 3.11 and 3.12 on Mac OS X, Ubuntu Linux and Windows.
39
+ The Python Synapse client has been tested on versions 3.9, 3.10, 3.11, 3.12 and 3.13 on Mac OS X, Ubuntu Linux and Windows.
40
40
 
41
41
  **Starting from Synapse Python client version 3.0, Synapse Python client requires Python >= 3.9**
42
42
 
@@ -12,7 +12,7 @@ project_urls =
12
12
  Source = https://github.com/Sage-Bionetworks/synapsePythonClient
13
13
  Tracker = https://github.com/Sage-Bionetworks/synapsePythonClient/issues
14
14
  Documentation = https://python-docs.synapse.org
15
- Changelog = https://python-docs.synapse.org/build/html/index.html#release-notes
15
+ Changelog = https://python-docs.synapse.org/en/stable/news/
16
16
  platforms = any
17
17
  classifiers =
18
18
  Development Status :: 5 - Production/Stable
@@ -21,6 +21,7 @@ classifiers =
21
21
  Programming Language :: Python :: 3.10
22
22
  Programming Language :: Python :: 3.11
23
23
  Programming Language :: Python :: 3.12
24
+ Programming Language :: Python :: 3.13
24
25
  Operating System :: MacOS
25
26
  Operating System :: Microsoft :: Windows
26
27
  Operating System :: Unix
@@ -36,7 +37,7 @@ classifiers =
36
37
  zip_safe = False
37
38
  include_package_data = True
38
39
  packages = find:
39
- python_requires = >=3.9, <3.13
40
+ python_requires = >=3.9, <3.14
40
41
  install_requires =
41
42
  requests>=2.22.0,<3.0
42
43
  urllib3>=1.26.18,<2
@@ -50,15 +51,16 @@ install_requires =
50
51
  opentelemetry-instrumentation-urllib>=0.48b0
51
52
  nest-asyncio~=1.6.0
52
53
  asyncio-atexit~=1.0.1
53
- httpx~=0.27.0
54
+ httpx>=0.27.0
55
+ httpcore>=1.0.9
54
56
  tqdm>=4.66.2,<5.0
55
57
  async-lru~=2.0.4
56
58
  psutil~=5.9.8
57
59
  tests_require =
58
- pytest>=7.0.0,<8.0
60
+ pytest~=8.2.0
59
61
  pytest-mock>=3.0,<4.0
60
62
  pytest-socket~=0.6.0
61
- pytest-asyncio>=0.23.6,<1.0
63
+ pytest-asyncio>=0.25.0,<1.0
62
64
  flake8>=3.7.0,<4.0
63
65
  pytest-xdist[psutil]>=2.2,<3.0.0
64
66
  pytest-rerunfailures~=12.0
@@ -68,10 +70,10 @@ tests_require =
68
70
 
69
71
  [options.extras_require]
70
72
  dev =
71
- pytest>=7.0.0,<8.0
73
+ pytest~=8.2.0
72
74
  pytest-mock>=3.0,<4.0
73
75
  pytest-socket~=0.6.0
74
- pytest-asyncio>=0.23.6,<1.0
76
+ pytest-asyncio>=0.25.0,<1.0
75
77
  flake8>=3.7.0,<4.0
76
78
  pytest-xdist[psutil]>=2.2,<3.0.0
77
79
  pytest-rerunfailures~=12.0
@@ -81,10 +83,10 @@ dev =
81
83
  pre-commit
82
84
  pandas>=1.5,<3.0
83
85
  tests =
84
- pytest>=7.0.0,<8.0
86
+ pytest~=8.2.0
85
87
  pytest-mock>=3.0,<4.0
86
88
  pytest-socket~=0.6.0
87
- pytest-asyncio>=0.23.6,<1.0
89
+ pytest-asyncio>=0.25.0,<1.0
88
90
  flake8>=3.7.0,<4.0
89
91
  pytest-xdist[psutil]>=2.2,<3.0.0
90
92
  pytest-rerunfailures~=12.0
@@ -359,12 +359,12 @@ def show(args, syn):
359
359
 
360
360
  ent = syn.get(args.id, downloadFile=False)
361
361
  syn.printEntity(ent)
362
- sys.stdout.write("Provenance:\n")
362
+ syn.logger.info("Provenance:")
363
363
  try:
364
364
  prov = syn.getProvenance(ent)
365
365
  syn.logger.info(prov)
366
366
  except SynapseHTTPError:
367
- syn.logger.error(" No Activity specified.\n")
367
+ syn.logger.exception("No Activity specified.")
368
368
 
369
369
 
370
370
  def delete(args, syn):
@@ -1785,11 +1785,11 @@ def perform_main(args, syn):
1785
1785
  )
1786
1786
  try:
1787
1787
  args.func(args, syn)
1788
- except Exception as ex:
1788
+ except Exception:
1789
1789
  if args.debug:
1790
1790
  raise
1791
1791
  else:
1792
- sys.stderr.write(utils._synapse_error_msg(ex))
1792
+ syn.logger.exception(f"Failed to perform command: {args.func}")
1793
1793
  sys.exit(1)
1794
1794
  else:
1795
1795
  # if no command provided print out help and quit
@@ -24,6 +24,7 @@ from .entity_bundle_services_v2 import (
24
24
  from .entity_factory import get_from_entity_factory
25
25
  from .entity_services import (
26
26
  create_access_requirements_if_none,
27
+ delete_entity,
27
28
  delete_entity_generated_by,
28
29
  get_entities_by_md5,
29
30
  get_entity,
@@ -46,6 +47,13 @@ from .file_services import (
46
47
  put_file_multipart_add,
47
48
  put_file_multipart_complete,
48
49
  )
50
+ from .table_services import (
51
+ ViewEntityType,
52
+ ViewTypeMask,
53
+ get_columns,
54
+ get_default_columns,
55
+ post_columns,
56
+ )
49
57
 
50
58
  __all__ = [
51
59
  # annotations
@@ -72,6 +80,7 @@ __all__ = [
72
80
  "get_entity",
73
81
  "put_entity",
74
82
  "post_entity",
83
+ "delete_entity",
75
84
  "get_upload_destination",
76
85
  "get_upload_destination_location",
77
86
  "create_access_requirements_if_none",
@@ -93,4 +102,10 @@ __all__ = [
93
102
  "get_session",
94
103
  "update_session",
95
104
  "get_trace",
105
+ # columns
106
+ "get_columns",
107
+ "post_columns",
108
+ "get_default_columns",
109
+ "ViewTypeMask",
110
+ "ViewEntityType",
96
111
  ]
@@ -19,8 +19,10 @@ from synapseclient.core.exceptions import (
19
19
  )
20
20
 
21
21
  if TYPE_CHECKING:
22
+ from models.entityview import EntityView
23
+
22
24
  from synapseclient import Synapse
23
- from synapseclient.models import File, Folder, Project
25
+ from synapseclient.models import Dataset, File, Folder, Project, Table
24
26
 
25
27
 
26
28
  async def get_from_entity_factory(
@@ -32,7 +34,9 @@ async def get_from_entity_factory(
32
34
  download_file: bool = True,
33
35
  download_location: str = None,
34
36
  follow_link: bool = False,
35
- entity_to_update: Union["Project", "File", "Folder"] = None,
37
+ entity_to_update: Union[
38
+ "Project", "File", "Folder", "Table", "Dataset", "EntityView"
39
+ ] = None,
36
40
  *,
37
41
  synapse_client: Optional["Synapse"] = None,
38
42
  ) -> Union["Project", "File", "Folder"]:
@@ -228,6 +232,64 @@ async def _search_for_file_by_md5(
228
232
  return bundle
229
233
 
230
234
 
235
+ async def _handle_file_entity(
236
+ entity_instance: "File",
237
+ entity_bundle: Dict[str, Any],
238
+ download_file: bool,
239
+ download_location: str,
240
+ if_collision: str,
241
+ submission: str,
242
+ synapse_client: "Synapse",
243
+ ) -> "File":
244
+ """Helper function to handle File entity specific logic."""
245
+ from synapseclient.models import FileHandle
246
+
247
+ entity_instance.fill_from_dict(
248
+ synapse_file=entity_bundle["entity"], set_annotations=False
249
+ )
250
+
251
+ # Update entity with FileHandle metadata
252
+ file_handle = next(
253
+ (
254
+ handle
255
+ for handle in entity_bundle.get("fileHandles", [])
256
+ if handle and handle["id"] == entity_instance.data_file_handle_id
257
+ ),
258
+ {},
259
+ )
260
+
261
+ entity_instance.file_handle = FileHandle().fill_from_dict(
262
+ synapse_instance=file_handle
263
+ )
264
+ entity_instance._fill_from_file_handle()
265
+
266
+ if download_file:
267
+ if file_handle:
268
+ await download_file_entity_model(
269
+ download_location=download_location,
270
+ file=entity_instance,
271
+ if_collision=if_collision,
272
+ submission=submission,
273
+ synapse_client=synapse_client,
274
+ )
275
+ else:
276
+ warning_message = (
277
+ "WARNING: You have READ permission on this file entity but not DOWNLOAD "
278
+ "permission. The file has NOT been downloaded."
279
+ )
280
+ synapse_client.logger.warning(
281
+ "\n"
282
+ + "!" * len(warning_message)
283
+ + "\n"
284
+ + warning_message
285
+ + "\n"
286
+ + "!" * len(warning_message)
287
+ + "\n"
288
+ )
289
+
290
+ return entity_instance
291
+
292
+
231
293
  async def _cast_into_class_type(
232
294
  entity_bundle: Dict[str, Any],
233
295
  download_file: bool = True,
@@ -238,7 +300,7 @@ async def _cast_into_class_type(
238
300
  entity_to_update: Union["Project", "File", "Folder"] = None,
239
301
  *,
240
302
  synapse_client: Optional["Synapse"] = None,
241
- ) -> Union["Project", "File", "Folder"]:
303
+ ) -> Union["Project", "File", "Folder", "Table", "Dataset", "EntityView"]:
242
304
  """
243
305
  Take an entity_bundle returned from the Synapse API and cast it into the appropriate
244
306
  class type. This will also download the file if `download_file` is set to True.
@@ -271,6 +333,18 @@ async def _cast_into_class_type(
271
333
  ValueError: If the entity type is not supported.
272
334
  """
273
335
  from synapseclient import Synapse
336
+ from synapseclient.models import (
337
+ Annotations,
338
+ Dataset,
339
+ DatasetCollection,
340
+ EntityView,
341
+ File,
342
+ Folder,
343
+ MaterializedView,
344
+ Project,
345
+ SubmissionView,
346
+ Table,
347
+ )
274
348
 
275
349
  syn = Synapse.get_client(synapse_client=synapse_client)
276
350
 
@@ -284,79 +358,53 @@ async def _cast_into_class_type(
284
358
  entity_bundle = await get_entity_id_version_bundle2(
285
359
  entity_id=target_id, version=target_version, synapse_client=synapse_client
286
360
  )
287
- entity = entity_bundle["entity"]
288
-
289
- from synapseclient.models import Annotations
290
361
 
362
+ entity = entity_bundle["entity"]
291
363
  annotations = Annotations.from_dict(
292
364
  synapse_annotations=entity_bundle.get("annotations", None)
293
365
  )
294
366
 
295
- from synapseclient.models import File, Folder, Project
296
-
297
- if entity["concreteType"] == concrete_types.PROJECT_ENTITY:
298
- if not entity_to_update:
299
- entity_to_update = Project()
300
- entity = entity_to_update.fill_from_dict(
301
- synapse_project=entity_bundle["entity"], set_annotations=False
302
- )
303
- elif entity["concreteType"] == concrete_types.FOLDER_ENTITY:
304
- if not entity_to_update:
305
- entity_to_update = Folder()
306
- entity = entity_to_update.fill_from_dict(
307
- synapse_folder=entity_bundle["entity"], set_annotations=False
308
- )
309
- elif entity["concreteType"] == concrete_types.FILE_ENTITY:
310
- if not entity_to_update:
311
- entity_to_update = File()
312
- entity = entity_to_update.fill_from_dict(
313
- synapse_file=entity_bundle["entity"], set_annotations=False
314
- )
315
- # update the entity with FileHandle metadata
316
- file_handle = next(
317
- (
318
- handle
319
- for handle in entity_bundle.get("fileHandles", [])
320
- if handle and handle["id"] == entity.data_file_handle_id
321
- ),
322
- {},
323
- )
324
- from synapseclient.models import FileHandle
325
-
326
- entity.file_handle = FileHandle().fill_from_dict(synapse_instance=file_handle)
327
- entity._fill_from_file_handle()
328
-
329
- if download_file:
330
- if file_handle:
331
- await download_file_entity_model(
332
- download_location=download_location,
333
- file=entity,
334
- if_collision=if_collision,
335
- submission=submission,
336
- synapse_client=synapse_client,
337
- )
338
- else: # no filehandle means that we do not have DOWNLOAD permission
339
- warning_message = (
340
- "WARNING: You have READ permission on this file entity but not DOWNLOAD "
341
- "permission. The file has NOT been downloaded."
342
- )
343
- syn.logger.warning(
344
- "\n"
345
- + "!" * len(warning_message)
346
- + "\n"
347
- + warning_message
348
- + "\n"
349
- + "!" * len(warning_message)
350
- + "\n"
351
- )
352
- else:
367
+ # Map concrete types to their corresponding classes
368
+ ENTITY_TYPE_MAP = {
369
+ concrete_types.PROJECT_ENTITY: Project,
370
+ concrete_types.FOLDER_ENTITY: Folder,
371
+ concrete_types.FILE_ENTITY: File,
372
+ concrete_types.TABLE_ENTITY: Table,
373
+ concrete_types.DATASET_ENTITY: Dataset,
374
+ concrete_types.DATASET_COLLECTION_ENTITY: DatasetCollection,
375
+ concrete_types.ENTITY_VIEW: EntityView,
376
+ concrete_types.MATERIALIZED_VIEW: MaterializedView,
377
+ concrete_types.SUBMISSION_VIEW: SubmissionView,
378
+ }
379
+
380
+ entity_class = ENTITY_TYPE_MAP.get(entity["concreteType"], None)
381
+ if not entity_class:
353
382
  raise ValueError(
354
383
  f"Attempting to retrieve an unsupported entity type of {entity['concreteType']}."
355
384
  )
385
+
386
+ # Create or use existing entity instance
387
+ entity_instance = entity_to_update or entity_class()
388
+
389
+ # Handle special case for File entities
390
+ if entity["concreteType"] == concrete_types.FILE_ENTITY:
391
+ entity_instance = await _handle_file_entity(
392
+ entity_instance=entity_instance,
393
+ entity_bundle=entity_bundle,
394
+ download_file=download_file,
395
+ download_location=download_location,
396
+ if_collision=if_collision,
397
+ submission=submission,
398
+ synapse_client=syn,
399
+ )
400
+ else:
401
+ # Handle all other entity types
402
+ entity_instance.fill_from_dict(entity_bundle["entity"], set_annotations=False)
403
+
356
404
  if annotations:
357
- entity.annotations = annotations
405
+ entity_instance.annotations = annotations
358
406
 
359
- return entity
407
+ return entity_instance
360
408
 
361
409
 
362
410
  def _check_entity_restrictions(
@@ -386,12 +434,19 @@ def _check_entity_restrictions(
386
434
  if restriction_information and restriction_information.get(
387
435
  "hasUnmetAccessRequirement", None
388
436
  ):
389
- warning_message = (
390
- "\nThis entity has access restrictions. Please visit the web page for this entity "
391
- f'(syn.onweb("{synapse_id}")). Look for the "Access" label and the lock icon underneath '
392
- 'the file name. Click "Request Access", and then review and fulfill the file '
393
- "download requirement(s).\n"
394
- )
437
+ if not syn.credentials or not syn.credentials._token:
438
+ warning_message = (
439
+ "You have not provided valid credentials for authentication with Synapse."
440
+ " Please provide an authentication token and use `synapseclient.login()` before your next attempt."
441
+ " See https://python-docs.synapse.org/tutorials/authentication/ for more information."
442
+ )
443
+ else:
444
+ warning_message = (
445
+ "\nThis entity has access restrictions. Please visit the web page for this entity "
446
+ f'(syn.onweb("{synapse_id}")). Look for the "Access" label and the lock icon underneath '
447
+ 'the file name. Click "Request Access", and then review and fulfill the file '
448
+ "download requirement(s).\n"
449
+ )
395
450
  if download_file and bundle.get("entityType") not in ("project", "folder"):
396
451
  raise SynapseUnmetAccessRestrictions(warning_message)
397
- syn.logger.warn(warning_message)
452
+ syn.logger.warning(warning_message)
@@ -7,6 +7,8 @@ from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
7
7
 
8
8
  from async_lru import alru_cache
9
9
 
10
+ from synapseclient.core.utils import get_synid_and_version
11
+
10
12
  if TYPE_CHECKING:
11
13
  from synapseclient import Synapse
12
14
 
@@ -215,6 +217,80 @@ async def delete_entity_generated_by(
215
217
  )
216
218
 
217
219
 
220
+ async def delete_entity(
221
+ entity_id: str,
222
+ version_number: int = None,
223
+ *,
224
+ synapse_client: Optional["Synapse"] = None,
225
+ ) -> None:
226
+ """
227
+ Deletes an entity from Synapse.
228
+
229
+ Arguments:
230
+ entity_id: The ID of the entity. This may include version `syn123.0` or `syn123`.
231
+ If the version is included in `entity_id` and `version_number` is also
232
+ passed in, then the version in `entity_id` will be used.
233
+ version_number: The version number of the entity to delete.
234
+ synapse_client: If not passed in and caching was not disabled by
235
+ `Synapse.allow_client_caching(False)` this will use the last created
236
+ instance from the Synapse class constructor.
237
+
238
+ Example: Delete the entity `syn123`:
239
+ This will delete all versions of the entity.
240
+
241
+ ```python
242
+ import asyncio
243
+ from synapseclient import Synapse
244
+ from synapseclient.api import delete_entity
245
+
246
+ syn = Synapse()
247
+ syn.login()
248
+
249
+
250
+ async def main():
251
+ await delete_entity(entity_id="syn123")
252
+
253
+ asyncio.run(main())
254
+ ```
255
+
256
+ Example: Delete a specific version of the entity `syn123`:
257
+ This will delete version `3` of the entity.
258
+
259
+ ```python
260
+ import asyncio
261
+ from synapseclient import Synapse
262
+ from synapseclient.api import delete_entity
263
+
264
+ syn = Synapse()
265
+ syn.login()
266
+
267
+
268
+ async def main():
269
+ await delete_entity(entity_id="syn123", version_number=3)
270
+
271
+ asyncio.run(main())
272
+ ```
273
+
274
+ Returns: None
275
+ """
276
+ from synapseclient import Synapse
277
+
278
+ client = Synapse.get_client(synapse_client=synapse_client)
279
+
280
+ syn_id, syn_version = get_synid_and_version(entity_id)
281
+ if not syn_version:
282
+ syn_version = version_number
283
+
284
+ if syn_version:
285
+ return await client.rest_delete_async(
286
+ uri=f"/entity/{syn_id}/version/{syn_version}",
287
+ )
288
+ else:
289
+ return await client.rest_delete_async(
290
+ uri=f"/entity/{syn_id}",
291
+ )
292
+
293
+
218
294
  async def get_entity_path(
219
295
  entity_id: str,
220
296
  *,