Skip to content

Commit

Permalink
Merge branch 'release/v0.21.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed Sep 27, 2023
2 parents 3a1f86e + eb1cbe7 commit d89bf63
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ jobs:
build-and-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Check out repository code
uses: actions/checkout@v2
Expand All @@ -28,10 +30,8 @@ jobs:
# Install the package from setup.py
python3 setup.py install
- name: Build and publish to PyPI
run: |
python3 setup.py sdist bdist_wheel
pipx run twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
- name: Build package
run: python3 setup.py sdist bdist_wheel

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
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.20.3
python3 -m pip install thothlibrary==0.21.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.20.3"
__version__ = "0.21.0"
__author__ = "Javier Arias <javi@openbookpublishers.com>"
__copyright__ = "Copyright (c) 2020 Open Book Publishers"
__license__ = "Apache 2.0"
Expand Down
16 changes: 16 additions & 0 deletions thothlibrary/thoth-0_9_0/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,22 @@ def institutions(self, limit: int = 100, offset: int = 0, order: str = None,

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

def institution_count(self, search: str = "", raw: bool = False):
"""
Return a count of institutions
@param search: a search string
@param raw: whether to return the raw result
@return: a count of institutions
"""
parameters = {}

if search and not search.startswith('"'):
search = '"{0}"'.format(search)

self._dictionary_append(parameters, 'filter', search)

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

def funding_count(self, search: str = "", raw: bool = False):
"""
A count of funders
Expand Down

0 comments on commit d89bf63

Please sign in to comment.