Skip to content

Commit

Permalink
Merge branch 'release/v0.28.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed Nov 7, 2024
2 parents 7ba67ec + 0151a5e commit b6c5336
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Install is either via pip or cloning the repository.

From pip:
```sh
python3 -m pip install thothlibrary==0.27.0
python3 -m pip install thothlibrary==0.28.0
```

Or from the repo:
Expand Down
2 changes: 1 addition & 1 deletion thothlibrary/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""GraphQL client for Thoth"""

__version__ = "0.27.0"
__version__ = "0.28.0"
__author__ = "Javier Arias <[email protected]>"
__copyright__ = "Copyright (c) 2020 Open Book Publishers"
__license__ = "Apache 2.0"
Expand Down
10 changes: 10 additions & 0 deletions thothlibrary/mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,16 @@ class ThothMutation():
],
"return_value": "contributorId"
},
"updateLocation": {
"fields": [
("locationId", True),
("landingPage", True),
("fullTextUrl", True),
("locationPlatform", False),
("canonical", False)
],
"return_value": "locationId"
},
"deleteLocation": {
"fields": [
("locationId", True),
Expand Down
13 changes: 13 additions & 0 deletions thothlibrary/thoth-0_9_0/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,19 @@ def language_count(self, language_codes: str = "",

return self._api_request("languageCount", parameters, return_raw=raw)

def location(self, location_id: str, raw: bool = False):
"""
Returns a location by ID
@param location_id: the ID to fetch
@param raw: whether to return a python object or the raw result
@return: either an object (default) or raw server response
"""
parameters = {
'locationId': '"' + location_id + '"'
}

return self._api_request("location", parameters, return_raw=raw)

def price(self, price_id: str, raw: bool = False):
"""
Returns a price by ID
Expand Down
10 changes: 10 additions & 0 deletions thothlibrary/thoth-0_9_0/fixtures/QUERIES
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@
"work { workId fullTitle doi publicationDate place contributions(order: {field: CONTRIBUTION_ORDINAL, direction: ASC}) { fullName contributionType mainContribution contributionOrdinal } }__typename"
]
},
"location": {
"fields": [
"locationId",
"publicationId",
"landingPage",
"fullTextUrl",
"locationPlatform",
"canonical",
]
},
"price": {
"fields": [
"currencyCode",
Expand Down

0 comments on commit b6c5336

Please sign in to comment.