Skip to content

Commit 138cdd9

Browse files
author
Gerit Wagner
committed
docs: add installation instructions for automate example
1 parent 86383f9 commit 138cdd9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/source/automate.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ Search-query can be used to automate different steps of the search process, such
88
To run API searches, it is often necessary to represent a query in the form of a URL as opposed to a query string.
99
Using the Crossref API as an example, the following illustrates how to construct such a URL to retrieve and store records.
1010

11+
.. tip::
12+
13+
The example below requires the `colrev` package to be installed. You can install it via pip:
14+
15+
.. code-block:: bash
16+
17+
pip install colrev
18+
1119
.. code-block:: python
1220
:linenos:
1321
@@ -17,7 +25,7 @@ Using the Crossref API as an example, the following illustrates how to construct
1725
from colrev.writer.write_utils import write_file
1826
1927
from search_query.constants import Fields, Operators
20-
from search_query.or_query import OrQuery
28+
from search_query.query_or import OrQuery
2129
from search_query.search_file import SearchFile
2230
2331
def to_crossref_url(query):
@@ -42,7 +50,7 @@ Using the Crossref API as an example, the following illustrates how to construct
4250
query = OrQuery(["microsourcing", "lululemon"], field="title")
4351
4452
url = to_crossref_url(query)
45-
api_crossref = crossref_api.CrossrefAPI(params={"url": url})
53+
api_crossref = crossref_api.CrossrefAPI(url=url)
4654
records = api_crossref.get_records()
4755
4856
sf = SearchFile(

0 commit comments

Comments
 (0)