From 4af8a58450f68173357264a556b96cf09e786298 Mon Sep 17 00:00:00 2001 From: lennertvandevelde Date: Thu, 29 Sep 2022 16:02:37 +0200 Subject: [PATCH 01/12] MHPY-10 Add README file structure --- README.md | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 110 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 29db3ba..22594bd 100644 --- a/README.md +++ b/README.md @@ -3,22 +3,42 @@ ## Synopsis The Mediahaven Python library provides a way to communicate with MediaHaven via the v2 REST API. +- [OAuth Client](#mediahavenoauth2) +- [Mediahaven Client](#mediahavenmediahaven) +- Resources + - [Organisations](#organisations) + - [Fields](#fields) + - [Records](#records) +## ```mediahaven.oauth2``` +### ```ROPCGrant()``` +Parameters: +| Name | Description | Default | +| ---- | ----------- | ------- | +| mh_base_url | the Mediahaven base URL.
```str``` | *required* | +| client_id | Mediahaven Client id.
```str``` | *required* | +| client_secret | Mediahaven Client secret.
```str``` | *required* | -## Usage +
+ Code example ```python >>> import os ->>> ->>> from mediahaven import MediaHaven >>> from mediahaven.oauth2 import ROPCGrant, RequestTokenError ->>> + +>>> # Get the credentials from env vars. +>>> client_id = os.environ["CLIENT_ID"] +>>> client_secret = os.environ["CLIENT_SECRET"] +>>> username = os.environ["USERNAME"] +>>> password = os.environ["PASSWORD"] +>>> url = os.environ["MH_URL"] + >>> # Get the credentials from env vars. >>> client_id = os.environ["CLIENT_ID"] >>> client_secret = os.environ["CLIENT_SECRET"] >>> username = os.environ["USERNAME"] >>> password = os.environ["PASSWORD"] >>> url = os.environ["MH_URL"] ->>> + >>> # Create a ROPC grant >>> grant = ROPCGrant(url, client_id, client_secret) >>> # Request a token @@ -26,9 +46,75 @@ The Mediahaven Python library provides a way to communicate with MediaHaven via ... grant.request_token(username, password) ... except RequestTokenError as e: ... print(e) -... +``` + +
+ +### ```ROPCGrant.request_token()``` +Parameters: +| Name | Description | Default | +| ---- | ----------- | ------- | +| username | Mediahaven username.
```str``` | *required* | +| password | Mediahaven password.
```str``` | *required* | + + +
+ Code example + +```python +>>> import os +>>> from mediahaven.oauth2 import ROPCGrant, RequestTokenError + +>>> # Get the credentials from env vars. +>>> username = os.environ["USERNAME"] +>>> password = os.environ["PASSWORD"] +>>> try: +... grant.request_token(username, password) +... except RequestTokenError as e: +... print(e) +``` + +
+ +## ```mediahaven.mediahaven``` +### ```Mediahaven()``` +Parameters: +| Name | Description | Default | +| ---- | ----------- | ------- | +| mh_base_url | Mediahaven base URL.
```str``` | *required* | +| grant | OAuth2 Grant client.
[```ROPCGrant```](#ropcgrant) | *required* | + +
+Code example + +```python +>>> from mediahaven import MediaHaven + >>> # Initialize the MH client >>> client = MediaHaven(url, grant) +``` + +
+ +### Records +### ```Mediahaven.records.get()``` +Parameters: +| Name | Description | Default | +| ---- | ----------- | ------- | +| record_id | MediaObjectId, FragmentId or RecordId.
```str``` | *required* | +| accept_format | The "Accept" request header.
```AcceptFormat```
JSON, XML, DUBLIN, METS or UNKOWN | JSON | + +Returns: +| Type | Description | +| ---- | ----------- | +| ```MediaHavenSingleObject``` | A single record. | + + +
+Code example + +```python +>>> from mediahaven import MediaHaven >>> # Get record based on record ID >>> record = client.records.get("570...33b") @@ -36,7 +122,23 @@ The Mediahaven Python library provides a way to communicate with MediaHaven via on_disk >>> print(record.Dynamic.PID) qs...8q +``` +
+ +### ```Mediahaven.records.search()``` +Parameters: +| Name | Description | Default | +| ---- | ----------- | ------- | +| accept_format | The "Accept" request header.
```AcceptFormat```
JSON, XML, DUBLIN, METS or UNKOWN | JSON | +| **query_params
| MediaObjectId, FragmentId or RecordId.
| *optional* | + +Returns: +| Type | Description | +| ---- | ----------- | +| ```MediaHavenPageObject``` | A paged result with the records. | + +```python >>> # Get page based on query >>> records_page = client.records.search(q="+(batch_id:FLMB15)", nrOfResults=10, startIndex=0) >>> print(records_page.nr_of_results) @@ -47,7 +149,8 @@ qs...8q 0 >>> print(records_page[0].Dynamic.PID) w3...0k - +``` +```python >>> # Get next page >>> print(records_page.has_more) True From 51db825281a1191ed5c9f27cbe4ea93dde687ae7 Mon Sep 17 00:00:00 2001 From: lennertvandevelde Date: Thu, 29 Sep 2022 16:08:07 +0200 Subject: [PATCH 02/12] MHPY-10 formatting --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 22594bd..be79f90 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ + + # MediaHaven Python Library ## Synopsis @@ -131,7 +137,7 @@ Parameters: | Name | Description | Default | | ---- | ----------- | ------- | | accept_format | The "Accept" request header.
```AcceptFormat```
JSON, XML, DUBLIN, METS or UNKOWN | JSON | -| **query_params
| MediaObjectId, FragmentId or RecordId.
| *optional* | +| **query_params
| The optional query paramaters.
| *optional* | Returns: | Type | Description | From 232b5914bdafa369098eba53553aec38f902e504 Mon Sep 17 00:00:00 2001 From: lennertvandevelde Date: Thu, 29 Sep 2022 17:06:02 +0200 Subject: [PATCH 03/12] Add PageObject methods --- README.md | 158 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 126 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index be79f90..7aef747 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,3 @@ - - # MediaHaven Python Library ## Synopsis @@ -34,24 +28,10 @@ Parameters: >>> # Get the credentials from env vars. >>> client_id = os.environ["CLIENT_ID"] >>> client_secret = os.environ["CLIENT_SECRET"] ->>> username = os.environ["USERNAME"] ->>> password = os.environ["PASSWORD"] ->>> url = os.environ["MH_URL"] - ->>> # Get the credentials from env vars. ->>> client_id = os.environ["CLIENT_ID"] ->>> client_secret = os.environ["CLIENT_SECRET"] ->>> username = os.environ["USERNAME"] ->>> password = os.environ["PASSWORD"] >>> url = os.environ["MH_URL"] >>> # Create a ROPC grant >>> grant = ROPCGrant(url, client_id, client_secret) ->>> # Request a token ->>> try: -... grant.request_token(username, password) -... except RequestTokenError as e: -... print(e) ``` @@ -142,7 +122,10 @@ Parameters: Returns: | Type | Description | | ---- | ----------- | -| ```MediaHavenPageObject``` | A paged result with the records. | +| [```MediaHavenPageObject```](#mediahavenpageobject) | A paged result with the records. | + +
+ Code example ```python >>> # Get page based on query @@ -156,19 +139,44 @@ Returns: >>> print(records_page[0].Dynamic.PID) w3...0k ``` + +
+ +## ```mediahaven.resources.base_resource``` +### ```MediahavenSingleObject()``` +Represents a single result. +### ```MediahavenPageObject()``` +Represents a paged result. +### ```MediahavenPageObject.next_page()``` +Fetches the next page. + +Returns: +| Type | Description | +| ---- | ----------- | +| [```MediahavenPageObject```](#mediahavenpageobject) | The next page. | + +
+Code example + ```python >>> # Get next page ->>> print(records_page.has_more) -True ->>> print(next_page.nr_of_results) -10 ->>> print(next_page.total_nr_of_results) -22 ->>> print(next_page.start_index) -10 ->>> print(next_page[0].Dynamic.PID) -2z...40 +>>> next_page = current_page.next_page() +``` + +
+ +### ```MediahavenPageObject.as_generator()``` +Returns a generator for all the result items spread over all the pages. + +Returns: +| Type | Description | +| ---- | ----------- | +| ```Generator``` | A generator for all result items. | + +
+Code example +```python >>> # Work via generator >>> for record in records_page.as_generator(): ... print(record.Dynamic.PID) @@ -176,4 +184,90 @@ True w3...0k 9s...5t -``` \ No newline at end of file +``` + +
+ +### ```MediahavenPageObject.has_more()``` +Returns: +| Type | Description | +| ---- | ----------- | +| ```bool``` | A boolean indicating if there are more pages. | + +Raises +| Type | Description | +| ---- | ----------- | +| ```NoMorePagesException``` | When there are no pages left. | +
+Code example + +```python +>>> print(records_page.has_more) +True +``` + +
+ +### ```MediahavenPageObject.nr_of_results()``` +Returns: +| Type | Description | +| ---- | ----------- | +| ```int``` | Number of results on current page. | + +
+Code example + +```python +>>> print(current_page.nr_of_results) +10 +``` + +
+ +### ```MediahavenPageObject.total_nr_of_results()``` +Returns: +| Type | Description | +| ---- | ----------- | +| ```int``` | Total number of results of query. | + +
+Code example + +```python +>>> print(current_page.total_nr_of_results) +10 +``` + +
+ +### ```MediahavenPageObject.start_index()``` +Returns: +| Type | Description | +| ---- | ----------- | +| ```int``` | Current page's start index. | + +
+Code example + +```python +>>> print(current_page.start_index) +10 +``` + +
+ +### ```MediahavenPageObject.raw_response()``` +Returns: +| Type | Description | +| ---- | ----------- | +| ```str``` | Raw response text. | + +
+Code example + +```python +>>> print(current_page.raw_response) +{...} +``` + +
\ No newline at end of file From 08512921075f029efad563171edcb52eb4f8ea96 Mon Sep 17 00:00:00 2001 From: lennertvandevelde Date: Mon, 3 Oct 2022 09:56:59 +0200 Subject: [PATCH 04/12] MHPY-10 Properties without brackets --- README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7aef747..fbf3f02 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ Parameters: | Name | Description | Default | | ---- | ----------- | ------- | | accept_format | The "Accept" request header.
```AcceptFormat```
JSON, XML, DUBLIN, METS or UNKOWN | JSON | -| **query_params
  • q
  • startIndex
  • nrOfResults
  • publicOnly
| The optional query paramaters.
  • Free text search string
  • Search results will be returned starting from this index.
  • Number of results that will be returned.
  • If true exclude fields which were marked as non public in the record's Profiles
| *optional* | +| **query_params
  • q
  • startIndex
  • nrOfResults
  • publicOnly
| The optional query paramaters.
  • Free text search string
  • Search results will be returned starting from this index.
  • Number of results that will be returned.
  • If true exclude fields which were marked as non public in the record's Profiles
| *optional* | Returns: | Type | Description | @@ -143,8 +143,12 @@ w3...0k ## ```mediahaven.resources.base_resource``` + ### ```MediahavenSingleObject()``` Represents a single result. + + + ### ```MediahavenPageObject()``` Represents a paged result. ### ```MediahavenPageObject.next_page()``` @@ -188,7 +192,9 @@ w3...0k -### ```MediahavenPageObject.has_more()``` +#### Properties + +### ```MediahavenPageObject.has_more``` Returns: | Type | Description | | ---- | ----------- | @@ -208,7 +214,7 @@ True -### ```MediahavenPageObject.nr_of_results()``` +### ```MediahavenPageObject.nr_of_results``` Returns: | Type | Description | | ---- | ----------- | @@ -224,7 +230,7 @@ Returns: -### ```MediahavenPageObject.total_nr_of_results()``` +### ```MediahavenPageObject.total_nr_of_results``` Returns: | Type | Description | | ---- | ----------- | @@ -240,7 +246,7 @@ Returns: -### ```MediahavenPageObject.start_index()``` +### ```MediahavenPageObject.start_index``` Returns: | Type | Description | | ---- | ----------- | @@ -256,7 +262,7 @@ Returns: -### ```MediahavenPageObject.raw_response()``` +### ```MediahavenPageObject.raw_response``` Returns: | Type | Description | | ---- | ----------- | From 01a078a5c38a913947ca8f571a5e354dc4b7a71a Mon Sep 17 00:00:00 2001 From: lennertvandevelde Date: Wed, 5 Apr 2023 10:24:21 +0200 Subject: [PATCH 05/12] MHPY-10 Automatic Doc generation --- README.md | 285 +------------ docs/mediahaven/index.md | 34 ++ docs/mediahaven/mediahaven.md | 57 +++ docs/mediahaven/oauth2.md | 157 +++++++ docs/mediahaven/resources/base_resource.md | 453 +++++++++++++++++++++ docs/mediahaven/resources/index.md | 15 + docs/mediahaven/resources/records.md | 161 ++++++++ generate_doc.sh | 5 + 8 files changed, 891 insertions(+), 276 deletions(-) create mode 100644 docs/mediahaven/index.md create mode 100644 docs/mediahaven/mediahaven.md create mode 100644 docs/mediahaven/oauth2.md create mode 100644 docs/mediahaven/resources/base_resource.md create mode 100644 docs/mediahaven/resources/index.md create mode 100644 docs/mediahaven/resources/records.md create mode 100644 generate_doc.sh diff --git a/README.md b/README.md index fbf3f02..2dbf973 100644 --- a/README.md +++ b/README.md @@ -1,279 +1,12 @@ -# MediaHaven Python Library +# Mediahaven-python Index -## Synopsis +> Auto-generated documentation index. -The Mediahaven Python library provides a way to communicate with MediaHaven via the v2 REST API. -- [OAuth Client](#mediahavenoauth2) -- [Mediahaven Client](#mediahavenmediahaven) -- Resources - - [Organisations](#organisations) - - [Fields](#fields) - - [Records](#records) -## ```mediahaven.oauth2``` -### ```ROPCGrant()``` -Parameters: -| Name | Description | Default | -| ---- | ----------- | ------- | -| mh_base_url | the Mediahaven base URL.
```str``` | *required* | -| client_id | Mediahaven Client id.
```str``` | *required* | -| client_secret | Mediahaven Client secret.
```str``` | *required* | +A full list of `Mediahaven-python` project modules. -
- Code example - -```python ->>> import os ->>> from mediahaven.oauth2 import ROPCGrant, RequestTokenError - ->>> # Get the credentials from env vars. ->>> client_id = os.environ["CLIENT_ID"] ->>> client_secret = os.environ["CLIENT_SECRET"] ->>> url = os.environ["MH_URL"] - ->>> # Create a ROPC grant ->>> grant = ROPCGrant(url, client_id, client_secret) -``` - -
- -### ```ROPCGrant.request_token()``` -Parameters: -| Name | Description | Default | -| ---- | ----------- | ------- | -| username | Mediahaven username.
```str``` | *required* | -| password | Mediahaven password.
```str``` | *required* | - - -
- Code example - -```python ->>> import os ->>> from mediahaven.oauth2 import ROPCGrant, RequestTokenError - ->>> # Get the credentials from env vars. ->>> username = os.environ["USERNAME"] ->>> password = os.environ["PASSWORD"] ->>> try: -... grant.request_token(username, password) -... except RequestTokenError as e: -... print(e) -``` - -
- -## ```mediahaven.mediahaven``` -### ```Mediahaven()``` -Parameters: -| Name | Description | Default | -| ---- | ----------- | ------- | -| mh_base_url | Mediahaven base URL.
```str``` | *required* | -| grant | OAuth2 Grant client.
[```ROPCGrant```](#ropcgrant) | *required* | - -
-Code example - -```python ->>> from mediahaven import MediaHaven - ->>> # Initialize the MH client ->>> client = MediaHaven(url, grant) -``` - -
- -### Records -### ```Mediahaven.records.get()``` -Parameters: -| Name | Description | Default | -| ---- | ----------- | ------- | -| record_id | MediaObjectId, FragmentId or RecordId.
```str``` | *required* | -| accept_format | The "Accept" request header.
```AcceptFormat```
JSON, XML, DUBLIN, METS or UNKOWN | JSON | - -Returns: -| Type | Description | -| ---- | ----------- | -| ```MediaHavenSingleObject``` | A single record. | - - -
-Code example - -```python ->>> from mediahaven import MediaHaven - ->>> # Get record based on record ID ->>> record = client.records.get("570...33b") ->>> print(record.Internal.ArchiveStatus) -on_disk ->>> print(record.Dynamic.PID) -qs...8q -``` - -
- -### ```Mediahaven.records.search()``` -Parameters: -| Name | Description | Default | -| ---- | ----------- | ------- | -| accept_format | The "Accept" request header.
```AcceptFormat```
JSON, XML, DUBLIN, METS or UNKOWN | JSON | -| **query_params
  • q
  • startIndex
  • nrOfResults
  • publicOnly
| The optional query paramaters.
  • Free text search string
  • Search results will be returned starting from this index.
  • Number of results that will be returned.
  • If true exclude fields which were marked as non public in the record's Profiles
| *optional* | - -Returns: -| Type | Description | -| ---- | ----------- | -| [```MediaHavenPageObject```](#mediahavenpageobject) | A paged result with the records. | - -
- Code example - -```python ->>> # Get page based on query ->>> records_page = client.records.search(q="+(batch_id:FLMB15)", nrOfResults=10, startIndex=0) ->>> print(records_page.nr_of_results) -10 ->>> print(records_page.total_nr_of_results) -22 ->>> print(records_page.start_index) -0 ->>> print(records_page[0].Dynamic.PID) -w3...0k -``` - -
- -## ```mediahaven.resources.base_resource``` - -### ```MediahavenSingleObject()``` -Represents a single result. - - - -### ```MediahavenPageObject()``` -Represents a paged result. -### ```MediahavenPageObject.next_page()``` -Fetches the next page. - -Returns: -| Type | Description | -| ---- | ----------- | -| [```MediahavenPageObject```](#mediahavenpageobject) | The next page. | - -
-Code example - -```python ->>> # Get next page ->>> next_page = current_page.next_page() -``` - -
- -### ```MediahavenPageObject.as_generator()``` -Returns a generator for all the result items spread over all the pages. - -Returns: -| Type | Description | -| ---- | ----------- | -| ```Generator``` | A generator for all result items. | - -
-Code example - -```python ->>> # Work via generator ->>> for record in records_page.as_generator(): -... print(record.Dynamic.PID) -... -w3...0k - -9s...5t -``` - -
- -#### Properties - -### ```MediahavenPageObject.has_more``` -Returns: -| Type | Description | -| ---- | ----------- | -| ```bool``` | A boolean indicating if there are more pages. | - -Raises -| Type | Description | -| ---- | ----------- | -| ```NoMorePagesException``` | When there are no pages left. | -
-Code example - -```python ->>> print(records_page.has_more) -True -``` - -
- -### ```MediahavenPageObject.nr_of_results``` -Returns: -| Type | Description | -| ---- | ----------- | -| ```int``` | Number of results on current page. | - -
-Code example - -```python ->>> print(current_page.nr_of_results) -10 -``` - -
- -### ```MediahavenPageObject.total_nr_of_results``` -Returns: -| Type | Description | -| ---- | ----------- | -| ```int``` | Total number of results of query. | - -
-Code example - -```python ->>> print(current_page.total_nr_of_results) -10 -``` - -
- -### ```MediahavenPageObject.start_index``` -Returns: -| Type | Description | -| ---- | ----------- | -| ```int``` | Current page's start index. | - -
-Code example - -```python ->>> print(current_page.start_index) -10 -``` - -
- -### ```MediahavenPageObject.raw_response``` -Returns: -| Type | Description | -| ---- | ----------- | -| ```str``` | Raw response text. | - -
-Code example - -```python ->>> print(current_page.raw_response) -{...} -``` - -
\ No newline at end of file +- [MediaHaven](docs/mediahaven/index.md#mediahaven) + - [Mediahaven](docs/mediahaven/mediahaven.md#mediahaven) + - [Oauth2](docs/mediahaven/oauth2.md#oauth2) + - [Resources](docs/mediahaven/resources/index.md#resources) + - [BaseResource](docs/mediahaven/resources/base_resource.md#baseresource) + - [Records](docs/mediahaven/resources/records.md#records) diff --git a/docs/mediahaven/index.md b/docs/mediahaven/index.md new file mode 100644 index 0000000..b08ebd0 --- /dev/null +++ b/docs/mediahaven/index.md @@ -0,0 +1,34 @@ +# MediaHaven + +[Mediahaven-python Index](../README.md#mediahaven-python-index) / +MediaHaven + +> Auto-generated documentation for [mediahaven](../../mediahaven/__init__.py) module. + +- [MediaHaven](#mediahaven) + - [MediaHaven](#mediahaven-1) + - [Modules](#modules) + +## MediaHaven + +[Show source in __init__.py:10](../../mediahaven/__init__.py#L10) + +#### Signature + +```python +class MediaHaven(MediaHavenClient): + def __init__(self, *args, **kwargs): + ... +``` + +#### See also + +- [MediaHavenClient](./mediahaven.md#mediahavenclient) + + + +## Modules + +- [Mediahaven](./mediahaven.md) +- [Oauth2](./oauth2.md) +- [Resources](resources/index.md) \ No newline at end of file diff --git a/docs/mediahaven/mediahaven.md b/docs/mediahaven/mediahaven.md new file mode 100644 index 0000000..813e39b --- /dev/null +++ b/docs/mediahaven/mediahaven.md @@ -0,0 +1,57 @@ +# Mediahaven + +[Mediahaven-python Index](../README.md#mediahaven-python-index) / +[MediaHaven](./index.md#mediahaven) / +Mediahaven + +> Auto-generated documentation for [mediahaven.mediahaven](../../mediahaven/mediahaven.py) module. + +- [Mediahaven](#mediahaven) + - [AcceptFormat](#acceptformat) + - [MediaHavenClient](#mediahavenclient) + - [MediaHavenException](#mediahavenexception) + +## AcceptFormat + +[Show source in mediahaven.py:32](../../mediahaven/mediahaven.py#L32) + +#### Signature + +```python +class AcceptFormat(Enum): + ... +``` + + + +## MediaHavenClient + +[Show source in mediahaven.py:43](../../mediahaven/mediahaven.py#L43) + +The MediaHaven client class to communicate with MediaHaven. + +#### Signature + +```python +class MediaHavenClient: + def __init__(self, mh_base_url: str, grant: OAuth2Grant): + ... +``` + +#### See also + +- [OAuth2Grant](./oauth2.md#oauth2grant) + + + +## MediaHavenException + +[Show source in mediahaven.py:26](../../mediahaven/mediahaven.py#L26) + +#### Signature + +```python +class MediaHavenException(Exception): + def __init__(self, message: str, status_code: int = None): + ... +``` \ No newline at end of file diff --git a/docs/mediahaven/oauth2.md b/docs/mediahaven/oauth2.md new file mode 100644 index 0000000..b334b7d --- /dev/null +++ b/docs/mediahaven/oauth2.md @@ -0,0 +1,157 @@ +# Oauth2 + +[Mediahaven-python Index](../README.md#mediahaven-python-index) / +[MediaHaven](./index.md#mediahaven) / +Oauth2 + +> Auto-generated documentation for [mediahaven.oauth2](../../mediahaven/oauth2.py) module. + +- [Oauth2](#oauth2) + - [NoTokenError](#notokenerror) + - [OAuth2Grant](#oauth2grant) + - [OAuth2Grant().refresh_token](#oauth2grant()refresh_token) + - [OAuth2Grant().request_token](#oauth2grant()request_token) + - [ROPCGrant](#ropcgrant) + - [ROPCGrant().request_token](#ropcgrant()request_token) + - [RefreshTokenError](#refreshtokenerror) + - [RequestTokenError](#requesttokenerror) + +## NoTokenError + +[Show source in oauth2.py:38](../../mediahaven/oauth2.py#L38) + +Raised when a token has not been requested yet. + +#### Signature + +```python +class NoTokenError(Exception): + def __init__(self): + ... +``` + + + +## OAuth2Grant + +[Show source in oauth2.py:45](../../mediahaven/oauth2.py#L45) + +Abstract class representing an OAuth2 grant used in MediaHaven. + +#### Signature + +```python +class OAuth2Grant(ABC): + def __init__(self, mh_base_url: str, client_id: str, client_secret: str): + ... +``` + +### OAuth2Grant().refresh_token + +[Show source in oauth2.py:67](../../mediahaven/oauth2.py#L67) + +Refresh the OAuth2 token with the saved refresh token. + +Issues a new access token but also a new refresh token. + +#### Signature + +```python +def refresh_token(self): + ... +``` + +### OAuth2Grant().request_token + +[Show source in oauth2.py:63](../../mediahaven/oauth2.py#L63) + +#### Signature + +```python +@abstractmethod +def request_token(self): + ... +``` + + + +## ROPCGrant + +[Show source in oauth2.py:96](../../mediahaven/oauth2.py#L96) + +Represents a "Resource Owner Password Credential" grant. + +#### Signature + +```python +class ROPCGrant(OAuth2Grant): + def __init__(self, mh_base_url: str, client_id: str, client_secret: str): + ... +``` + +#### See also + +- [OAuth2Grant](#oauth2grant) + +### ROPCGrant().request_token + +[Show source in oauth2.py:104](../../mediahaven/oauth2.py#L104) + +Request an OAuth2 token. + +The resource owner grants the client the authorization to execute the +requests on its behalf. Given the credentials of the resource owner, an auth +token is issued by the authorization server. This token will be saved in memory +and used by the session in order to execute authorized requests. + +#### Arguments + +- `username` - The username of the resource owner. +- `password` - The password of the resource owner. + +#### Raises + +- `RequestTokenException` - When an error occurred when requesting the token. + +#### Signature + +```python +def request_token(self, username: str, password: str): + ... +``` + + + +## RefreshTokenError + +[Show source in oauth2.py:28](../../mediahaven/oauth2.py#L28) + +Raised when an error occurred during token request. + +Abstracts the underlying OAuthlib2 errors. + +#### Signature + +```python +class RefreshTokenError(Exception): + def __init__(self): + ... +``` + + + +## RequestTokenError + +[Show source in oauth2.py:18](../../mediahaven/oauth2.py#L18) + +Raised when an error occurred during token request. + +Abstracts the underlying OAuthlib2 errors. + +#### Signature + +```python +class RequestTokenError(Exception): + def __init__(self): + ... +``` \ No newline at end of file diff --git a/docs/mediahaven/resources/base_resource.md b/docs/mediahaven/resources/base_resource.md new file mode 100644 index 0000000..9361a98 --- /dev/null +++ b/docs/mediahaven/resources/base_resource.md @@ -0,0 +1,453 @@ +# BaseResource + +[Mediahaven-python Index](../../README.md#mediahaven-python-index) / +[MediaHaven](../index.md#mediahaven) / +[Resources](./index.md#resources) / +BaseResource + +> Auto-generated documentation for [mediahaven.resources.base_resource](../../../mediahaven/resources/base_resource.py) module. + +- [BaseResource](#baseresource) + - [BaseResource](#baseresource-1) + - [BaseResource().mh_client](#baseresource()mh_client) + - [BaseResource().name](#baseresource()name) + - [MediaHavenPageObject](#mediahavenpageobject) + - [MediaHavenPageObject().as_generator](#mediahavenpageobject()as_generator) + - [MediaHavenPageObject().has_more](#mediahavenpageobject()has_more) + - [MediaHavenPageObject().next_page](#mediahavenpageobject()next_page) + - [MediaHavenPageObject().nr_of_results](#mediahavenpageobject()nr_of_results) + - [MediaHavenPageObject().page_result](#mediahavenpageobject()page_result) + - [MediaHavenPageObject().raw_response](#mediahavenpageobject()raw_response) + - [MediaHavenPageObject().start_index](#mediahavenpageobject()start_index) + - [MediaHavenPageObject().total_nr_of_results](#mediahavenpageobject()total_nr_of_results) + - [MediaHavenPageObjectCreator](#mediahavenpageobjectcreator) + - [MediaHavenPageObjectCreator.create_object](#mediahavenpageobjectcreatorcreate_object) + - [MediaHavenPageObjectJSON](#mediahavenpageobjectjson) + - [MediaHavenPageObjectJSON().as_generator](#mediahavenpageobjectjson()as_generator) + - [MediaHavenPageObjectJSON().next_page](#mediahavenpageobjectjson()next_page) + - [MediaHavenSingleObject](#mediahavensingleobject) + - [MediaHavenSingleObject().raw_response](#mediahavensingleobject()raw_response) + - [MediaHavenSingleObject().single_result](#mediahavensingleobject()single_result) + - [MediaHavenSingleObjectCreator](#mediahavensingleobjectcreator) + - [MediaHavenSingleObjectCreator.create_object](#mediahavensingleobjectcreatorcreate_object) + - [MediaHavenSingleObjectJSON](#mediahavensingleobjectjson) + - [NoMorePagesException](#nomorepagesexception) + +## BaseResource + +[Show source in base_resource.py:13](../../../mediahaven/resources/base_resource.py#L13) + +Base API endpoint of a MediaHaven resource. + +#### Attributes + +- `_mh_client` - The MediaHaven client used to execute requests. +- `_name` - The name of the resource. + +#### Signature + +```python +class BaseResource: + def __init__(self, mh_client: MediaHavenClient): + ... +``` + +#### See also + +- [MediaHavenClient](../mediahaven.md#mediahavenclient) + +### BaseResource().mh_client + +[Show source in base_resource.py:34](../../../mediahaven/resources/base_resource.py#L34) + +#### Signature + +```python +@property +def mh_client(self): + ... +``` + +### BaseResource().name + +[Show source in base_resource.py:30](../../../mediahaven/resources/base_resource.py#L30) + +#### Signature + +```python +@property +def name(self): + ... +``` + + + +## MediaHavenPageObject + +[Show source in base_resource.py:125](../../../mediahaven/resources/base_resource.py#L125) + +Represents a paged result. + +As this is a paged result, other pages could be available. The resource which +executed the request together with query parameters are passed as arguments in +other to potentially execute subsequent page requests. + +#### Attributes + +- `_start_index` - The start index of the executed search request. +- `_nr_of_results` - The number of results of the search result. +- `_total_nr_of_results` - The total number of results of search request. +- `_has_more` - Indicating if there are more pages left. +- `_resource` - The resource that executed the request. +- `_query_params` - The query parameters used in the request. +- `_raw_response` - The raw body of the response. +- `_page_result` - The payload of the response transformed depending on the type. + +#### Signature + +```python +class MediaHavenPageObject(ABC): + def __init__(self, response: Response, resource: BaseResource, **query_params): + ... +``` + +#### See also + +- [BaseResource](#baseresource) + +### MediaHavenPageObject().as_generator + +[Show source in base_resource.py:172](../../../mediahaven/resources/base_resource.py#L172) + +Returns a generator for all the result items spread over all the pages. + +#### Returns + +A generator. + +#### Signature + +```python +@abstractmethod +def as_generator(self) -> Generator[Union[SimpleNamespace, str], None, None]: + ... +``` + +### MediaHavenPageObject().has_more + +[Show source in base_resource.py:185](../../../mediahaven/resources/base_resource.py#L185) + +#### Signature + +```python +@property +def has_more(self): + ... +``` + +### MediaHavenPageObject().next_page + +[Show source in base_resource.py:160](../../../mediahaven/resources/base_resource.py#L160) + +Fetches the next page. + +#### Returns + +The next page. + +#### Raises + +NoMorePagesException if there are no pages left. + +#### Signature + +```python +@abstractmethod +def next_page(self) -> MediaHavenPageObject: + ... +``` + +### MediaHavenPageObject().nr_of_results + +[Show source in base_resource.py:189](../../../mediahaven/resources/base_resource.py#L189) + +#### Signature + +```python +@property +def nr_of_results(self): + ... +``` + +### MediaHavenPageObject().page_result + +[Show source in base_resource.py:181](../../../mediahaven/resources/base_resource.py#L181) + +#### Signature + +```python +@property +def page_result(self): + ... +``` + +### MediaHavenPageObject().raw_response + +[Show source in base_resource.py:201](../../../mediahaven/resources/base_resource.py#L201) + +#### Signature + +```python +@property +def raw_response(self): + ... +``` + +### MediaHavenPageObject().start_index + +[Show source in base_resource.py:197](../../../mediahaven/resources/base_resource.py#L197) + +#### Signature + +```python +@property +def start_index(self): + ... +``` + +### MediaHavenPageObject().total_nr_of_results + +[Show source in base_resource.py:193](../../../mediahaven/resources/base_resource.py#L193) + +#### Signature + +```python +@property +def total_nr_of_results(self): + ... +``` + + + +## MediaHavenPageObjectCreator + +[Show source in base_resource.py:243](../../../mediahaven/resources/base_resource.py#L243) + +Factory class for creating an object which is a subclass of MediaHavenPageObject. + +#### Signature + +```python +class MediaHavenPageObjectCreator: + ... +``` + +### MediaHavenPageObjectCreator.create_object + +[Show source in base_resource.py:246](../../../mediahaven/resources/base_resource.py#L246) + +Create a MediaHavenPageObject. + +As this is a paged result, other pages could be available. The resource which +executed the request together with query parameters are passed as arguments in +other to potentially execute subsequent page requests. + +#### Arguments + +- `response` - The HTTP response. +- `accept_format` - To determine the format of the result (XML/JSON). +- `resource` - The resource that executed the initial request. +- `**query_params` - The optional query parameters. + +#### Returns + +The MediaHavenPageObject. + +#### Raises + +- `NotImplementedError` - When passing an XML format. + +#### Signature + +```python +@staticmethod +def create_object( + response: Response, + accept_format: AcceptFormat, + resource: BaseResource, + **query_params +) -> MediaHavenPageObject: + ... +``` + +#### See also + +- [AcceptFormat](../mediahaven.md#acceptformat) +- [BaseResource](#baseresource) +- [MediaHavenPageObject](#mediahavenpageobject) + + + +## MediaHavenPageObjectJSON + +[Show source in base_resource.py:206](../../../mediahaven/resources/base_resource.py#L206) + +#### Signature + +```python +class MediaHavenPageObjectJSON(MediaHavenPageObject): + def __init__(self, response: Response, resource: BaseResource, **query_params): + ... +``` + +#### See also + +- [BaseResource](#baseresource) +- [MediaHavenPageObject](#mediahavenpageobject) + +### MediaHavenPageObjectJSON().as_generator + +[Show source in base_resource.py:231](../../../mediahaven/resources/base_resource.py#L231) + +#### Signature + +```python +def as_generator(self) -> Generator[SimpleNamespace, None, None]: + ... +``` + +### MediaHavenPageObjectJSON().next_page + +[Show source in base_resource.py:223](../../../mediahaven/resources/base_resource.py#L223) + +#### Signature + +```python +def next_page(self) -> MediaHavenPageObjectJSON: + ... +``` + + + +## MediaHavenSingleObject + +[Show source in base_resource.py:61](../../../mediahaven/resources/base_resource.py#L61) + +Represents a single result. + +#### Attributes + +- `_raw_response` - The raw body of the response. +- `_single_result` - The payload of the response transformed depending on the type. + +#### Signature + +```python +class MediaHavenSingleObject(ABC): + def __init__(self, response: Response): + ... +``` + +### MediaHavenSingleObject().raw_response + +[Show source in base_resource.py:82](../../../mediahaven/resources/base_resource.py#L82) + +#### Signature + +```python +@property +def raw_response(self): + ... +``` + +### MediaHavenSingleObject().single_result + +[Show source in base_resource.py:78](../../../mediahaven/resources/base_resource.py#L78) + +#### Signature + +```python +@property +def single_result(self): + ... +``` + + + +## MediaHavenSingleObjectCreator + +[Show source in base_resource.py:98](../../../mediahaven/resources/base_resource.py#L98) + +Factory class for creating an object which is a subclass of MediaHavenSingleObject. + +#### Signature + +```python +class MediaHavenSingleObjectCreator: + ... +``` + +### MediaHavenSingleObjectCreator.create_object + +[Show source in base_resource.py:101](../../../mediahaven/resources/base_resource.py#L101) + +Create a MediaHavenSingleObject. + +#### Arguments + +- `response` - The HTTP response. + +#### Returns + +The MediaHavenSingleObject. + +#### Raises + +- `NotImplementedError` - When passing an XML format. + +#### Signature + +```python +@staticmethod +def create_object( + response: Response, accept_format: AcceptFormat +) -> MediaHavenSingleObject: + ... +``` + +#### See also + +- [AcceptFormat](../mediahaven.md#acceptformat) +- [MediaHavenSingleObject](#mediahavensingleobject) + + + +## MediaHavenSingleObjectJSON + +[Show source in base_resource.py:87](../../../mediahaven/resources/base_resource.py#L87) + +#### Signature + +```python +class MediaHavenSingleObjectJSON(MediaHavenSingleObject): + def __init__(self, response: Response): + ... +``` + +#### See also + +- [MediaHavenSingleObject](#mediahavensingleobject) + + + +## NoMorePagesException + +[Show source in base_resource.py:120](../../../mediahaven/resources/base_resource.py#L120) + +#### Signature + +```python +class NoMorePagesException(Exception): + def __init__(self): + ... +``` \ No newline at end of file diff --git a/docs/mediahaven/resources/index.md b/docs/mediahaven/resources/index.md new file mode 100644 index 0000000..6a665c3 --- /dev/null +++ b/docs/mediahaven/resources/index.md @@ -0,0 +1,15 @@ +# Resources + +[Mediahaven-python Index](../../README.md#mediahaven-python-index) / +[MediaHaven](../index.md#mediahaven) / +Resources + +> Auto-generated documentation for [mediahaven.resources](../../../mediahaven/resources/__init__.py) module. + +- [Resources](#resources) + - [Modules](#modules) + +## Modules + +- [BaseResource](./base_resource.md) +- [Records](./records.md) \ No newline at end of file diff --git a/docs/mediahaven/resources/records.md b/docs/mediahaven/resources/records.md new file mode 100644 index 0000000..1dd4083 --- /dev/null +++ b/docs/mediahaven/resources/records.md @@ -0,0 +1,161 @@ +# Records + +[Mediahaven-python Index](../../README.md#mediahaven-python-index) / +[MediaHaven](../index.md#mediahaven) / +[Resources](./index.md#resources) / +Records + +> Auto-generated documentation for [mediahaven.resources.records](../../../mediahaven/resources/records.py) module. + +- [Records](#records) + - [Records](#records-1) + - [Records().count](#records()count) + - [Records().delete](#records()delete) + - [Records().get](#records()get) + - [Records().search](#records()search) + - [Records().update](#records()update) + +## Records + +[Show source in records.py:14](../../../mediahaven/resources/records.py#L14) + +Public API endpoint of a MediaHaven record. + +#### Signature + +```python +class Records(BaseResource): + def __init__(self, *args, **kwargs): + ... +``` + +#### See also + +- [BaseResource](./base_resource.md#baseresource) + +### Records().count + +[Show source in records.py:21](../../../mediahaven/resources/records.py#L21) + +Counts the amount the records given a query string. + +#### Arguments + +- `query` - Free text search string. + +#### Returns + +The amount of records. + +#### Signature + +```python +def count(self, query: str) -> int: + ... +``` + +### Records().delete + +[Show source in records.py:80](../../../mediahaven/resources/records.py#L80) + +Delete a record. + +#### Arguments + +- `record_id` - The ID of the record to remove. + It can be either a MediaObjectId, FragmentId or RecordId. +- `reason` - The reason to delete the record. +- `event_type` - A custom subtype for the delete event. + +#### Signature + +```python +def delete(self, record_id: str, reason: str = None, event_type: str = None): + ... +``` + +### Records().get + +[Show source in records.py:35](../../../mediahaven/resources/records.py#L35) + +Get a single record. + +#### Arguments + +- `record_id` - It can either be a MediaObjectId, FragmentId or RecordId. +- `accept_format` - The "Accept" request header + +#### Returns + +A single record. + +#### Signature + +```python +def get( + self, record_id: str, accept_format=DEFAULT_ACCEPT_FORMAT +) -> MediaHavenSingleObject: + ... +``` + +#### See also + +- [DEFAULT_ACCEPT_FORMAT](../mediahaven.md#default_accept_format) +- [MediaHavenSingleObject](./base_resource.md#mediahavensingleobject) + +### Records().search + +[Show source in records.py:53](../../../mediahaven/resources/records.py#L53) + +Search for multiple records. + +#### Arguments + +- `accept_format` - The "Accept" request header. +- `**query_params` - The optional query paramaters: + - `query_params["q"]` - Free text search string. + - `query_params["startIndex"]` - Used for pagination of search results, + search results will be returned starting from this index. + - `query_params["nrOfResults"]` - the number of results that will be returned + - `query_params["publicOnly"]` - if true exclude from the output dynamic + metadata fields which were marked as non public in the Profiles + linked with the record. + +#### Returns + +A paged result with the records. + +#### Signature + +```python +def search( + self, accept_format=DEFAULT_ACCEPT_FORMAT, **query_params +) -> MediaHavenPageObject: + ... +``` + +#### See also + +- [DEFAULT_ACCEPT_FORMAT](../mediahaven.md#default_accept_format) +- [MediaHavenPageObject](./base_resource.md#mediahavenpageobject) + +### Records().update + +[Show source in records.py:102](../../../mediahaven/resources/records.py#L102) + +Update a record. + +#### Arguments + +- `record_id` - The ID of the record to remove. + It can be either a MediaObjectId, FragmentId or RecordId. +- `json` - The JSON payload. +- `xml` - The XML payload. +- `**form_data` - The payload as multipart/form-data. + +#### Signature + +```python +def update(self, record_id: str, json: dict = None, xml: str = None, **form_data): + ... +``` \ No newline at end of file diff --git a/generate_doc.sh b/generate_doc.sh new file mode 100644 index 0000000..777ee64 --- /dev/null +++ b/generate_doc.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +handsdown +mv docs/README.md . +sed -i 's/mediahaven\//docs\/mediahaven\//g' README.md \ No newline at end of file From a413023421948ddde4acf5fc4d2e3235bb8481b8 Mon Sep 17 00:00:00 2001 From: lennertvandevelde Date: Wed, 5 Apr 2023 10:29:59 +0200 Subject: [PATCH 06/12] MHPY-10 Change linking between README and files --- docs/mediahaven/index.md | 2 +- docs/mediahaven/mediahaven.md | 2 +- docs/mediahaven/oauth2.md | 2 +- docs/mediahaven/resources/base_resource.md | 2 +- docs/mediahaven/resources/index.md | 2 +- docs/mediahaven/resources/records.md | 2 +- generate_doc.sh | 3 ++- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/mediahaven/index.md b/docs/mediahaven/index.md index b08ebd0..2149760 100644 --- a/docs/mediahaven/index.md +++ b/docs/mediahaven/index.md @@ -1,6 +1,6 @@ # MediaHaven -[Mediahaven-python Index](../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../../README.md#mediahaven-python-index) / MediaHaven > Auto-generated documentation for [mediahaven](../../mediahaven/__init__.py) module. diff --git a/docs/mediahaven/mediahaven.md b/docs/mediahaven/mediahaven.md index 813e39b..a58d98e 100644 --- a/docs/mediahaven/mediahaven.md +++ b/docs/mediahaven/mediahaven.md @@ -1,6 +1,6 @@ # Mediahaven -[Mediahaven-python Index](../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../../README.md#mediahaven-python-index) / [MediaHaven](./index.md#mediahaven) / Mediahaven diff --git a/docs/mediahaven/oauth2.md b/docs/mediahaven/oauth2.md index b334b7d..0090599 100644 --- a/docs/mediahaven/oauth2.md +++ b/docs/mediahaven/oauth2.md @@ -1,6 +1,6 @@ # Oauth2 -[Mediahaven-python Index](../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../../README.md#mediahaven-python-index) / [MediaHaven](./index.md#mediahaven) / Oauth2 diff --git a/docs/mediahaven/resources/base_resource.md b/docs/mediahaven/resources/base_resource.md index 9361a98..5039646 100644 --- a/docs/mediahaven/resources/base_resource.md +++ b/docs/mediahaven/resources/base_resource.md @@ -1,6 +1,6 @@ # BaseResource -[Mediahaven-python Index](../../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../../../README.md#mediahaven-python-index) / [MediaHaven](../index.md#mediahaven) / [Resources](./index.md#resources) / BaseResource diff --git a/docs/mediahaven/resources/index.md b/docs/mediahaven/resources/index.md index 6a665c3..3fb9fe8 100644 --- a/docs/mediahaven/resources/index.md +++ b/docs/mediahaven/resources/index.md @@ -1,6 +1,6 @@ # Resources -[Mediahaven-python Index](../../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../../../README.md#mediahaven-python-index) / [MediaHaven](../index.md#mediahaven) / Resources diff --git a/docs/mediahaven/resources/records.md b/docs/mediahaven/resources/records.md index 1dd4083..2068e99 100644 --- a/docs/mediahaven/resources/records.md +++ b/docs/mediahaven/resources/records.md @@ -1,6 +1,6 @@ # Records -[Mediahaven-python Index](../../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../../../README.md#mediahaven-python-index) / [MediaHaven](../index.md#mediahaven) / [Resources](./index.md#resources) / Records diff --git a/generate_doc.sh b/generate_doc.sh index 777ee64..d532569 100644 --- a/generate_doc.sh +++ b/generate_doc.sh @@ -2,4 +2,5 @@ handsdown mv docs/README.md . -sed -i 's/mediahaven\//docs\/mediahaven\//g' README.md \ No newline at end of file +sed -i 's/mediahaven\//docs\/mediahaven\//g' README.md +find docs/ -type f -exec sed -i 's/\.\.\/README\.md/..\/..\/README.md/g' {} \; \ No newline at end of file From 699ad0f7095efa8c3f6308622425478e85a0af86 Mon Sep 17 00:00:00 2001 From: lennertvandevelde Date: Thu, 29 Sep 2022 16:02:37 +0200 Subject: [PATCH 07/12] MHPY-10 Add README file structure --- README.md | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 110 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a6cfdf5..e94279c 100644 --- a/README.md +++ b/README.md @@ -3,22 +3,42 @@ ## Synopsis The Mediahaven Python library provides a way to communicate with MediaHaven via the v2 REST API. +- [OAuth Client](#mediahavenoauth2) +- [Mediahaven Client](#mediahavenmediahaven) +- Resources + - [Organisations](#organisations) + - [Fields](#fields) + - [Records](#records) +## ```mediahaven.oauth2``` +### ```ROPCGrant()``` +Parameters: +| Name | Description | Default | +| ---- | ----------- | ------- | +| mh_base_url | the Mediahaven base URL.
```str``` | *required* | +| client_id | Mediahaven Client id.
```str``` | *required* | +| client_secret | Mediahaven Client secret.
```str``` | *required* | -## Usage +
+ Code example ```python >>> import os ->>> ->>> from mediahaven import MediaHaven >>> from mediahaven.oauth2 import ROPCGrant, RequestTokenError ->>> + +>>> # Get the credentials from env vars. +>>> client_id = os.environ["CLIENT_ID"] +>>> client_secret = os.environ["CLIENT_SECRET"] +>>> username = os.environ["USERNAME"] +>>> password = os.environ["PASSWORD"] +>>> url = os.environ["MH_URL"] + >>> # Get the credentials from env vars. >>> client_id = os.environ["CLIENT_ID"] >>> client_secret = os.environ["CLIENT_SECRET"] >>> username = os.environ["USERNAME"] >>> password = os.environ["PASSWORD"] >>> url = os.environ["MH_URL"] ->>> + >>> # Create a ROPC grant >>> grant = ROPCGrant(url, client_id, client_secret) >>> # Request a token @@ -26,9 +46,75 @@ The Mediahaven Python library provides a way to communicate with MediaHaven via ... grant.request_token(username, password) ... except RequestTokenError as e: ... print(e) -... +``` + +
+ +### ```ROPCGrant.request_token()``` +Parameters: +| Name | Description | Default | +| ---- | ----------- | ------- | +| username | Mediahaven username.
```str``` | *required* | +| password | Mediahaven password.
```str``` | *required* | + + +
+ Code example + +```python +>>> import os +>>> from mediahaven.oauth2 import ROPCGrant, RequestTokenError + +>>> # Get the credentials from env vars. +>>> username = os.environ["USERNAME"] +>>> password = os.environ["PASSWORD"] +>>> try: +... grant.request_token(username, password) +... except RequestTokenError as e: +... print(e) +``` + +
+ +## ```mediahaven.mediahaven``` +### ```Mediahaven()``` +Parameters: +| Name | Description | Default | +| ---- | ----------- | ------- | +| mh_base_url | Mediahaven base URL.
```str``` | *required* | +| grant | OAuth2 Grant client.
[```ROPCGrant```](#ropcgrant) | *required* | + +
+Code example + +```python +>>> from mediahaven import MediaHaven + >>> # Initialize the MH client >>> client = MediaHaven(url, grant) +``` + +
+ +### Records +### ```Mediahaven.records.get()``` +Parameters: +| Name | Description | Default | +| ---- | ----------- | ------- | +| record_id | MediaObjectId, FragmentId or RecordId.
```str``` | *required* | +| accept_format | The "Accept" request header.
```AcceptFormat```
JSON, XML, DUBLIN, METS or UNKOWN | JSON | + +Returns: +| Type | Description | +| ---- | ----------- | +| ```MediaHavenSingleObject``` | A single record. | + + +
+Code example + +```python +>>> from mediahaven import MediaHaven >>> # Get record based on record ID >>> record = client.records.get("570...33b") @@ -36,7 +122,23 @@ The Mediahaven Python library provides a way to communicate with MediaHaven via on_disk >>> print(record.Dynamic.PID) qs...8q +``` +
+ +### ```Mediahaven.records.search()``` +Parameters: +| Name | Description | Default | +| ---- | ----------- | ------- | +| accept_format | The "Accept" request header.
```AcceptFormat```
JSON, XML, DUBLIN, METS or UNKOWN | JSON | +| **query_params
  • q
  • startIndex
  • nrOfResults
  • publicOnly
| MediaObjectId, FragmentId or RecordId.
  • Free text search string
  • Search results will be returned starting from this index.
  • Number of results that will be returned.
  • If true exclude fields which were marked as non public in the record's Profiles
| *optional* | + +Returns: +| Type | Description | +| ---- | ----------- | +| ```MediaHavenPageObject``` | A paged result with the records. | + +```python >>> # Get page based on query >>> records_page = client.records.search(q="+(batch_id:FLMB15)", nrOfResults=10, startIndex=0) >>> print(records_page.nr_of_results) @@ -47,7 +149,8 @@ qs...8q 0 >>> print(records_page[0].Dynamic.PID) w3...0k - +``` +```python >>> # Get next page >>> print(records_page.has_more) True From 94a4bfd405c5e0f3a674fac5112663e85ff1505a Mon Sep 17 00:00:00 2001 From: lennertvandevelde Date: Thu, 29 Sep 2022 16:08:07 +0200 Subject: [PATCH 08/12] MHPY-10 formatting --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e94279c..9e67c1e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ + + # MediaHaven Python Library ## Synopsis @@ -131,7 +137,7 @@ Parameters: | Name | Description | Default | | ---- | ----------- | ------- | | accept_format | The "Accept" request header.
```AcceptFormat```
JSON, XML, DUBLIN, METS or UNKOWN | JSON | -| **query_params
  • q
  • startIndex
  • nrOfResults
  • publicOnly
| MediaObjectId, FragmentId or RecordId.
  • Free text search string
  • Search results will be returned starting from this index.
  • Number of results that will be returned.
  • If true exclude fields which were marked as non public in the record's Profiles
| *optional* | +| **query_params
  • q
  • startIndex
  • nrOfResults
  • publicOnly
| The optional query paramaters.
  • Free text search string
  • Search results will be returned starting from this index.
  • Number of results that will be returned.
  • If true exclude fields which were marked as non public in the record's Profiles
| *optional* | Returns: | Type | Description | From 54a7d72ad1193d10d667c2afc2c2adff707cc006 Mon Sep 17 00:00:00 2001 From: lennertvandevelde Date: Wed, 5 Apr 2023 14:23:14 +0200 Subject: [PATCH 09/12] MHPY-10 Add other resources docs --- README.md | 2 + docs/mediahaven/index.md | 2 +- docs/mediahaven/mediahaven.md | 6 +- .../mediahaven/resources/field_definitions.md | 95 +++++++++++++++++++ docs/mediahaven/resources/index.md | 2 + docs/mediahaven/resources/organisations.md | 93 ++++++++++++++++++ docs/mediahaven/resources/records.md | 38 ++++++-- 7 files changed, 225 insertions(+), 13 deletions(-) create mode 100644 docs/mediahaven/resources/field_definitions.md create mode 100644 docs/mediahaven/resources/organisations.md diff --git a/README.md b/README.md index 2dbf973..62c8574 100644 --- a/README.md +++ b/README.md @@ -9,4 +9,6 @@ A full list of `Mediahaven-python` project modules. - [Oauth2](docs/mediahaven/oauth2.md#oauth2) - [Resources](docs/mediahaven/resources/index.md#resources) - [BaseResource](docs/mediahaven/resources/base_resource.md#baseresource) + - [FieldDefinitions](docs/mediahaven/resources/field_definitions.md#fielddefinitions) + - [Organisations](docs/mediahaven/resources/organisations.md#organisations) - [Records](docs/mediahaven/resources/records.md#records) diff --git a/docs/mediahaven/index.md b/docs/mediahaven/index.md index 2149760..9782c13 100644 --- a/docs/mediahaven/index.md +++ b/docs/mediahaven/index.md @@ -11,7 +11,7 @@ MediaHaven ## MediaHaven -[Show source in __init__.py:10](../../mediahaven/__init__.py#L10) +[Show source in __init__.py:12](../../mediahaven/__init__.py#L12) #### Signature diff --git a/docs/mediahaven/mediahaven.md b/docs/mediahaven/mediahaven.md index a58d98e..c6a0c81 100644 --- a/docs/mediahaven/mediahaven.md +++ b/docs/mediahaven/mediahaven.md @@ -13,7 +13,7 @@ Mediahaven ## AcceptFormat -[Show source in mediahaven.py:32](../../mediahaven/mediahaven.py#L32) +[Show source in mediahaven.py:31](../../mediahaven/mediahaven.py#L31) #### Signature @@ -26,7 +26,7 @@ class AcceptFormat(Enum): ## MediaHavenClient -[Show source in mediahaven.py:43](../../mediahaven/mediahaven.py#L43) +[Show source in mediahaven.py:42](../../mediahaven/mediahaven.py#L42) The MediaHaven client class to communicate with MediaHaven. @@ -46,7 +46,7 @@ class MediaHavenClient: ## MediaHavenException -[Show source in mediahaven.py:26](../../mediahaven/mediahaven.py#L26) +[Show source in mediahaven.py:25](../../mediahaven/mediahaven.py#L25) #### Signature diff --git a/docs/mediahaven/resources/field_definitions.md b/docs/mediahaven/resources/field_definitions.md new file mode 100644 index 0000000..6324ad6 --- /dev/null +++ b/docs/mediahaven/resources/field_definitions.md @@ -0,0 +1,95 @@ +# FieldDefinitions + +[Mediahaven-python Index](../../../README.md#mediahaven-python-index) / +[MediaHaven](../index.md#mediahaven) / +[Resources](./index.md#resources) / +FieldDefinitions + +> Auto-generated documentation for [mediahaven.resources.field_definitions](../../../mediahaven/resources/field_definitions.py) module. + +- [FieldDefinitions](#fielddefinitions) + - [FieldDefinitions](#fielddefinitions-1) + - [FieldDefinitions().get](#fielddefinitions()get) + - [FieldDefinitions().search](#fielddefinitions()search) + +## FieldDefinitions + +[Show source in field_definitions.py:15](../../../mediahaven/resources/field_definitions.py#L15) + +Public API endpoint of MediaHaven field definitions. + +#### Signature + +```python +class FieldDefinitions(BaseResource): + def __init__(self, *args, **kwargs): + ... +``` + +#### See also + +- [BaseResource](./base_resource.md#baseresource) + +### FieldDefinitions().get + +[Show source in field_definitions.py:22](../../../mediahaven/resources/field_definitions.py#L22) + +Get a single field definition. + +#### Arguments + +- `field` - The id or FlatKey of a metadata field definition. +- `accept_format` - The "Accept" request header. + +#### Returns + +A single metadata field definition. + +#### Signature + +```python +def get( + self, field: str = None, accept_format=DEFAULT_ACCEPT_FORMAT +) -> MediaHavenSingleObject: + ... +``` + +#### See also + +- [DEFAULT_ACCEPT_FORMAT](../mediahaven.md#default_accept_format) +- [MediaHavenSingleObject](./base_resource.md#mediahavensingleobject) + +### FieldDefinitions().search + +[Show source in field_definitions.py:41](../../../mediahaven/resources/field_definitions.py#L41) + +Search all field definitions. + +#### Arguments + +- `accept_format` - The "Accept" request header. +- `**query_params` - The optional query paramaters: + - `query_params["startIndex"]` - Used for pagination of search results, + search results will be returned starting from this index. + - `query_params["nrOfResults"]` - the number of results that will be returned. + - `query_params["nested"]` - If true include children and parents in the response, + default is false. + - `query_params["sort"]` - Determine how to sort the field definitions. (FieldDefinitionId or LongTranslation). + +#### Returns + +A paged result with the metadata field definitions. + +#### Signature + +```python +def search( + self, accept_format: str = DEFAULT_ACCEPT_FORMAT, **query_params +) -> MediaHavenPageObject: + ... +``` + +#### See also + +- [DEFAULT_ACCEPT_FORMAT](../mediahaven.md#default_accept_format) +- [MediaHavenPageObject](./base_resource.md#mediahavenpageobject) \ No newline at end of file diff --git a/docs/mediahaven/resources/index.md b/docs/mediahaven/resources/index.md index 3fb9fe8..bd3028f 100644 --- a/docs/mediahaven/resources/index.md +++ b/docs/mediahaven/resources/index.md @@ -12,4 +12,6 @@ Resources ## Modules - [BaseResource](./base_resource.md) +- [FieldDefinitions](./field_definitions.md) +- [Organisations](./organisations.md) - [Records](./records.md) \ No newline at end of file diff --git a/docs/mediahaven/resources/organisations.md b/docs/mediahaven/resources/organisations.md new file mode 100644 index 0000000..f54b983 --- /dev/null +++ b/docs/mediahaven/resources/organisations.md @@ -0,0 +1,93 @@ +# Organisations + +[Mediahaven-python Index](../../../README.md#mediahaven-python-index) / +[MediaHaven](../index.md#mediahaven) / +[Resources](./index.md#resources) / +Organisations + +> Auto-generated documentation for [mediahaven.resources.organisations](../../../mediahaven/resources/organisations.py) module. + +- [Organisations](#organisations) + - [Organisations](#organisations-1) + - [Organisations().get](#organisations()get) + - [Organisations().search](#organisations()search) + +## Organisations + +[Show source in organisations.py:15](../../../mediahaven/resources/organisations.py#L15) + +Public API endpoint of MediaHaven tenants. + +#### Signature + +```python +class Organisations(BaseResource): + def __init__(self, *args, **kwargs): + ... +``` + +#### See also + +- [BaseResource](./base_resource.md#baseresource) + +### Organisations().get + +[Show source in organisations.py:22](../../../mediahaven/resources/organisations.py#L22) + +Get a single organisation. + +#### Arguments + +- `organisation_id` - The id of an organisation. +- `accept_format` - The "Accept" request header. + +#### Returns + +A single organisation. + +#### Signature + +```python +def get( + self, organisation_id: str, accept_format=DEFAULT_ACCEPT_FORMAT +) -> MediaHavenSingleObject: + ... +``` + +#### See also + +- [DEFAULT_ACCEPT_FORMAT](../mediahaven.md#default_accept_format) +- [MediaHavenSingleObject](./base_resource.md#mediahavensingleobject) + +### Organisations().search + +[Show source in organisations.py:40](../../../mediahaven/resources/organisations.py#L40) + +Search all organisations. + +#### Arguments + +- `query` - The search query. +- `accept_format` - The "Accept" request header. +- `**query_params` - The optional query parameters: + - `query_params["startIndex"]` - Used for pagination of search results, + search results will be returned starting from this index. + - `query_params["nrOfResults"]` - The number of results that will be returned. + +#### Returns + +A paged result with the organisations. + +#### Signature + +```python +def search( + self, accept_format: str = DEFAULT_ACCEPT_FORMAT, **query_params +) -> MediaHavenPageObject: + ... +``` + +#### See also + +- [DEFAULT_ACCEPT_FORMAT](../mediahaven.md#default_accept_format) +- [MediaHavenPageObject](./base_resource.md#mediahavenpageobject) \ No newline at end of file diff --git a/docs/mediahaven/resources/records.md b/docs/mediahaven/resources/records.md index 2068e99..3974e40 100644 --- a/docs/mediahaven/resources/records.md +++ b/docs/mediahaven/resources/records.md @@ -12,12 +12,13 @@ Records - [Records().count](#records()count) - [Records().delete](#records()delete) - [Records().get](#records()get) + - [Records().publish](#records()publish) - [Records().search](#records()search) - [Records().update](#records()update) ## Records -[Show source in records.py:14](../../../mediahaven/resources/records.py#L14) +[Show source in records.py:15](../../../mediahaven/resources/records.py#L15) Public API endpoint of a MediaHaven record. @@ -35,7 +36,7 @@ class Records(BaseResource): ### Records().count -[Show source in records.py:21](../../../mediahaven/resources/records.py#L21) +[Show source in records.py:22](../../../mediahaven/resources/records.py#L22) Counts the amount the records given a query string. @@ -56,7 +57,7 @@ def count(self, query: str) -> int: ### Records().delete -[Show source in records.py:80](../../../mediahaven/resources/records.py#L80) +[Show source in records.py:81](../../../mediahaven/resources/records.py#L81) Delete a record. @@ -76,14 +77,14 @@ def delete(self, record_id: str, reason: str = None, event_type: str = None): ### Records().get -[Show source in records.py:35](../../../mediahaven/resources/records.py#L35) +[Show source in records.py:36](../../../mediahaven/resources/records.py#L36) Get a single record. #### Arguments - `record_id` - It can either be a MediaObjectId, FragmentId or RecordId. -- `accept_format` - The "Accept" request header +- `accept_format` - The "Accept" request header. #### Returns @@ -103,9 +104,28 @@ def get( - [DEFAULT_ACCEPT_FORMAT](../mediahaven.md#default_accept_format) - [MediaHavenSingleObject](./base_resource.md#mediahavensingleobject) +### Records().publish + +[Show source in records.py:121](../../../mediahaven/resources/records.py#L121) + +Publishes a record. + +#### Arguments + +- `record_id` - The ID of the record to publish. + It can be either a MediaObjectId, FragmentId or RecordId. +- `reason` - The reason to publish the record. + +#### Signature + +```python +def publish(self, record_id: str, reason: str = None): + ... +``` + ### Records().search -[Show source in records.py:53](../../../mediahaven/resources/records.py#L53) +[Show source in records.py:54](../../../mediahaven/resources/records.py#L54) Search for multiple records. @@ -116,8 +136,8 @@ Search for multiple records. - `query_params["q"]` - Free text search string. - `query_params["startIndex"]` - Used for pagination of search results, search results will be returned starting from this index. - - `query_params["nrOfResults"]` - the number of results that will be returned - - `query_params["publicOnly"]` - if true exclude from the output dynamic + - `query_params["nrOfResults"]` - The number of results that will be returned. + - `query_params["publicOnly"]` - If true exclude from the output dynamic metadata fields which were marked as non public in the Profiles linked with the record. @@ -141,7 +161,7 @@ def search( ### Records().update -[Show source in records.py:102](../../../mediahaven/resources/records.py#L102) +[Show source in records.py:103](../../../mediahaven/resources/records.py#L103) Update a record. From 3466b6014ad1b4265771b3ff6911544b0a9d4e2f Mon Sep 17 00:00:00 2001 From: lennertvandevelde Date: Tue, 2 May 2023 09:36:34 +0200 Subject: [PATCH 10/12] MHPY-10 change README and docs --- README.md | 14 ---- REAMDE.md | 75 +++++++++++++++++++ docs/README.md | 14 ++++ docs/mediahaven/index.md | 2 +- docs/mediahaven/mediahaven.md | 2 +- docs/mediahaven/oauth2.md | 2 +- docs/mediahaven/resources/base_resource.md | 2 +- .../mediahaven/resources/field_definitions.md | 2 +- docs/mediahaven/resources/index.md | 2 +- docs/mediahaven/resources/organisations.md | 2 +- docs/mediahaven/resources/records.md | 2 +- 11 files changed, 97 insertions(+), 22 deletions(-) delete mode 100644 README.md create mode 100644 REAMDE.md create mode 100644 docs/README.md diff --git a/README.md b/README.md deleted file mode 100644 index 62c8574..0000000 --- a/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Mediahaven-python Index - -> Auto-generated documentation index. - -A full list of `Mediahaven-python` project modules. - -- [MediaHaven](docs/mediahaven/index.md#mediahaven) - - [Mediahaven](docs/mediahaven/mediahaven.md#mediahaven) - - [Oauth2](docs/mediahaven/oauth2.md#oauth2) - - [Resources](docs/mediahaven/resources/index.md#resources) - - [BaseResource](docs/mediahaven/resources/base_resource.md#baseresource) - - [FieldDefinitions](docs/mediahaven/resources/field_definitions.md#fielddefinitions) - - [Organisations](docs/mediahaven/resources/organisations.md#organisations) - - [Records](docs/mediahaven/resources/records.md#records) diff --git a/REAMDE.md b/REAMDE.md new file mode 100644 index 0000000..bf53b21 --- /dev/null +++ b/REAMDE.md @@ -0,0 +1,75 @@ +# MediaHaven Python Library + +## Synopsis + +The Mediahaven Python library provides a way to communicate with MediaHaven via the v2 REST API. + +## Documentation + +See the automatically generated [documentation](/docs/README.md). + +## Usage + +```python +>>> import os +>>> +>>> from mediahaven import MediaHaven +>>> from mediahaven.oauth2 import ROPCGrant, RequestTokenError +>>> +>>> # Get the credentials from env vars. +>>> client_id = os.environ["CLIENT_ID"] +>>> client_secret = os.environ["CLIENT_SECRET"] +>>> username = os.environ["USERNAME"] +>>> password = os.environ["PASSWORD"] +>>> url = os.environ["MH_URL"] +>>> +>>> # Create a ROPC grant +>>> grant = ROPCGrant(url, client_id, client_secret) +>>> # Request a token +>>> try: +... grant.request_token(username, password) +... except RequestTokenError as e: +... print(e) +... +>>> # Initialize the MH client +>>> client = MediaHaven(url, grant) + +>>> # Get record based on record ID +>>> record = client.records.get("570...33b") +>>> print(record.Internal.ArchiveStatus) +on_disk +>>> print(record.Dynamic.PID) +qs...8q + +>>> # Get page based on query +>>> records_page = client.records.search(q="+(batch_id:FLMB15)", nrOfResults=10, startIndex=0) +>>> print(records_page.nr_of_results) +10 +>>> print(records_page.total_nr_of_results) +22 +>>> print(records_page.start_index) +0 +>>> print(records_page[0].Dynamic.PID) +w3...0k + +>>> # Get next page +>>> print(records_page.has_more) +True +>>> next_page = records_page.next_page() +>>> print(next_page.nr_of_results) +10 +>>> print(next_page.total_nr_of_results) +22 +>>> print(next_page.start_index) +10 +>>> print(next_page[0].Dynamic.PID) +2z...40 + +>>> # Work via generator +>>> for record in records_page.as_generator(): +... print(record.Dynamic.PID) +... +w3...0k + +9s...5t +``` \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..5a83492 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,14 @@ +# Mediahaven-python Index + +> Auto-generated documentation index. + +A full list of `Mediahaven-python` project modules. + +- [MediaHaven](mediahaven/index.md#mediahaven) + - [Mediahaven](mediahaven/mediahaven.md#mediahaven) + - [Oauth2](mediahaven/oauth2.md#oauth2) + - [Resources](mediahaven/resources/index.md#resources) + - [BaseResource](mediahaven/resources/base_resource.md#baseresource) + - [FieldDefinitions](mediahaven/resources/field_definitions.md#fielddefinitions) + - [Organisations](mediahaven/resources/organisations.md#organisations) + - [Records](mediahaven/resources/records.md#records) diff --git a/docs/mediahaven/index.md b/docs/mediahaven/index.md index 9782c13..c0d28bd 100644 --- a/docs/mediahaven/index.md +++ b/docs/mediahaven/index.md @@ -1,6 +1,6 @@ # MediaHaven -[Mediahaven-python Index](../../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../README.md#mediahaven-python-index) / MediaHaven > Auto-generated documentation for [mediahaven](../../mediahaven/__init__.py) module. diff --git a/docs/mediahaven/mediahaven.md b/docs/mediahaven/mediahaven.md index c6a0c81..a3f3485 100644 --- a/docs/mediahaven/mediahaven.md +++ b/docs/mediahaven/mediahaven.md @@ -1,6 +1,6 @@ # Mediahaven -[Mediahaven-python Index](../../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../README.md#mediahaven-python-index) / [MediaHaven](./index.md#mediahaven) / Mediahaven diff --git a/docs/mediahaven/oauth2.md b/docs/mediahaven/oauth2.md index 0090599..b334b7d 100644 --- a/docs/mediahaven/oauth2.md +++ b/docs/mediahaven/oauth2.md @@ -1,6 +1,6 @@ # Oauth2 -[Mediahaven-python Index](../../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../README.md#mediahaven-python-index) / [MediaHaven](./index.md#mediahaven) / Oauth2 diff --git a/docs/mediahaven/resources/base_resource.md b/docs/mediahaven/resources/base_resource.md index 5039646..9361a98 100644 --- a/docs/mediahaven/resources/base_resource.md +++ b/docs/mediahaven/resources/base_resource.md @@ -1,6 +1,6 @@ # BaseResource -[Mediahaven-python Index](../../../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../../README.md#mediahaven-python-index) / [MediaHaven](../index.md#mediahaven) / [Resources](./index.md#resources) / BaseResource diff --git a/docs/mediahaven/resources/field_definitions.md b/docs/mediahaven/resources/field_definitions.md index 6324ad6..3477a6a 100644 --- a/docs/mediahaven/resources/field_definitions.md +++ b/docs/mediahaven/resources/field_definitions.md @@ -1,6 +1,6 @@ # FieldDefinitions -[Mediahaven-python Index](../../../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../../README.md#mediahaven-python-index) / [MediaHaven](../index.md#mediahaven) / [Resources](./index.md#resources) / FieldDefinitions diff --git a/docs/mediahaven/resources/index.md b/docs/mediahaven/resources/index.md index bd3028f..6ef25ec 100644 --- a/docs/mediahaven/resources/index.md +++ b/docs/mediahaven/resources/index.md @@ -1,6 +1,6 @@ # Resources -[Mediahaven-python Index](../../../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../../README.md#mediahaven-python-index) / [MediaHaven](../index.md#mediahaven) / Resources diff --git a/docs/mediahaven/resources/organisations.md b/docs/mediahaven/resources/organisations.md index f54b983..89b8c3c 100644 --- a/docs/mediahaven/resources/organisations.md +++ b/docs/mediahaven/resources/organisations.md @@ -1,6 +1,6 @@ # Organisations -[Mediahaven-python Index](../../../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../../README.md#mediahaven-python-index) / [MediaHaven](../index.md#mediahaven) / [Resources](./index.md#resources) / Organisations diff --git a/docs/mediahaven/resources/records.md b/docs/mediahaven/resources/records.md index 3974e40..e22c9b5 100644 --- a/docs/mediahaven/resources/records.md +++ b/docs/mediahaven/resources/records.md @@ -1,6 +1,6 @@ # Records -[Mediahaven-python Index](../../../README.md#mediahaven-python-index) / +[Mediahaven-python Index](../../README.md#mediahaven-python-index) / [MediaHaven](../index.md#mediahaven) / [Resources](./index.md#resources) / Records From 2900a21d90d572e273521d5576042404fa9ee386 Mon Sep 17 00:00:00 2001 From: lennertvandevelde Date: Tue, 2 May 2023 09:52:24 +0200 Subject: [PATCH 11/12] MHPY-10 REAMDE -> README --- REAMDE.md => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename REAMDE.md => README.md (100%) diff --git a/REAMDE.md b/README.md similarity index 100% rename from REAMDE.md rename to README.md From ea6604eece19dfe22d52fed1a897af5812a536a6 Mon Sep 17 00:00:00 2001 From: lennertvandevelde <61053080+lennertvandevelde@users.noreply.github.com> Date: Wed, 3 May 2023 10:29:45 +0200 Subject: [PATCH 12/12] Update README.md Co-authored-by: Maarten <763374+maartends@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf53b21..438564a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The Mediahaven Python library provides a way to communicate with MediaHaven via ## Documentation -See the automatically generated [documentation](/docs/README.md). +For more information about the internals of this library: see the automatically generated [documentation](/docs/README.md). ## Usage