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.
Files changed (23) hide show
  1. {ebird_api-4.3.0 → ebird_api-4.3.2}/CHANGELOG.md +8 -0
  2. {ebird_api-4.3.0/src/ebird_api.egg-info → ebird_api-4.3.2}/PKG-INFO +1 -1
  3. {ebird_api-4.3.0 → ebird_api-4.3.2}/pyproject.toml +2 -2
  4. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/__init__.py +1 -1
  5. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/statistics.py +18 -2
  6. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/validation.py +2 -2
  7. {ebird_api-4.3.0 → ebird_api-4.3.2/src/ebird_api.egg-info}/PKG-INFO +1 -1
  8. {ebird_api-4.3.0 → ebird_api-4.3.2}/LICENSE.txt +0 -0
  9. {ebird_api-4.3.0 → ebird_api-4.3.2}/README.md +0 -0
  10. {ebird_api-4.3.0 → ebird_api-4.3.2}/setup.cfg +0 -0
  11. {ebird_api-4.3.0 → ebird_api-4.3.2}/setup.py +0 -0
  12. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/checklists.py +0 -0
  13. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/client.py +0 -0
  14. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/constants.py +0 -0
  15. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/hotspots.py +0 -0
  16. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/observations.py +0 -0
  17. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/regions.py +0 -0
  18. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/species.py +0 -0
  19. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/taxonomy.py +0 -0
  20. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird/api/requests/utils.py +0 -0
  21. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird_api.egg-info/SOURCES.txt +0 -0
  22. {ebird_api-4.3.0 → ebird_api-4.3.2}/src/ebird_api.egg-info/dependency_links.txt +0 -0
  23. {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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ebird-api
3
- Version: 4.3.0
3
+ Version: 4.3.2
4
4
  Summary: Wrapper for accessing the eBird API
5
5
  Author-email: Project Babbler <projectbabbler@gmail.com>
6
6
  License: MIT License
@@ -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.0"
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.0"
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,7 +2,7 @@
2
2
 
3
3
  """A set of wrapper functions for accessing the eBird API."""
4
4
 
5
- __version__ = "4.3.0"
5
+ __version__ = "4.3.2"
6
6
 
7
7
  from ebird.api.requests.checklists import get_checklist, get_visits
8
8
  from ebird.api.requests.client import Client
@@ -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 the region, eg. US-NV.
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
- url = TOP_100_URL % (clean_region(region), date.strftime("%Y/%m/%d"))
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ebird-api
3
- Version: 4.3.0
3
+ Version: 4.3.2
4
4
  Summary: Wrapper for accessing the eBird API
5
5
  Author-email: Project Babbler <projectbabbler@gmail.com>
6
6
  License: MIT License
File without changes
File without changes
File without changes
File without changes