Skip to content

Commit 468a8ba

Browse files
committed
Version 5.2.2
* Debugged python code documentation. * Fixed copyright notices.
1 parent b0df1cc commit 468a8ba

5 files changed

Lines changed: 38 additions & 141 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# v5.2.2
2+
3+
* Debugged python code documentation.
4+
* Fixed copyright notices.
5+
16
# v5.2.1
27

38
* Update because of wrong documentation on https://pypi.org/project/hiro-graph-client/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 arago GmbH
3+
Copyright (c) 2020-present arago GmbH
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

docs/python/hiro_graph_client/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# -- Project information -----------------------------------------------------
2121

2222
project = 'hiro_graph_client'
23-
copyright = '2020, arago GmbH'
23+
copyright = '2020-present, arago GmbH'
2424
author = 'Wolfgang Hübner'
2525

2626
# The full version, including alpha/beta/rc tags

src/hiro_graph_client/clientlib.py

Lines changed: 28 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ def __init__(self,
130130
:param headers: Optional custom HTTP headers. Will override the internal headers. Default is None.
131131
:param timeout: Optional timeout for requests. Default is 600 (10 min).
132132
:param client_name: Optional name for the client. Will also be part of the "User-Agent" header unless *headers*
133-
is given with another value for "User-Agent". Default is "hiro-graph-client".
133+
is given with another value for "User-Agent". Default is "hiro-graph-client".
134134
:param ssl_config: Optional configuration for SSL connections. If this is omitted, the defaults of `requests`
135-
lib will be used.
135+
lib will be used.
136136
:param log_communication_on_error: Log socket communication when an error (status_code of HTTP Response) is
137137
detected. Default is not to do this.
138138
:param max_tries: Max tries for BACKOFF. Default is 2.
@@ -707,28 +707,19 @@ def __init__(self,
707707
shared between different API objects (like HiroGraph, HiroApp, etc.), this session and its pool are also
708708
shared.
709709
710+
See parent :class:`AbstractAPI` for a description of all remaining parameters.
711+
710712
:param root_url: Root url for HIRO, like https://core.arago.co.
711-
:param raise_exceptions: Raise exceptions on HTTP status codes that denote an error. Default is True.
712-
:param proxies: Proxy configuration for *requests*. Default is None.
713-
:param headers: Optional custom HTTP headers. Will override the internal headers. Default is None.
714-
:param timeout: Optional timeout for requests. Default is 600 (10 min).
715-
:param client_name: Optional name for the client. Will also be part of the "User-Agent" header unless *headers*
716-
is given with another value for "User-Agent". Default is "hiro-graph-client".
717713
:param custom_endpoints: Optional map of {name:endpoint_path, ...} that overrides or adds to the endpoints taken
718714
from /api/version. Example see above.
719-
:param ssl_config: Optional configuration for SSL connections. If this is omitted, the defaults of `requests`
720-
lib will be used.
721-
:param log_communication_on_error: Log socket communication when an error (status_code of HTTP Response) is
722-
detected. Default is not to do this.
723-
:param max_tries: Max tries for BACKOFF. Default is 2.
724715
:param pool_maxsize: Size of a connection pool for a single connection. See requests.adapters.HTTPAdapter.
725716
Default is 10. *pool_maxsize* is ignored when *session* is set.
726717
:param pool_block: Block any connections that exceed the pool_maxsize. Default is False: Allow more connections,
727718
but do not cache them. See requests.adapters.HTTPAdapter. *pool_block* is ignored when *session* is set.
728719
:param connection_handler: Copy parameters from this already existing connection handler. Overrides all other
729720
parameters.
730-
:param args: Unnamed parameters for parent class. See there.
731-
:param kwargs: Named parameters for parent class. See there.
721+
:param args: Unnamed parameter passthrough for parent class.
722+
:param kwargs: Named parameter passthrough for parent class.
732723
"""
733724
self._lock = threading.RLock()
734725

@@ -882,47 +873,11 @@ def __init__(self, *args, **kwargs):
882873
"""
883874
Constructor
884875
885-
Example for custom_endpoints (see params below):
886-
887-
::
876+
See parent :class:`GraphConnectionHandler` for a full description
877+
of all remaining parameters.
888878
889-
{
890-
"graph": "/api/graph/7.2",
891-
"auth": "/api/auth/6.2",
892-
"action-ws": ("/api/action-ws/1.0", "action-1.0.0")
893-
}
894-
895-
This object creates the *requests.Session* and *requests.adapters.HTTPAdapter* for this *root_url*. The
896-
*pool_maxsize* of such a session can be set via the parameter in the constructor. When a TokenApiHandler is
897-
shared between different API objects (like HiroGraph, HiroApp, etc.), this session and its pool are also
898-
shared.
899-
900-
:param root_url: Root url for HIRO, like https://core.arago.co.
901-
:param raise_exceptions: Raise exceptions on HTTP status codes that denote an error. Default is True.
902-
:param proxies: Proxy configuration for *requests*. Default is None.
903-
:param headers: Optional custom HTTP headers. Will override the internal headers. Default is None.
904-
:param timeout: Optional timeout for requests. Default is 600 (10 min).
905-
:param client_name: Optional name for the client. Will also be part of the "User-Agent" header unless *headers*
906-
is given with another value for "User-Agent". Default is "hiro-graph-client".
907-
:param custom_endpoints: Optional map of {name:endpoint_path, ...} that overrides or adds to the endpoints taken
908-
from /api/version. Example see above.
909-
:param ssl_config: Optional configuration for SSL connections. If this is omitted, the defaults of `requests` lib
910-
will be used.
911-
:param log_communication_on_error: Log socket communication when an error (status_code of HTTP Response) is
912-
detected. Default is not to do this.
913-
:param max_tries: Max tries for BACKOFF. Default is 2.
914-
:param pool_maxsize: Size of a connection pool for a single connection. See requests.adapters.HTTPAdapter.
915-
Default is 10. *pool_maxsize* is ignored when *connection_handler* is set and already contains a
916-
session.
917-
:param pool_block: Block any connections that exceed the pool_maxsize. Default is False: Allow more connections,
918-
but do not cache them. See requests.adapters.HTTPAdapter. *pool_block* is ignored when
919-
*connection_handler* is set and already contains a session.
920-
:param connection_handler: Copy all parameters from this already existing connection handler. This feature
921-
allows for several distinct TokenApiHandlers to operate on the same connection without querying
922-
unnecessary version information for each or building their own requests.Sessions. Overrides all other
923-
parameters.
924-
:param args: Unnamed parameters for parent class. See there.
925-
:param kwargs: Named parameters for parent class. See there.
879+
:param args: Unnamed parameter passthrough for parent class.
880+
:param kwargs: Named parameter passthrough for parent class.
926881
"""
927882
super().__init__(*args, **kwargs)
928883

@@ -934,7 +889,6 @@ def __init__(self, *args, **kwargs):
934889
def token(self) -> str:
935890
"""
936891
Return the current token.
937-
:return: The current token
938892
"""
939893
raise RuntimeError('Cannot use property of this abstract class.')
940894

@@ -983,33 +937,12 @@ def __init__(self, token: str = None, *args, **kwargs):
983937
"""
984938
Constructor
985939
986-
:param token: The fixed token to use.
987-
:param root_url: Root url for HIRO, like https://core.arago.co.
988-
:param raise_exceptions: Raise exceptions on HTTP status codes that denote an error. Default is True.
989-
:param proxies: Proxy configuration for *requests*. Default is None.
990-
:param headers: Optional custom HTTP headers. Will override the internal headers. Default is None.
991-
:param timeout: Optional timeout for requests. Default is 600 (10 min).
992-
:param client_name: Optional name for the client. Will also be part of the "User-Agent" header unless *headers*
993-
is given with another value for "User-Agent". Default is "hiro-graph-client".
994-
:param custom_endpoints: Optional map of [name:endpoint_path] that overrides or adds to the endpoints taken from
995-
/api/version.
996-
:param ssl_config: Optional configuration for SSL connections. If this is omitted, the defaults of `requests` lib
997-
will be used.
998-
:param log_communication_on_error: Log socket communication when an error (status_code of HTTP Response) is
999-
detected. Default is not to do this.
1000-
:param max_tries: Max tries for BACKOFF. Default is 2.
1001-
:param pool_maxsize: Size of a connection pool for a single connection. See requests.adapters.HTTPAdapter.
1002-
Default is 10. *pool_maxsize* is ignored when *connection_handler* is set and already contains a
1003-
session.
1004-
:param pool_block: Block any connections that exceed the pool_maxsize. Default is False: Allow more connections,
1005-
but do not cache them. See requests.adapters.HTTPAdapter. *pool_block* is ignored when
1006-
*connection_handler* is set and already contains a session.
1007-
:param connection_handler: Copy all parameters from this already existing connection handler. This feature
1008-
allows for several distinct TokenApiHandlers to operate on the same connection without querying
1009-
unnecessary version information for each or building their own requests.Sessions. Overrides all other
1010-
parameters.
1011-
:param args: Unnamed parameters for parent class. See there.
1012-
:param kwargs: Named parameters for parent class. See there.
940+
See parent :class:`AbstractTokenApiHandler` for a full description
941+
of all remaining parameters.
942+
943+
:param token: The fixed token for the HTTP requests.
944+
:param args: Unnamed parameter passthrough for parent class. See :class:`AbstractTokenApiHandler`.
945+
:param kwargs: Named parameter passthrough for parent class. See :class:`AbstractTokenApiHandler`.
1013946
"""
1014947
super().__init__(*args, **kwargs)
1015948

@@ -1041,33 +974,12 @@ def __init__(self, env_var: str = 'HIRO_TOKEN', *args, **kwargs):
1041974
"""
1042975
Constructor
1043976
1044-
:param root_url: Root url for HIRO, like https://core.arago.co.
1045-
:param env_var: Name of the environment variable to read for the token. Default is *HIRO_TOKEN*.
1046-
:param raise_exceptions: Raise exceptions on HTTP status codes that denote an error. Default is True.
1047-
:param proxies: Proxy configuration for *requests*. Default is None.
1048-
:param headers: Optional custom HTTP headers. Will override the internal headers. Default is None.
1049-
:param timeout: Optional timeout for requests. Default is 600 (10 min).
1050-
:param client_name: Optional name for the client. Will also be part of the "User-Agent" header unless *headers*
1051-
is given with another value for "User-Agent". Default is "hiro-graph-client".
1052-
:param custom_endpoints: Optional map of [name:endpoint_path] that overrides or adds to the endpoints taken from
1053-
/api/version.
1054-
:param ssl_config: Optional configuration for SSL connections. If this is omitted, the defaults of `requests` lib
1055-
will be used.
1056-
:param log_communication_on_error: Log socket communication when an error (status_code of HTTP Response) is
1057-
detected. Default is not to do this.
1058-
:param max_tries: Max tries for BACKOFF. Default is 2.
1059-
:param pool_maxsize: Size of a connection pool for a single connection. See requests.adapters.HTTPAdapter.
1060-
Default is 10. *pool_maxsize* is ignored when *connection_handler* is set and already contains a
1061-
session.
1062-
:param pool_block: Block any connections that exceed the pool_maxsize. Default is False: Allow more connections,
1063-
but do not cache them. See requests.adapters.HTTPAdapter. *pool_block* is ignored when
1064-
*connection_handler* is set and already contains a session.
1065-
:param connection_handler: Copy all parameters from this already existing connection handler. This feature
1066-
allows for several distinct TokenApiHandlers to operate on the same connection without querying
1067-
unnecessary version information for each or building their own requests.Sessions. Overrides all other
1068-
parameters.
1069-
:param args: Unnamed parameters for parent class. See there.
1070-
:param kwargs: Named parameters for parent class. See there.
977+
See parent :class:`AbstractTokenApiHandler` for a full description
978+
of all remaining parameters.
979+
980+
:param env_var: Name of the environment variable with the token.
981+
:param args: Unnamed parameter passthrough for parent class.
982+
:param kwargs: Named parameter passthrough for parent class.
1071983
"""
1072984
super().__init__(*args, **kwargs)
1073985

@@ -1225,37 +1137,16 @@ def __init__(self,
12251137
"""
12261138
Constructor
12271139
1228-
:param root_url: Root url for HIRO, like https://core.arago.co.
1140+
See parent :class:`AbstractTokenApiHandler` for a full description
1141+
of all remaining parameters.
1142+
12291143
:param username: Username for authentication
12301144
:param password: Password for authentication
12311145
:param client_id: OAuth client_id for authentication
12321146
:param client_secret: OAuth client_secret for authentication
12331147
:param secure_logging: If this is enabled, payloads that might contain sensitive information are not logged.
1234-
:param raise_exceptions: Raise exceptions on HTTP status codes that denote an error. Default is True.
1235-
:param proxies: Proxy configuration for *requests*. Default is None.
1236-
:param headers: Optional custom HTTP headers. Will override the internal headers. Default is None.
1237-
:param timeout: Optional timeout for requests. Default is 600 (10 min).
1238-
:param client_name: Optional name for the client. Will also be part of the "User-Agent" header unless *headers*
1239-
is given with another value for "User-Agent". Default is "hiro-graph-client".
1240-
:param custom_endpoints: Optional map of [name:endpoint_path] that overrides or adds to the endpoints taken from
1241-
/api/version.
1242-
:param ssl_config: Optional configuration for SSL connections. If this is omitted, the defaults of `requests` lib
1243-
will be used.
1244-
:param log_communication_on_error: Log socket communication when an error (status_code of HTTP Response) is
1245-
detected. Default is not to do this.
1246-
:param max_tries: Max tries for BACKOFF. Default is 2.
1247-
:param pool_maxsize: Size of a connection pool for a single connection. See requests.adapters.HTTPAdapter.
1248-
Default is 10. *pool_maxsize* is ignored when *connection_handler* is set and already contains a
1249-
_session.
1250-
:param pool_block: Block any connections that exceed the pool_maxsize. Default is False: Allow more connections,
1251-
but do not cache them. See requests.adapters.HTTPAdapter. *pool_block* is ignored when
1252-
*connection_handler* is set and already contains a _session.
1253-
:param connection_handler: Copy all parameters from this already existing connection handler. This feature
1254-
allows for several distinct TokenApiHandlers to operate on the same connection without querying
1255-
unnecessary version information for each or building their own requests.Sessions. Overrides all other
1256-
parameters.
1257-
:param args: Unnamed parameters for parent class. See there.
1258-
:param kwargs: Named parameters for parent class. See there.
1148+
:param args: Unnamed parameter passthrough for parent class.
1149+
:param kwargs: Named parameter passthrough for parent class.
12591150
"""
12601151
super().__init__(*args, **kwargs)
12611152

@@ -1275,6 +1166,7 @@ def endpoint(self):
12751166

12761167
@property
12771168
def token(self) -> str:
1169+
"""Get the token. Get or refresh it if necessary."""
12781170
with self._lock:
12791171
if not self._token_info.token:
12801172
self.get_token()

src/hiro_graph_client/variablesclient.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ def create_variable(self,
3131
3232
HIRO REST query API: `PUT self._endpoint`
3333
34-
:param data: Variable content.
35-
See https://core.arago.co/help/specs/?url=definitions/variables.yaml#/[Variables]/put_
36-
:param subtype Query variable. Value of ogit/subType. Optional.
34+
:param data: Variable content. See
35+
https://core.arago.co/help/specs/?url=definitions/variables.yaml#/[Variables]/put_
36+
:param subtype: Query variable. Value of ogit/subType. Optional.
3737
:return: The result payload
3838
"""
3939
query = {

0 commit comments

Comments
 (0)