Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cliVersion": "4.68.0",
"cliVersion": "4.90.0",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "5.3.13",
"generatorVersion": "5.5.11",
"generatorConfig": {
"client": {
"class_name": "BaseNewscatcherApi",
Expand All @@ -10,6 +10,10 @@
"exported_filename": "client.py"
}
},
"originGitCommit": "c6c9411cf393ebdaab54b4265a5a8775d22986da",
"sdkVersion": "2.0.3"
"originGitCommit": "3707beee5d0e236f2469e89f7b19c3a08efb6f95",
"originGitCommitIsDirty": false,
"invokedBy": "manual",
"requestedVersion": "2.1.0",
"ciProvider": null,
"sdkVersion": "2.1.0"
}
45 changes: 31 additions & 14 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "newscatcher-sdk"
version = "2.0.3"
version = "2.1.0"
description = ""
readme = "README.md"
authors = []
Expand Down Expand Up @@ -38,20 +38,21 @@ Repository = 'https://github.com/Newscatcher/newscatcher-python'

[tool.poetry.dependencies]
python = "^3.10"
aiohttp = { version = ">=3.10.0,<4", optional = true}
aiohttp = { version = ">=3.13.4,<4", optional = true, python = ">=3.9"}
httpx = ">=0.21.2"
httpx-aiohttp = { version = "0.1.8", optional = true}
httpx-aiohttp = { version = "0.1.8", optional = true, python = ">=3.9"}
pydantic = ">= 1.9.2"
pydantic-core = ">=2.18.2,<2.44.0"
typing_extensions = ">= 4.0.0"

[tool.poetry.group.dev.dependencies]
mypy = "==1.13.0"
pytest = "^8.2.0"
pytest = "^9.0.3"
pytest-asyncio = "^1.0.0"
pytest-xdist = "^3.6.1"
python-dateutil = "^2.9.0"
types-python-dateutil = "^2.9.0.20240316"
urllib3 = ">=1.26.19,<2.0.0 || >=2.2.2,<3.0.0"
ruff = "==0.11.5"

[tool.pytest.ini_options]
Expand Down
20 changes: 10 additions & 10 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ client.search.get(
countries="US,CA",
not_countries="UK,FR",
not_author_name="John Doe, Jane Doe",
from_=datetime.datetime.fromisoformat("2024-07-01T00:00:00+00:00"),
to=datetime.datetime.fromisoformat("2024-01-01T00:00:00+00:00"),
from_=datetime.datetime.fromisoformat("1 day ago"),
to=datetime.datetime.fromisoformat("1 day ago"),
published_date_precision="full",
by_parse_date=True,
ranked_only=True,
Expand All @@ -71,7 +71,7 @@ client.search.get(
page=2,
page_size=50,
clustering_enabled=True,
clustering_threshold=0.6,
clustering_threshold=0.7,
include_nlp_data=True,
has_nlp=True,
theme="Finance,Tech",
Expand Down Expand Up @@ -1233,7 +1233,7 @@ client.latest_headlines.get(
page=2,
page_size=50,
clustering_enabled=True,
clustering_threshold=0.6,
clustering_threshold=0.7,
include_translation_fields=True,
include_nlp_data=True,
has_nlp=True,
Expand Down Expand Up @@ -2645,8 +2645,8 @@ client.authors.get(
not_lang="fr,de",
countries="US,CA",
not_countries="UK,FR",
from_=datetime.datetime.fromisoformat("2024-07-01T00:00:00+00:00"),
to=datetime.datetime.fromisoformat("2024-01-01T00:00:00+00:00"),
from_=datetime.datetime.fromisoformat("1 day ago"),
to=datetime.datetime.fromisoformat("1 day ago"),
published_date_precision="full",
by_parse_date=True,
ranked_only=True,
Expand Down Expand Up @@ -3584,8 +3584,8 @@ client = NewscatcherApi(
client.search_by_link.get(
ids="5f8d0d55b6e45e00179c6e7e",
links="https://nytimes.com/article1,https://bbc.com/article2",
from_=datetime.datetime.fromisoformat("2024-07-01T00:00:00+00:00"),
to=datetime.datetime.fromisoformat("2024-01-01T00:00:00+00:00"),
from_=datetime.datetime.fromisoformat("1 day ago"),
to=datetime.datetime.fromisoformat("1 day ago"),
page=2,
page_size=50,
robots_compliant=True,
Expand Down Expand Up @@ -4211,8 +4211,8 @@ client.aggregation_count.get(
countries="US,CA",
not_countries="UK,FR",
not_author_name="John Doe, Jane Doe",
from_=datetime.datetime.fromisoformat("2024-07-01T00:00:00+00:00"),
to=datetime.datetime.fromisoformat("2024-01-01T00:00:00+00:00"),
from_=datetime.datetime.fromisoformat("1 day ago"),
to=datetime.datetime.fromisoformat("1 day ago"),
published_date_precision="full",
by_parse_date=True,
ranked_only=True,
Expand Down
19 changes: 4 additions & 15 deletions src/newscatcher/aggregation_count/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,6 @@ def get(

Examples
--------
import datetime

from newscatcher import NewscatcherApi

client = NewscatcherApi(
Expand All @@ -287,12 +285,8 @@ def get(
countries="US,CA",
not_countries="UK,FR",
not_author_name="John Doe, Jane Doe",
from_=datetime.datetime.fromisoformat(
"2024-07-01 00:00:00+00:00",
),
to=datetime.datetime.fromisoformat(
"2024-01-01 00:00:00+00:00",
),
from_="1 day ago",
to="1 day ago",
published_date_precision="full",
by_parse_date=True,
ranked_only=True,
Expand Down Expand Up @@ -805,7 +799,6 @@ async def get(
Examples
--------
import asyncio
import datetime

from newscatcher import AsyncNewscatcherApi

Expand All @@ -826,12 +819,8 @@ async def main() -> None:
countries="US,CA",
not_countries="UK,FR",
not_author_name="John Doe, Jane Doe",
from_=datetime.datetime.fromisoformat(
"2024-07-01 00:00:00+00:00",
),
to=datetime.datetime.fromisoformat(
"2024-01-01 00:00:00+00:00",
),
from_="1 day ago",
to="1 day ago",
published_date_precision="full",
by_parse_date=True,
ranked_only=True,
Expand Down
19 changes: 4 additions & 15 deletions src/newscatcher/authors/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,6 @@ def get(

Examples
--------
import datetime

from newscatcher import NewscatcherApi

client = NewscatcherApi(
Expand All @@ -299,12 +297,8 @@ def get(
not_lang="fr,de",
countries="US,CA",
not_countries="UK,FR",
from_=datetime.datetime.fromisoformat(
"2024-07-01 00:00:00+00:00",
),
to=datetime.datetime.fromisoformat(
"2024-01-01 00:00:00+00:00",
),
from_="1 day ago",
to="1 day ago",
published_date_precision="full",
by_parse_date=True,
ranked_only=True,
Expand Down Expand Up @@ -826,7 +820,6 @@ async def get(
Examples
--------
import asyncio
import datetime

from newscatcher import AsyncNewscatcherApi

Expand All @@ -846,12 +839,8 @@ async def main() -> None:
not_lang="fr,de",
countries="US,CA",
not_countries="UK,FR",
from_=datetime.datetime.fromisoformat(
"2024-07-01 00:00:00+00:00",
),
to=datetime.datetime.fromisoformat(
"2024-01-01 00:00:00+00:00",
),
from_="1 day ago",
to="1 day ago",
published_date_precision="full",
by_parse_date=True,
ranked_only=True,
Expand Down
4 changes: 2 additions & 2 deletions src/newscatcher/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def get_headers(self) -> typing.Dict[str, str]:
import platform

headers: typing.Dict[str, str] = {
"User-Agent": "newscatcher-sdk/2.0.3",
"User-Agent": "newscatcher-sdk/2.1.0",
"X-Fern-Language": "Python",
"X-Fern-Runtime": f"python/{platform.python_version()}",
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
"X-Fern-SDK-Name": "newscatcher-sdk",
"X-Fern-SDK-Version": "2.0.3",
"X-Fern-SDK-Version": "2.1.0",
**(self.get_custom_headers() or {}),
}
headers["x-api-token"] = self.api_key
Expand Down
4 changes: 2 additions & 2 deletions src/newscatcher/latest_headlines/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def get(
page=2,
page_size=50,
clustering_enabled=True,
clustering_threshold=0.6,
clustering_threshold=0.7,
include_translation_fields=True,
include_nlp_data=True,
has_nlp=True,
Expand Down Expand Up @@ -862,7 +862,7 @@ async def main() -> None:
page=2,
page_size=50,
clustering_enabled=True,
clustering_threshold=0.6,
clustering_threshold=0.7,
include_translation_fields=True,
include_nlp_data=True,
has_nlp=True,
Expand Down
Loading
Loading