okdata-cli 6.0.0__tar.gz → 6.1.1__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 (56) hide show
  1. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/LICENSE +1 -1
  2. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/PKG-INFO +2 -2
  3. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/__main__.py +6 -1
  4. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/datasets/datasets.py +9 -4
  5. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/datasets/questions.py +1 -1
  6. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/pubs/pubs.py +1 -1
  7. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/pubs/questions.py +4 -2
  8. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/teams/teams.py +4 -4
  9. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/validators.py +2 -2
  10. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata_cli.egg-info/PKG-INFO +2 -2
  11. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata_cli.egg-info/requires.txt +1 -1
  12. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/setup.py +2 -2
  13. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/README.md +0 -0
  14. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/__init__.py +0 -0
  15. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/__init__.py +0 -0
  16. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/command.py +0 -0
  17. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/__init__.py +0 -0
  18. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/datasets/__init__.py +0 -0
  19. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/datasets/wizards.py +0 -0
  20. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/permissions.py +0 -0
  21. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/pubs/__init__.py +0 -0
  22. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/pubs/clients.py +0 -0
  23. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/pubs/wizards.py +0 -0
  24. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/status.py +0 -0
  25. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/teams/questions.py +0 -0
  26. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/teams/util.py +0 -0
  27. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/teams/wizards.py +0 -0
  28. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/commands/wizard.py +0 -0
  29. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/datasets_config.json +0 -0
  30. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/datasets_config_verbose.json +0 -0
  31. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/datasets_copy_file_config.json +0 -0
  32. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/datasets_copy_file_config_2.json +0 -0
  33. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/datasets_dataset_config.json +0 -0
  34. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/datasets_dataset_version_config.json +0 -0
  35. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/datasets_dataset_version_edition_config.json +0 -0
  36. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/datasets_dataset_version_edition_distributions_config.json +0 -0
  37. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/datasets_dataset_versions_config.json +0 -0
  38. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/my_permissions_config.json +0 -0
  39. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/permissions_config.json +0 -0
  40. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/pubs_audit_log_config.json +0 -0
  41. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/pubs_clients_config.json +0 -0
  42. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/pubs_multiple_client_keys_config.json +0 -0
  43. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/pubs_single_client_keys_config.json +0 -0
  44. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/status_config.json +0 -0
  45. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/status_history_config.json +0 -0
  46. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/team_members_config.json +0 -0
  47. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/data/output-format/teams_config.json +0 -0
  48. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/io.py +0 -0
  49. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata/cli/output.py +0 -0
  50. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata_cli.egg-info/SOURCES.txt +0 -0
  51. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata_cli.egg-info/dependency_links.txt +0 -0
  52. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata_cli.egg-info/entry_points.txt +0 -0
  53. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata_cli.egg-info/namespace_packages.txt +0 -0
  54. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/okdata_cli.egg-info/top_level.txt +0 -0
  55. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/pyproject.toml +0 -0
  56. {okdata_cli-6.0.0 → okdata_cli-6.1.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019-2024 Oslo Origo
3
+ Copyright (c) 2019-2026 Oslo kommune
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: okdata-cli
3
- Version: 6.0.0
3
+ Version: 6.1.1
4
4
  Summary: CLI for services provided by Oslo Origo
5
5
  Home-page: https://github.com/oslokommune/okdata-cli/
6
6
  Author: Oslo Origo
@@ -18,7 +18,7 @@ Requires-Python: >=3.10
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
20
  Requires-Dist: docopt
21
- Requires-Dist: okdata-sdk<5,>=4
21
+ Requires-Dist: okdata-sdk<5,>=4.1
22
22
  Requires-Dist: PrettyTable
23
23
  Requires-Dist: questionary<2.0.0,>=1.10.0
24
24
  Requires-Dist: prompt-toolkit<3.0.52
@@ -4,7 +4,7 @@ import sys
4
4
 
5
5
  from keycloak.exceptions import KeycloakGetError, KeycloakPostError
6
6
  from okdata.sdk.exceptions import ApiAuthenticateError
7
- from requests.exceptions import RequestException
7
+ from requests.exceptions import ConnectTimeout, RequestException
8
8
 
9
9
  from okdata.cli import MAINTAINER
10
10
  from okdata.cli.command import BaseCommand
@@ -37,6 +37,11 @@ def main():
37
37
  # Flush output here to force SIGPIPE to be triggered while inside
38
38
  # this try block.
39
39
  sys.stdout.flush()
40
+ except ConnectTimeout as e:
41
+ instance.print(
42
+ f"Connection to '{e.request.url}' timed out. Please try again, "
43
+ f"or contact {MAINTAINER} if the problem persists.",
44
+ )
40
45
  except RequestException as e:
41
46
  if hasattr(e.response, "json"):
42
47
  instance.print_error_response(e.response.json())
@@ -1,7 +1,7 @@
1
1
  import sys
2
2
 
3
3
  from okdata.sdk.data.dataset import Dataset
4
- from okdata.sdk.data.download import Download
4
+ from okdata.sdk.data.download import Download, DownloadURLAssertionError
5
5
  from okdata.sdk.data.upload import Upload
6
6
  from requests.exceptions import HTTPError
7
7
 
@@ -421,9 +421,14 @@ Options:{BASE_COMMAND_OPTIONS}
421
421
  def download_files(self, source, target):
422
422
  download = Download(env=self.opt("env"))
423
423
  dataset_id, version, edition = self._dataset_components_from_uri(source)
424
- downloaded_files = download.download(
425
- dataset_id, version, edition, resolve_output_filepath(target)
426
- )
424
+
425
+ try:
426
+ downloaded_files = download.download(
427
+ dataset_id, version, edition, resolve_output_filepath(target)
428
+ )
429
+ except DownloadURLAssertionError as e:
430
+ sys.exit(e)
431
+
427
432
  self.log.info(f"Download returned: {downloaded_files}")
428
433
  out = create_output(self.opt("format"), "datasets_copy_file_config_2.json")
429
434
  out.output_singular_object = True
@@ -63,7 +63,7 @@ def qs_create_dataset():
63
63
  "message": "Tilgangsnivå",
64
64
  "choices": [
65
65
  Choice("Eksplisitt tilgangskontroll", "non-public"),
66
- Choice("Internt til Origo", "restricted"),
66
+ Choice("Internt til kommunen", "restricted"),
67
67
  Choice("Offentlig", "public"),
68
68
  ],
69
69
  },
@@ -84,7 +84,7 @@ Options:{BASE_COMMAND_OPTIONS}
84
84
  )
85
85
  except NoTeamError:
86
86
  self.print(
87
- "We haven't yet registered you as member of any Origo team. "
87
+ "You are not yet registered as a member of a team. "
88
88
  f"Please contact {MAINTAINER} to get it done."
89
89
  )
90
90
  return
@@ -17,7 +17,6 @@ client_types = {
17
17
 
18
18
  _organizations = [
19
19
  "dig",
20
- "origo",
21
20
  ]
22
21
 
23
22
  _environments = [
@@ -169,7 +168,10 @@ def q_client(pubs_client, allow_all=False):
169
168
  def client(c):
170
169
  return {"id": c["client_id"], "name": c["client_name"]}
171
170
 
172
- return [Choice(c["client_name"], client(c)) for c in sorted_clients] + (
171
+ return [
172
+ Choice(f'{c["client_name"]} (ID: {c["client_id"]})', client(c))
173
+ for c in sorted_clients
174
+ ] + (
173
175
  [Choice("All clients", [client(c) for c in sorted_clients])]
174
176
  if allow_all
175
177
  else []
@@ -68,7 +68,7 @@ Options:{BASE_COMMAND_OPTIONS}
68
68
  config = edit_team_wizard(self.client)
69
69
  except NoTeamError:
70
70
  self.print(
71
- "We haven't yet registered you as member of any Origo team. "
71
+ "You are not yet registered as a member of a team. "
72
72
  f"Please contact {MAINTAINER} to get it done."
73
73
  )
74
74
  return
@@ -87,7 +87,7 @@ Options:{BASE_COMMAND_OPTIONS}
87
87
  members = self.client.get_team_members(config["team_id"])
88
88
  except NoTeamError:
89
89
  self.print(
90
- "We haven't yet registered you as member of any Origo team. "
90
+ "You are not yet registered as a member of a team. "
91
91
  f"Please contact {MAINTAINER} to get it done."
92
92
  if my
93
93
  else "No teams exist yet."
@@ -104,7 +104,7 @@ Options:{BASE_COMMAND_OPTIONS}
104
104
  config = add_member_wizard(self.client)
105
105
  except NoTeamError:
106
106
  self.print(
107
- "We haven't yet registered you as member of any Origo team. "
107
+ "You are not yet registered as a member of a team. "
108
108
  f"Please contact {MAINTAINER} to get it done."
109
109
  )
110
110
  return
@@ -134,7 +134,7 @@ Options:{BASE_COMMAND_OPTIONS}
134
134
  config = remove_member_wizard(self.client)
135
135
  except NoTeamError:
136
136
  self.print(
137
- "We haven't yet registered you as member of any Origo team. "
137
+ "You are not yet registered as a member of a team. "
138
138
  f"Please contact {MAINTAINER} to get it done."
139
139
  )
140
140
  return
@@ -67,9 +67,9 @@ class IntegrationValidator(Validator):
67
67
  raise ValidationError(
68
68
  message="Too long!", cursor_position=len(document.text)
69
69
  )
70
- if not re.fullmatch("[0-9a-z-]+", document.text):
70
+ if not re.fullmatch("[0-9a-zA-Z -]+", document.text):
71
71
  raise ValidationError(
72
- message='Only lowercase letters, numbers and "-", please',
72
+ message='Only letters, numbers, spaces and "-", please',
73
73
  cursor_position=len(document.text),
74
74
  )
75
75
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: okdata-cli
3
- Version: 6.0.0
3
+ Version: 6.1.1
4
4
  Summary: CLI for services provided by Oslo Origo
5
5
  Home-page: https://github.com/oslokommune/okdata-cli/
6
6
  Author: Oslo Origo
@@ -18,7 +18,7 @@ Requires-Python: >=3.10
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
20
  Requires-Dist: docopt
21
- Requires-Dist: okdata-sdk<5,>=4
21
+ Requires-Dist: okdata-sdk<5,>=4.1
22
22
  Requires-Dist: PrettyTable
23
23
  Requires-Dist: questionary<2.0.0,>=1.10.0
24
24
  Requires-Dist: prompt-toolkit<3.0.52
@@ -1,5 +1,5 @@
1
1
  docopt
2
- okdata-sdk<5,>=4
2
+ okdata-sdk<5,>=4.1
3
3
  PrettyTable
4
4
  questionary<2.0.0,>=1.10.0
5
5
  prompt-toolkit<3.0.52
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="okdata-cli",
8
- version="6.0.0",
8
+ version="6.1.1",
9
9
  author="Oslo Origo",
10
10
  author_email="dataspeilet@oslo.kommune.no",
11
11
  description="CLI for services provided by Oslo Origo",
@@ -24,7 +24,7 @@ setuptools.setup(
24
24
  },
25
25
  install_requires=[
26
26
  "docopt",
27
- "okdata-sdk>=4,<5",
27
+ "okdata-sdk>=4.1,<5",
28
28
  "PrettyTable",
29
29
  # TODO: Upgrade to questionary 2.x.
30
30
  "questionary>=1.10.0,<2.0.0",
File without changes
File without changes
File without changes
File without changes