ibridges-servers-uu 0.1.0__py3-none-any.whl

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 Utrecht University
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,61 @@
1
+ Metadata-Version: 2.1
2
+ Name: ibridges-servers-uu
3
+ Version: 0.1.0
4
+ Summary: iRODS environments for connecting to Utrecht University YoDa servers
5
+ Author-email: Raoul Schram <r.d.schram@uu.nl>
6
+ License: MIT
7
+ Classifier: Programming Language :: Python :: 3.8
8
+ Classifier: Programming Language :: Python :: 3.9
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Requires-Python: >=3.8
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Requires-Dist: ibridges
17
+ Provides-Extra: test
18
+ Requires-Dist: ruff ; extra == 'test'
19
+ Requires-Dist: mypy ; extra == 'test'
20
+
21
+ # iRODS environments for Utrecht University YoDa servers
22
+
23
+ This repository can be used to create an iRODS environment json that is needed to connect to the Utrecht University YoDa servers.
24
+
25
+
26
+ ## Step 1: Install the plugin
27
+ Type the following on the command line (in your virtual environment if you use one):
28
+
29
+ ```sh
30
+ pip install git+https://github.com/UtrechtUniversity/ibridges-servers-uu.git
31
+ ```
32
+
33
+ ## Step 2: Find the right server
34
+
35
+ On the command line run the following command:
36
+
37
+ ```sh
38
+ ibridges setup --list
39
+ ```
40
+
41
+ This shows you all the names of the YoDa servers available.
42
+
43
+ ## Step 3: Create your irods_environment.json
44
+
45
+ In the following examples, we use the `uu-its` server, replace it with the server that is available to your faculty.
46
+
47
+ ```sh
48
+ ibridges setup uu-its
49
+ ```
50
+
51
+ This will ask for your email address. After filling it in, a file will be created in the default location for the irods environment file (`~/.irods/irods_environment.json` on Linux and MacOS). You can modify this location adding the `--output SOME_NEW_LOCATION` flag to the above command.
52
+
53
+ ## Step 4: Start using iBridges
54
+
55
+ For the main documentation on how to use iBridges, see the iBridges main [repository](https://github.com/UtrechtUniversity/iBridges).
56
+
57
+ ```sh
58
+ ibridges init
59
+ ```
60
+
61
+ which will ask you for your data access password, which you can obtain through the YoDa portal.
@@ -0,0 +1,8 @@
1
+ ibridgescontrib/uutemplate/__init__.py,sha256=uujuvXATexxpuu0oWNZH6UPlZYt-QvvmCuPvftIqTP8,183
2
+ ibridgescontrib/uutemplate/templates.py,sha256=idxBGHr3_TAA30YkHQtFJzePcsGpDAehw3mpSNkLzNs,2336
3
+ ibridges_servers_uu-0.1.0.dist-info/LICENSE,sha256=ay-UsYxtg18FgqX26bbkZXtixJEeFQLerUnVPPFJsYs,1075
4
+ ibridges_servers_uu-0.1.0.dist-info/METADATA,sha256=BItwFHNwUjJjPhq0N3blrMCUGDs00DlHmORhA1wENd4,2059
5
+ ibridges_servers_uu-0.1.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
6
+ ibridges_servers_uu-0.1.0.dist-info/entry_points.txt,sha256=l2aUKOoy1_RJhkTxDPeuWhUFrUjVUoXocM1CvIFuu7s,89
7
+ ibridges_servers_uu-0.1.0.dist-info/top_level.txt,sha256=G7_Il8nHR05MqFQv1DG_sYF_e0PBh-lGuBFVsnjEhEE,16
8
+ ibridges_servers_uu-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (74.1.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [ibridges_server_template]
2
+ uu = ibridgescontrib.uutemplate.templates:IBridgesUUTemplates
@@ -0,0 +1 @@
1
+ ibridgescontrib
@@ -0,0 +1,4 @@
1
+ """Package to create irods_environment.json for Utrecht University servers."""
2
+ from ibridgescontrib.uutemplate.templates import IBridgesUUTemplates
3
+
4
+ __all__ = ["IBridgesUUTemplates"]
@@ -0,0 +1,68 @@
1
+ """Templates for irods_environment.json for Utrecht University servers."""
2
+ from __future__ import annotations
3
+
4
+ from string import Template
5
+
6
+ _SERVERS_TO_ZONE = {
7
+ "uu-youth": "nluu1p",
8
+ "uu-geo": "nluu11p",
9
+ "uu-i-lab": "nluu5p",
10
+ "uu-dgk": "nluu9ot",
11
+ "uu-science": "nluu6p",
12
+ "uu-fsw": "nluu10p",
13
+ "uu-its": "nluu12p"
14
+ }
15
+
16
+
17
+ _BASE_TEMPLATE = """{
18
+ "irods_host": "${host}.data.uu.nl",
19
+ "irods_port": 1247,
20
+ "irods_home": "/${zone}/home",
21
+ "irods_user_name": "${email_address}",
22
+ "irods_default_resource": "${resc}",
23
+ "irods_zone_name": "${zone}",
24
+ "irods_authentication_scheme": "pam",
25
+ "irods_encryption_algorithm": "AES-256-CBC",
26
+ "irods_encryption_key_size": 32,
27
+ "irods_encryption_num_hash_rounds": 16,
28
+ "irods_encryption_salt_size": 8,
29
+ "irods_client_server_policy": "CS_NEG_REQUIRE",
30
+ "irods_client_server_negotiation": "request_server_negotiation"
31
+ }
32
+ """
33
+
34
+
35
+ class IBridgesUUTemplates:
36
+ """Template for creating iRODS environment json files at Utrecht University."""
37
+
38
+ name = "Utrecht University templates"
39
+ questions = ["email_address"]
40
+ descriptions = {
41
+ "uu-youth": "YOUth Cohort Study",
42
+ "uu-geo": "Geosciences",
43
+ "uu-i-lab": "Humanities, Law, Economics, Governance, Open Societies",
44
+ "uu-dgk": "Veterinary Medicine, Medicine",
45
+ "uu-science": "Science",
46
+ "uu-fsw": "Social and Behavioral Sciences",
47
+ "uu-its": "University Corporate Offices"
48
+ }
49
+
50
+ @staticmethod
51
+ def list_templates() -> list[str]:
52
+ """List all templates for servers that are available."""
53
+ return list(_SERVERS_TO_ZONE)
54
+
55
+ @staticmethod
56
+ def contains(template_name: str) -> bool:
57
+ """Whether a template name is provided by this template."""
58
+ return template_name in _SERVERS_TO_ZONE
59
+
60
+ @staticmethod
61
+ def environment_json(template_name: str, email_address: str) -> str:
62
+ """Create a valid environment.json with the given inputs."""
63
+ host = template_name[3:]
64
+ zone = _SERVERS_TO_ZONE[template_name]
65
+ template = Template(_BASE_TEMPLATE)
66
+ resc = "irodsResc2" if template_name in ["uu-dgk", "uu-youth"] else "irodsResc"
67
+ return template.substitute({"zone": zone, "email_address": email_address,
68
+ "host": host, "resc": resc})