Closed risto-trajanov closed 2 years ago
Hi @risto-trajanov.
Thanks for your patience with this.
There was a bug in generating the query string with multi_repeat
which was fixed in #12.
I've just released version 1.3.2
, so if you update to that your query should now work:
(venv) gdelt-doc-api (main) e1b2bf8 $ ipython
Python 3.9.4 (default, May 10 2021, 13:51:57)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.2.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from gdeltdoc import Filters, near, repeat, GdeltDoc, multi_repeat
...:
...: f = Filters(
...: start_date = "2017-05-01",
...: end_date = "2022-02-02",
...: num_records = 250,
...: keyword = "low carbon",
...: near = near(10, 'emission', 'airport'),
...: repeat = multi_repeat([(2, "airline"), (3, "airport")], "AND")
...: )
...: gd = GdeltDoc()
...:
...: # Search for articles matching the filters
...: articles = gd.article_search(f)
...:
In [2]: articles
Out[2]:
url url_mobile title ... domain language sourcecountry
0 https://centreforaviation.com/analysis/reports... Aviation Sustainability and the Environment , ... ... centreforaviation.com English China
[1 rows x 8 columns]
My code
The output:
Do you have an idea what is wrong?