ebird-api 3.1.0__tar.gz → 3.2.0__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-3.1.0 → ebird_api-3.2.0}/CHANGELOG.md +8 -0
  2. {ebird_api-3.1.0/src/ebird_api.egg-info → ebird_api-3.2.0}/PKG-INFO +1 -1
  3. {ebird_api-3.1.0 → ebird_api-3.2.0}/pyproject.toml +2 -2
  4. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird/api/__init__.py +2 -1
  5. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird/api/checklists.py +3 -3
  6. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird/api/hotspots.py +3 -3
  7. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird/api/observations.py +8 -8
  8. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird/api/regions.py +3 -3
  9. ebird_api-3.2.0/src/ebird/api/species.py +37 -0
  10. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird/api/statistics.py +2 -2
  11. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird/api/taxonomy.py +4 -4
  12. {ebird_api-3.1.0 → ebird_api-3.2.0/src/ebird_api.egg-info}/PKG-INFO +1 -1
  13. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird_api.egg-info/SOURCES.txt +1 -0
  14. {ebird_api-3.1.0 → ebird_api-3.2.0}/LICENSE.txt +0 -0
  15. {ebird_api-3.1.0 → ebird_api-3.2.0}/README.md +0 -0
  16. {ebird_api-3.1.0 → ebird_api-3.2.0}/setup.cfg +0 -0
  17. {ebird_api-3.1.0 → ebird_api-3.2.0}/setup.py +0 -0
  18. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird/api/client.py +0 -0
  19. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird/api/constants.py +0 -0
  20. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird/api/utils.py +0 -0
  21. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird/api/validation.py +0 -0
  22. {ebird_api-3.1.0 → ebird_api-3.2.0}/src/ebird_api.egg-info/dependency_links.txt +0 -0
  23. {ebird_api-3.1.0 → ebird_api-3.2.0}/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
+ ## [3.2.0] - 2024-12-30
12
+ - Add get_species_list which returns the list of codes for species seen
13
+ in a country, subnational1 are, subnational2 area or hotspot.
14
+
15
+ ## [3.1.1] - 2024-12-30
16
+ ## Changed
17
+ - URLs calling the api are now in the form, https://api.ebird.org/v2/...
18
+
11
19
  ## [3.1.0] - 2024-12-30
12
20
  ### Added
13
21
  - get_taxonomy_locales which returns a list of all the languages
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ebird-api
3
- Version: 3.1.0
3
+ Version: 3.2.0
4
4
  Summary: Wrapper for accessing the eBird API
5
5
  Author-email: Project Babbler <projectbabbler@gmail.com>
6
6
  License: MIT License
@@ -30,7 +30,7 @@ license = {text = "MIT License"}
30
30
  name = "ebird-api"
31
31
  readme = "README.md"
32
32
  requires-python = ">= 3.8"
33
- version = "3.1.0"
33
+ version = "3.2.0"
34
34
 
35
35
  [project.urls]
36
36
  Repository = "https://github.com/ProjectBabbler/ebird-api.git"
@@ -38,7 +38,7 @@ Issues = "https://github.com/ProjectBabbler/ebird-api/issues"
38
38
  Changelog = "https://github.com/ProjectBabbler/ebird-api/blob/master/CHANGELOG.md"
39
39
 
40
40
  [tool.bumpversion]
41
- current_version = "3.1.0"
41
+ current_version = "3.2.0"
42
42
  parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
43
43
  serialize = ["{major}.{minor}.{patch}"]
44
44
  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__ = "3.1.0"
5
+ __version__ = "3.2.0"
6
6
 
7
7
  from ebird.api.checklists import get_checklist, get_visits
8
8
  from ebird.api.client import Client
@@ -19,6 +19,7 @@ from ebird.api.observations import (
19
19
  get_species_observations,
20
20
  )
21
21
  from ebird.api.regions import get_adjacent_regions, get_region, get_regions
22
+ from ebird.api.species import get_species_list
22
23
  from ebird.api.statistics import get_top_100, get_totals
23
24
  from ebird.api.taxonomy import (
24
25
  get_taxonomy,
@@ -8,9 +8,9 @@ from ebird.api.validation import (
8
8
  clean_max_checklists,
9
9
  )
10
10
 
11
- CHECKLISTS_DATE_URL = "https://ebird.org/ws2.0/product/lists/%s/%s"
12
- CHECKLISTS_RECENT_URL = "https://ebird.org/ws2.0/product/lists/%s"
13
- CHECKLIST_URL = "https://ebird.org/ws2.0/product/checklist/view/%s"
11
+ CHECKLISTS_DATE_URL = "https://api.ebird.org/v2/product/lists/%s/%s"
12
+ CHECKLISTS_RECENT_URL = "https://api.ebird.org/v2/product/lists/%s"
13
+ CHECKLIST_URL = "https://api.ebird.org/v2/product/checklist/view/%s"
14
14
 
15
15
 
16
16
  def get_visits(token, area, date=None, max_results=10):
@@ -10,9 +10,9 @@ from ebird.api.validation import (
10
10
  clean_region,
11
11
  )
12
12
 
13
- REGION_HOTSPOTS_URL = "https://ebird.org/ws2.0/ref/hotspot/%s"
14
- NEARBY_HOTSPOTS_URL = "https://ebird.org/ws2.0/ref/hotspot/geo"
15
- HOTSPOT_INFO_URL = "https://ebird.org/ws2.0/ref/hotspot/info/%s"
13
+ REGION_HOTSPOTS_URL = "https://api.ebird.org/v2/ref/hotspot/%s"
14
+ NEARBY_HOTSPOTS_URL = "https://api.ebird.org/v2/ref/hotspot/geo"
15
+ HOTSPOT_INFO_URL = "https://api.ebird.org/v2/ref/hotspot/info/%s"
16
16
 
17
17
 
18
18
  def get_hotspots(token, region, back=None):
@@ -18,18 +18,18 @@ from ebird.api.validation import (
18
18
  clean_sort,
19
19
  )
20
20
 
21
- OBSERVATIONS_URL = "https://ebird.org/ws2.0/data/obs/%s/recent"
22
- NOTABLE_OBSERVATIONS_URL = "https://ebird.org/ws2.0/data/obs/%s/recent/notable"
23
- SPECIES_OBSERVATIONS_URL = "https://ebird.org/ws2.0/data/obs/%s/recent/%s"
21
+ OBSERVATIONS_URL = "https://api.ebird.org/v2/data/obs/%s/recent"
22
+ NOTABLE_OBSERVATIONS_URL = "https://api.ebird.org/v2/data/obs/%s/recent/notable"
23
+ SPECIES_OBSERVATIONS_URL = "https://api.ebird.org/v2/data/obs/%s/recent/%s"
24
24
 
25
- NEARBY_OBSERVATIONS_URL = "https://ebird.org/ws2.0/data/obs/geo/recent"
26
- NEARBY_NOTABLE_URL = "https://ebird.org/ws2.0/data/obs/geo/recent/notable"
27
- NEARBY_SPECIES_URL = "https://ebird.org/ws2.0/data/obs/geo/recent/%s"
25
+ NEARBY_OBSERVATIONS_URL = "https://api.ebird.org/v2/data/obs/geo/recent"
26
+ NEARBY_NOTABLE_URL = "https://api.ebird.org/v2/data/obs/geo/recent/notable"
27
+ NEARBY_SPECIES_URL = "https://api.ebird.org/v2/data/obs/geo/recent/%s"
28
28
 
29
29
 
30
- NEAREST_SPECIES_URL = "https://ebird.org/ws2.0/data/nearest/geo/recent/%s"
30
+ NEAREST_SPECIES_URL = "https://api.ebird.org/v2/data/nearest/geo/recent/%s"
31
31
 
32
- HISTORIC_OBSERVATIONS_URL = "https://ebird.org/ws2.0/data/obs/%s/historic/%s"
32
+ HISTORIC_OBSERVATIONS_URL = "https://api.ebird.org/v2/data/obs/%s/historic/%s"
33
33
 
34
34
 
35
35
  def get_observations(
@@ -3,9 +3,9 @@
3
3
  from ebird.api.utils import call
4
4
  from ebird.api.validation import clean_region, clean_region_type
5
5
 
6
- REGION_LIST_URL = "https://ebird.org/ws2.0/ref/region/list/%s/%s.json"
7
- ADJACENT_REGIONS_URL = "https://ebird.org/ws2.0/ref/adjacent/%s"
8
- REGION_INFO_URL = "https://ebird.org/ws2.0/ref/region/info/%s"
6
+ REGION_LIST_URL = "https://api.ebird.org/v2/ref/region/list/%s/%s.json"
7
+ ADJACENT_REGIONS_URL = "https://api.ebird.org/v2/ref/adjacent/%s"
8
+ REGION_INFO_URL = "https://api.ebird.org/v2/ref/region/info/%s"
9
9
 
10
10
 
11
11
  def get_regions(token, rtype, region):
@@ -0,0 +1,37 @@
1
+ """Functions for fetching information about species."""
2
+
3
+ from ebird.api.utils import call
4
+ from ebird.api.validation import clean_area
5
+
6
+ SPECIES_LIST_URL = "https://api.ebird.org/v2/product/spplist/%s"
7
+
8
+
9
+ def get_species_list(token, area):
10
+ """
11
+ Get the list of species for an area.
12
+
13
+ The maps to the two end points in the eBird API 2.0,
14
+ https://documenter.getpostman.com/view/664302/S1ENwy59?version=latest#55bd1b26-6951-4a88-943a-d3a8aa1157dd
15
+
16
+ :param token: the token needed to access the API.
17
+
18
+ :param area: the code for a country, subnational1 region, subnational2
19
+ region or location.
20
+
21
+ :return: codes, e.g. horlar1, for the list of species observed in the area.
22
+
23
+ :raises ValueError: if any of the arguments fail the validation checks.
24
+
25
+ :raises URLError if there is an error with the connection to the
26
+ eBird site.
27
+
28
+ :raises HTTPError if the eBird API returns an error.
29
+
30
+ """
31
+ url = SPECIES_LIST_URL % clean_area(area)
32
+
33
+ headers = {
34
+ "X-eBirdApiToken": token,
35
+ }
36
+
37
+ return call(url, {}, headers)
@@ -9,8 +9,8 @@ from ebird.api.validation import (
9
9
  clean_region,
10
10
  )
11
11
 
12
- TOP_100_URL = "https://ebird.org/ws2.0/product/top100/%s/%s"
13
- TOTALS_URL = "https://ebird.org/ws2.0/product/stats/%s/%s"
12
+ TOP_100_URL = "https://api.ebird.org/v2/product/top100/%s/%s"
13
+ TOTALS_URL = "https://api.ebird.org/v2/product/stats/%s/%s"
14
14
 
15
15
 
16
16
  def get_top_100(token, region, date, rank="spp", max_results=100):
@@ -9,10 +9,10 @@ from ebird.api.validation import (
9
9
  clean_species_code,
10
10
  )
11
11
 
12
- TAXONOMY_URL = "https://ebird.org/ws2.0/ref/taxonomy/ebird"
13
- TAXONOMY_FORMS_URL = "https://ebird.org/ws2.0/ref/taxon/forms/%s"
14
- TAXONOMY_GROUPS_URL = "https://ebird.org/ws2.0/ref/sppgroup/%s"
15
- TAXONOMY_VERSIONS_URL = "https://ebird.org/ws2.0/ref/taxonomy/versions"
12
+ TAXONOMY_URL = "https://api.ebird.org/v2/ref/taxonomy/ebird"
13
+ TAXONOMY_FORMS_URL = "https://api.ebird.org/v2/ref/taxon/forms/%s"
14
+ TAXONOMY_GROUPS_URL = "https://api.ebird.org/v2/ref/sppgroup/%s"
15
+ TAXONOMY_VERSIONS_URL = "https://api.ebird.org/v2/ref/taxonomy/versions"
16
16
  TAXONOMY_LOCALES_URL = "https://api.ebird.org/v2/ref/taxa-locales/ebird"
17
17
 
18
18
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ebird-api
3
- Version: 3.1.0
3
+ Version: 3.2.0
4
4
  Summary: Wrapper for accessing the eBird API
5
5
  Author-email: Project Babbler <projectbabbler@gmail.com>
6
6
  License: MIT License
@@ -10,6 +10,7 @@ src/ebird/api/constants.py
10
10
  src/ebird/api/hotspots.py
11
11
  src/ebird/api/observations.py
12
12
  src/ebird/api/regions.py
13
+ src/ebird/api/species.py
13
14
  src/ebird/api/statistics.py
14
15
  src/ebird/api/taxonomy.py
15
16
  src/ebird/api/utils.py
File without changes
File without changes
File without changes
File without changes