- Restored documented
YYYY-MM-DDstring support insearch()(broken in 0.1.2 when naive datetimes started being rejected); date-only strings are formatted as UTC midnight. Naive timestamp strings (e.g.2024-01-15T10:00:00) remain rejected as ambiguous. examples/_example_utils.safe_markdown_urlnow validates withurlsplit(scheme + hostname required) and percent-encodes angle brackets, parentheses, and spaces, closing a Markdown/HTML injection path where ahttps://...><script>...URL passed validation.CurrentsAPI(domain=...)now requires explicitallow_custom_domain=Truefor any domain other than the default, since a custom domain receives your API key on every request.examples/source_linked_briefingcatchesCurrentsAPIErrorand prints a clean error message (with HTTP status) instead of a traceback.
- Restored compatibility with the declared
python-dateutil>=2.8.0floor: the date-parse error handler no longer referencesparser.ParserError(introduced in dateutil 2.8.1). - Non-JSON error responses (e.g. HTML gateway 502s) and non-object JSON
error payloads now raise
CurrentsAPIErrorinstead of leakingJSONDecodeError/AttributeError. The exception now carries the real HTTP status code via itsstatusproperty; the payload'sstatusvalue is only used when no HTTP status is available. search()now rejects falsey invalid arguments (keywords=0, empty/ whitespace keywords) instead of silently omitting them.- Naive
datetimeinputs are rejected with a clearValueError(they were silently labeled UTC before);dateobjects are now explicitly formatted as UTC midnight. examples/source_linked_briefingnow escapes publisher-controlled Markdown text and validates URL schemes, matching the protection the company-monitor example already had (blocksjavascript:link injection).
CurrentsAPIError.messagenow falls back to the API'smsgkey (401 responses carrymsg, notmessage), andstr(exception)returns the human-readable message instead of a raw dict repr.CurrentsAPIError.statusnow returns anintwhen the payload carries a numeric status string, soe.status == 401works as expected.- Timezone-aware
datetimeinputs tosearch()are converted to UTC before formatting, instead of silently losing their offset while the string gains a misleadingZsuffix. - Unparsable date strings (e.g.
"2026-13-45") now raiseValueErrorwith a clear message instead of leakingdateutil.parser.ParserError.
- Added
available_languages(),available_regions(), andavailable_category()endpoint wrappers. - Added
languageparameter support tolatest_news(). - Added GitHub Actions CI workflow.
- Added unit tests using
unittest.mock.
- Aligned
search()parameters with the current documented API surface. - Modernized packaging metadata: updated repository URL, classifiers, and dependency pins.
- Unified package version to
0.1.0acrosssetup.pyandcurrentsapi/__init__.py. - Single-sourced the version:
setup.pynow reads__version__fromcurrentsapi/__init__.pyinstead of duplicating it. - Replaced the deprecated
tests_requireargument with anextras_require"dev"extra (pip install currentsapi[dev]). - Removed obsolete
setup.cfg: thedescription-filemetadata key is deprecated and theuniversalwheel flag is incorrect for a Python 3-only package. - README now clarifies that the PyPI distribution name is
currentsapi(matching the 0.0.1/0.0.2 releases), documentsCurrentsAPIErrorhandling, and states the supported Python versions. - Updated README with current docs link and usage examples.
- Fixed
start_datehandling insearch()which incorrectly referencedend_date. - Renamed exception class to
CurrentsAPIErrorwith cleaner attribute access.
- Removed unsupported
search()parameters:page_number,limit,has_image,has_description. - Removed the "subtly broken or buggy" disclaimer from the README.