Skip to content

Release/0.2.0#23

Merged
himanshu-gtm merged 4 commits into
mainfrom
release/0.2.0
May 8, 2026
Merged

Release/0.2.0#23
himanshu-gtm merged 4 commits into
mainfrom
release/0.2.0

Conversation

@himanshu-gtm
Copy link
Copy Markdown
Collaborator

No description provided.

himanshu added 4 commits May 8, 2026 11:43
- src layout (src/newsdataapi/), Python 3.8-3.14, hatchling + uv
- Typed exception hierarchy (NewsdataAPIError / Auth / RateLimit / Server /
  Network / Validation), all subclassing NewsdataException
- Exponential retry backoff (~62s worst-case across 5 attempts vs old 9000s
  flat sleep); 429 honors Retry-After (integer-seconds and HTTP-date forms)
- API key redacted in log output via _redact_url
- raw_query is mutually exclusive with normal params; embedded apikey is
  silently dropped (client uses constructor apikey)
- save_to_csv as free function (FileHandler mixin removed); returns
  pathlib.Path; never mutates input; uses csv.DictWriter for correct quoting
- 99 mocked unit tests (responses lib) + 8 live-API integration tests
  (auto-skipped by default; opt in with -m integration)
- New CI matrix Python 3.8-3.14 + OIDC trusted publishing workflow
- Removed: setup.py, tox.ini, requirements.txt, MANIFEST.in,
  newsdataapi/utils.py (Py2/3 shim), legacy python-publish.yml
…ightening

- New filters per server FILTERS_MAPPING: datatype, creator, and
  sentiment_score across latest_api, archive_api, market_api, count_api,
  and market_count_api. Plus filling in existing-bucket coverage gaps in
  archive/count (removeduplicate, sentiment, tag, region, organization).
- New _FLOAT_PARAMS frozenset and _check_float_param helper for
  sentiment_score (numeric; rejects bool via int-subclass check, accepts
  int alongside float).
- Count endpoints now support scroll=True. _scroll_all carries the
  is_count flag through _dispatch and captures the final aggregate dict
  under the merged response's "aggregate" key when the API returns
  results as a dict on the final page.
- Client-side enforcement of server's HTTP 422 cases:
  - size capped at 50 (paid-plan maximum); values > 50 raise
    NewsdataValidationError pre-flight.
  - 5 mutex groups mirrored from the server validator: q / qInTitle /
    qInMeta; country / excludecountry; category / excludecategory;
    language / excludelanguage; and the 3-way domain / domainurl /
    excludedomain group.
- One-line docstring added to _dispatch for parity with the other
  internals.
- 23 new tests covering all the above; unit suite 99 -> 122. All checks
  pass on Python 3.12 and 3.14.
- size: enforce lower bound (must be in [1, 50])
- raw_query: reject keys with empty values
- sentiment_score requires sentiment
@himanshu-gtm himanshu-gtm merged commit c2f9772 into main May 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant