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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
- 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.0` across `setup.py` and `currentsapi/__init__.py`.
- Single-sourced the version: `setup.py` now reads `__version__` from
`currentsapi/__init__.py` instead of duplicating it.
- Replaced the deprecated `tests_require` argument with an `extras_require`
`"dev"` extra (`pip install currentsapi[dev]`).
- Removed obsolete `setup.cfg`: the `description-file` metadata key is
deprecated and the `universal` wheel 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), documents `CurrentsAPIError` handling,
and states the supported Python versions.
- Updated README with current docs link and usage examples.

### Fixed
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ The official Python SDK for the [Currents API](https://currentsapi.services/en/d

## Installation

Install the package from PyPI:
Install the package from PyPI. The distribution name is `currentsapi` (this
repository is `currentsapi-python`, and the Python import name is also
`currentsapi`):

```bash
pip install currentsapi
```

Python 3.8+ is supported.

## Usage

Import the client and initialize it with your API key:
Expand Down Expand Up @@ -76,3 +80,17 @@ Get your API key at [https://currentsapi.services/en/register](https://currentsa
## License

MIT License

## Error handling

Any non-200 API response raises `CurrentsAPIError`, which exposes the parsed
response body:

```python
from currentsapi.client import CurrentsAPIError

try:
api.latest_news()
except CurrentsAPIError as exc:
print(exc.status, exc.code, exc.message)
```
5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

24 changes: 17 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
#!/usr/bin/env python

import re
from pathlib import Path

from setuptools import setup, find_packages

with open("README.md", "r") as fh:
ROOT = Path(__file__).parent

with (ROOT / "README.md").open(encoding="utf-8") as fh:
long_description = fh.read()

with (ROOT / "currentsapi" / "__init__.py").open(encoding="utf-8") as fh:
version = re.search(r'^__version__ = "(.*?)"$', fh.read(), re.MULTILINE).group(1)

extras_require = {
"dev": [
"pytest",
],
}

install_requires = [
"requests>=2.25.0",
"python-dateutil>=2.8.0",
]

tests_require = [
"pytest",
]

setup(
name="currentsapi",
version="0.1.0",
version=version,
author="Currents Dev",
author_email="ray@currentsapi.services",
license="MIT",
Expand All @@ -25,7 +35,7 @@
long_description=long_description,
long_description_content_type="text/markdown",
install_requires=install_requires,
tests_require=tests_require,
extras_require=extras_require,
description="Official Python client for the Currents API",
keywords=["currentsapi", "news", "wrapper", "currents", "api"],
classifiers=[
Expand Down
Loading