ebird-api 4.3.0__tar.gz → 4.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ebird_api-4.3.0 → ebird_api-4.3.2}/CHANGELOG.md +8 -0
- {ebird_api-4.3.0/src/ebird_api.egg-info → ebird_api-4.3.2}/PKG-INFO +1 -1
- {ebird_api-4.3.0 → ebird_api-4.3.2}/pyproject.toml +2 -2
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/__init__.py +1 -1
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/statistics.py +18 -2
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/validation.py +2 -2
- {ebird_api-4.3.0 → ebird_api-4.3.2/src/ebird_api.egg-info}/PKG-INFO +1 -1
- {ebird_api-4.3.0 → ebird_api-4.3.2}/LICENSE.txt +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/README.md +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/setup.cfg +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/setup.py +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/checklists.py +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/client.py +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/constants.py +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/hotspots.py +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/observations.py +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/regions.py +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/species.py +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/taxonomy.py +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/utils.py +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird_api.egg-info/SOURCES.txt +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird_api.egg-info/dependency_links.txt +0 -0
- {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird_api.egg-info/top_level.txt +0 -0
|
@@ -8,6 +8,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
|
|
8
8
|
This project adheres to [PEP440](https://www.python.org/dev/peps/pep-0440/)
|
|
9
9
|
and by implication, [Semantic Versioning](http://semver.org/).
|
|
10
10
|
|
|
11
|
+
## [4.3.2] - 2026-11-15
|
|
12
|
+
- Fixed the error message raised by clean_region() so it includes the
|
|
13
|
+
invalid region code.
|
|
14
|
+
|
|
15
|
+
## [4.3.1] - 2026-10-12
|
|
16
|
+
- Changed get_top_100() to accept location codes, and reject subnational2
|
|
17
|
+
codes, which the eBird API does not support.
|
|
18
|
+
|
|
11
19
|
## [4.3.0] - 2026-10-12
|
|
12
20
|
- Added set_rate_limit() to set a minimum interval between requests. The
|
|
13
21
|
interval is doubled, up to 60 seconds, if the API responds with HTTP 429
|
|
@@ -29,7 +29,7 @@ license = {text = "MIT License"}
|
|
|
29
29
|
name = "ebird-api"
|
|
30
30
|
readme = "README.md"
|
|
31
31
|
requires-python = ">= 3.10"
|
|
32
|
-
version = "4.3.
|
|
32
|
+
version = "4.3.2"
|
|
33
33
|
|
|
34
34
|
[project.urls]
|
|
35
35
|
Repository = "https://github.com/ProjectBabbler/ebird-api.git"
|
|
@@ -37,7 +37,7 @@ Issues = "https://github.com/ProjectBabbler/ebird-api/issues"
|
|
|
37
37
|
Changelog = "https://github.com/ProjectBabbler/ebird-api/blob/master/CHANGELOG.md"
|
|
38
38
|
|
|
39
39
|
[tool.bumpversion]
|
|
40
|
-
current_version = "4.3.
|
|
40
|
+
current_version = "4.3.2"
|
|
41
41
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
|
42
42
|
serialize = ["{major}.{minor}.{patch}"]
|
|
43
43
|
ignore_missing_version = false
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
from ebird.api.requests.utils import call
|
|
4
4
|
from ebird.api.requests.validation import (
|
|
5
|
+
Transform,
|
|
5
6
|
clean_area,
|
|
7
|
+
clean_code,
|
|
6
8
|
clean_date,
|
|
7
9
|
clean_max_observers,
|
|
8
10
|
clean_observer_rank,
|
|
9
11
|
clean_region,
|
|
12
|
+
is_location,
|
|
13
|
+
is_subnational2,
|
|
10
14
|
)
|
|
11
15
|
|
|
12
16
|
TOP_100_URL = "https://api.ebird.org/v2/product/top100/%s/%s"
|
|
@@ -23,7 +27,8 @@ def get_top_100(token, region, date, rank="spp", max_results=100):
|
|
|
23
27
|
|
|
24
28
|
:param token: the token needed to access the API.
|
|
25
29
|
|
|
26
|
-
:param region: the code for
|
|
30
|
+
:param region: the code for a country, subnational1 region or location,
|
|
31
|
+
e.g. US, US-NV or L99381. The API does not support subnational2 regions.
|
|
27
32
|
|
|
28
33
|
:param date: the date, since Jan 1st 1800.
|
|
29
34
|
|
|
@@ -42,7 +47,18 @@ def get_top_100(token, region, date, rank="spp", max_results=100):
|
|
|
42
47
|
:raises HTTPError if the eBird API returns an error.
|
|
43
48
|
|
|
44
49
|
"""
|
|
45
|
-
|
|
50
|
+
code = clean_code(region, transform=Transform.UPPER)
|
|
51
|
+
if is_location(code):
|
|
52
|
+
cleaned = code
|
|
53
|
+
elif is_subnational2(code):
|
|
54
|
+
raise ValueError(
|
|
55
|
+
"Value for 'region', %s, must be a country, e.g. 'US', "
|
|
56
|
+
"subnational1, e.g. 'US-NV' or location, e.g. 'L99381'" % region
|
|
57
|
+
)
|
|
58
|
+
else:
|
|
59
|
+
cleaned = clean_region(region)
|
|
60
|
+
|
|
61
|
+
url = TOP_100_URL % (cleaned, date.strftime("%Y/%m/%d"))
|
|
46
62
|
|
|
47
63
|
params = {
|
|
48
64
|
"maxObservers": clean_max_observers(max_results),
|
|
@@ -247,8 +247,8 @@ def clean_region(value):
|
|
|
247
247
|
cleaned = cleaned.upper()
|
|
248
248
|
if not is_region(cleaned):
|
|
249
249
|
raise ValueError(
|
|
250
|
-
"Value for 'region', %s, must be a country, e.g. 'US',"
|
|
251
|
-
"subnational1, e.g. 'US-NV' or subnational2, e.g. 'US-NV-211'"
|
|
250
|
+
"Value for 'region', %s, must be a country, e.g. 'US', "
|
|
251
|
+
"subnational1, e.g. 'US-NV' or subnational2, e.g. 'US-NV-211'" % value
|
|
252
252
|
)
|
|
253
253
|
return cleaned
|
|
254
254
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|