beachdayapi 0.1.0__tar.gz → 0.1.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.
- {beachdayapi-0.1.0 → beachdayapi-0.1.2}/PKG-INFO +14 -7
- {beachdayapi-0.1.0 → beachdayapi-0.1.2}/README.md +12 -4
- {beachdayapi-0.1.0 → beachdayapi-0.1.2}/beachdayapi/__init__.py +3 -3
- {beachdayapi-0.1.0 → beachdayapi-0.1.2}/beachdayapi/client.py +5 -1
- {beachdayapi-0.1.0 → beachdayapi-0.1.2}/beachdayapi.egg-info/PKG-INFO +14 -7
- {beachdayapi-0.1.0 → beachdayapi-0.1.2}/pyproject.toml +3 -3
- {beachdayapi-0.1.0 → beachdayapi-0.1.2}/beachdayapi/exceptions.py +0 -0
- {beachdayapi-0.1.0 → beachdayapi-0.1.2}/beachdayapi.egg-info/SOURCES.txt +0 -0
- {beachdayapi-0.1.0 → beachdayapi-0.1.2}/beachdayapi.egg-info/dependency_links.txt +0 -0
- {beachdayapi-0.1.0 → beachdayapi-0.1.2}/beachdayapi.egg-info/top_level.txt +0 -0
- {beachdayapi-0.1.0 → beachdayapi-0.1.2}/setup.cfg +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: beachdayapi
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Python client for the Beach Day API — real-time beach and surf conditions
|
|
5
5
|
Author-email: Beach Day API <hello@beachdayapi.com>
|
|
6
|
-
License: MIT
|
|
6
|
+
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://beachdayapi.com
|
|
8
8
|
Project-URL: Documentation, https://beachdayapi.com/docs
|
|
9
9
|
Project-URL: Repository, https://github.com/rv888/beachdayapi
|
|
@@ -11,7 +11,6 @@ Project-URL: Issues, https://github.com/rv888/beachdayapi/issues
|
|
|
11
11
|
Keywords: beach,surf,water-quality,weather,api
|
|
12
12
|
Classifier: Development Status :: 4 - Beta
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
15
14
|
Classifier: Programming Language :: Python :: 3
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.9
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -29,7 +28,7 @@ Description-Content-Type: text/markdown
|
|
|
29
28
|
[](https://pypi.org/project/beachdayapi/)
|
|
30
29
|
[](https://opensource.org/licenses/MIT)
|
|
31
30
|
|
|
32
|
-
Python client for the [Beach Day API](https://beachdayapi.com) — water quality, weather, tides, ocean conditions, beach rules, amenities, and composite scoring in a single call. Covers
|
|
31
|
+
Python client for the [Beach Day API](https://beachdayapi.com) — water quality, weather, tides, ocean conditions, beach rules, amenities, and composite scoring in a single call. Covers 4,500+ beaches across the US, Australia, South Africa, and Spain.
|
|
33
32
|
|
|
34
33
|
```bash
|
|
35
34
|
pip install beachdayapi
|
|
@@ -42,21 +41,29 @@ from beachdayapi import BeachDayAPI
|
|
|
42
41
|
|
|
43
42
|
client = BeachDayAPI("bda_your_api_key")
|
|
44
43
|
|
|
45
|
-
# Search beaches
|
|
44
|
+
# Search beaches by state (supports offset/limit pagination)
|
|
46
45
|
beaches = client.beaches.list(state="CA")
|
|
46
|
+
# Pagination: client.beaches.list(state="CA", offset=100, limit=50)
|
|
47
|
+
# Filter by country: client.beaches.list(country="Cambodia")
|
|
47
48
|
for b in beaches["data"]:
|
|
48
49
|
print(b["name"], b["state"])
|
|
49
50
|
|
|
51
|
+
# Search beaches by name
|
|
52
|
+
malibu = client.beaches.list(search="Malibu")
|
|
53
|
+
print(f"Found {malibu['count']} beaches matching 'Malibu'")
|
|
54
|
+
|
|
50
55
|
# Get full detail for a beach
|
|
51
56
|
beach = client.beaches.get(372)
|
|
52
57
|
print(beach["data"]["name"], beach["data"]["beach_day_score"])
|
|
53
58
|
|
|
54
|
-
# Get current conditions
|
|
59
|
+
# Get current conditions (supports offset/limit)
|
|
55
60
|
conditions = client.beaches.conditions(372)
|
|
61
|
+
# Pagination: client.beaches.conditions(372, offset=30, limit=15)
|
|
56
62
|
print(conditions["data"]["water_quality_grade"])
|
|
57
63
|
|
|
58
|
-
# Get top-scored beaches
|
|
64
|
+
# Get top-scored beaches (supports offset/limit)
|
|
59
65
|
scored = client.beaches.scored(min_score=70, limit=10)
|
|
66
|
+
# Pagination: client.beaches.scored(offset=50, limit=25)
|
|
60
67
|
for b in scored["data"]:
|
|
61
68
|
print(f"{b['name']}: {b['beach_day_score']}")
|
|
62
69
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://pypi.org/project/beachdayapi/)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
|
|
7
|
-
Python client for the [Beach Day API](https://beachdayapi.com) — water quality, weather, tides, ocean conditions, beach rules, amenities, and composite scoring in a single call. Covers
|
|
7
|
+
Python client for the [Beach Day API](https://beachdayapi.com) — water quality, weather, tides, ocean conditions, beach rules, amenities, and composite scoring in a single call. Covers 4,500+ beaches across the US, Australia, South Africa, and Spain.
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
pip install beachdayapi
|
|
@@ -17,21 +17,29 @@ from beachdayapi import BeachDayAPI
|
|
|
17
17
|
|
|
18
18
|
client = BeachDayAPI("bda_your_api_key")
|
|
19
19
|
|
|
20
|
-
# Search beaches
|
|
20
|
+
# Search beaches by state (supports offset/limit pagination)
|
|
21
21
|
beaches = client.beaches.list(state="CA")
|
|
22
|
+
# Pagination: client.beaches.list(state="CA", offset=100, limit=50)
|
|
23
|
+
# Filter by country: client.beaches.list(country="Cambodia")
|
|
22
24
|
for b in beaches["data"]:
|
|
23
25
|
print(b["name"], b["state"])
|
|
24
26
|
|
|
27
|
+
# Search beaches by name
|
|
28
|
+
malibu = client.beaches.list(search="Malibu")
|
|
29
|
+
print(f"Found {malibu['count']} beaches matching 'Malibu'")
|
|
30
|
+
|
|
25
31
|
# Get full detail for a beach
|
|
26
32
|
beach = client.beaches.get(372)
|
|
27
33
|
print(beach["data"]["name"], beach["data"]["beach_day_score"])
|
|
28
34
|
|
|
29
|
-
# Get current conditions
|
|
35
|
+
# Get current conditions (supports offset/limit)
|
|
30
36
|
conditions = client.beaches.conditions(372)
|
|
37
|
+
# Pagination: client.beaches.conditions(372, offset=30, limit=15)
|
|
31
38
|
print(conditions["data"]["water_quality_grade"])
|
|
32
39
|
|
|
33
|
-
# Get top-scored beaches
|
|
40
|
+
# Get top-scored beaches (supports offset/limit)
|
|
34
41
|
scored = client.beaches.scored(min_score=70, limit=10)
|
|
42
|
+
# Pagination: client.beaches.scored(offset=50, limit=25)
|
|
35
43
|
for b in scored["data"]:
|
|
36
44
|
print(f"{b['name']}: {b['beach_day_score']}")
|
|
37
45
|
|
|
@@ -9,13 +9,13 @@ Usage:
|
|
|
9
9
|
|
|
10
10
|
client = BeachDayAPI("bda_your_api_key")
|
|
11
11
|
|
|
12
|
-
# Search beaches
|
|
12
|
+
# Search beaches (returns list under 'results')
|
|
13
13
|
beaches = client.beaches.list(state="CA")
|
|
14
14
|
|
|
15
|
-
# Get beach detail
|
|
15
|
+
# Get beach detail (returns object directly)
|
|
16
16
|
beach = client.beaches.get(372)
|
|
17
17
|
|
|
18
|
-
# Get scored beaches
|
|
18
|
+
# Get scored beaches (returns list under 'results')
|
|
19
19
|
scored = client.beaches.scored(min_score=70)
|
|
20
20
|
|
|
21
21
|
# Health check (no auth)
|
|
@@ -2,6 +2,7 @@ import urllib.request
|
|
|
2
2
|
import urllib.error
|
|
3
3
|
import urllib.parse
|
|
4
4
|
import json
|
|
5
|
+
import os
|
|
5
6
|
from typing import Optional, Dict, Any, List
|
|
6
7
|
from .exceptions import (
|
|
7
8
|
AuthenticationError,
|
|
@@ -30,7 +31,7 @@ class BeachDayAPI:
|
|
|
30
31
|
base_url: Optional[str] = None,
|
|
31
32
|
timeout: int = 30,
|
|
32
33
|
):
|
|
33
|
-
self.api_key = api_key
|
|
34
|
+
self.api_key = api_key or os.environ.get("BEACHDAY_API_KEY")
|
|
34
35
|
self.base_url = base_url or self.BASE_URL
|
|
35
36
|
self.timeout = timeout
|
|
36
37
|
self.beaches = BeachEndpoints(self)
|
|
@@ -110,6 +111,7 @@ class BeachEndpoints:
|
|
|
110
111
|
def list(
|
|
111
112
|
self,
|
|
112
113
|
state: Optional[str] = None,
|
|
114
|
+
country: Optional[str] = None,
|
|
113
115
|
search: Optional[str] = None,
|
|
114
116
|
limit: Optional[int] = None,
|
|
115
117
|
offset: Optional[int] = None,
|
|
@@ -118,12 +120,14 @@ class BeachEndpoints:
|
|
|
118
120
|
|
|
119
121
|
Args:
|
|
120
122
|
state: Two-letter US state code or 'AU-NSW'/'AU-VIC'.
|
|
123
|
+
country: Country name (e.g. 'Cambodia', 'Vietnam', 'Thailand').
|
|
121
124
|
search: Search term for beach name.
|
|
122
125
|
limit: Max results per page.
|
|
123
126
|
offset: Pagination offset.
|
|
124
127
|
"""
|
|
125
128
|
return self._client._get("/beaches", {
|
|
126
129
|
"state": state,
|
|
130
|
+
"country": country,
|
|
127
131
|
"search": search,
|
|
128
132
|
"limit": limit,
|
|
129
133
|
"offset": offset,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: beachdayapi
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Python client for the Beach Day API — real-time beach and surf conditions
|
|
5
5
|
Author-email: Beach Day API <hello@beachdayapi.com>
|
|
6
|
-
License: MIT
|
|
6
|
+
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://beachdayapi.com
|
|
8
8
|
Project-URL: Documentation, https://beachdayapi.com/docs
|
|
9
9
|
Project-URL: Repository, https://github.com/rv888/beachdayapi
|
|
@@ -11,7 +11,6 @@ Project-URL: Issues, https://github.com/rv888/beachdayapi/issues
|
|
|
11
11
|
Keywords: beach,surf,water-quality,weather,api
|
|
12
12
|
Classifier: Development Status :: 4 - Beta
|
|
13
13
|
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
15
14
|
Classifier: Programming Language :: Python :: 3
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.9
|
|
17
16
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -29,7 +28,7 @@ Description-Content-Type: text/markdown
|
|
|
29
28
|
[](https://pypi.org/project/beachdayapi/)
|
|
30
29
|
[](https://opensource.org/licenses/MIT)
|
|
31
30
|
|
|
32
|
-
Python client for the [Beach Day API](https://beachdayapi.com) — water quality, weather, tides, ocean conditions, beach rules, amenities, and composite scoring in a single call. Covers
|
|
31
|
+
Python client for the [Beach Day API](https://beachdayapi.com) — water quality, weather, tides, ocean conditions, beach rules, amenities, and composite scoring in a single call. Covers 4,500+ beaches across the US, Australia, South Africa, and Spain.
|
|
33
32
|
|
|
34
33
|
```bash
|
|
35
34
|
pip install beachdayapi
|
|
@@ -42,21 +41,29 @@ from beachdayapi import BeachDayAPI
|
|
|
42
41
|
|
|
43
42
|
client = BeachDayAPI("bda_your_api_key")
|
|
44
43
|
|
|
45
|
-
# Search beaches
|
|
44
|
+
# Search beaches by state (supports offset/limit pagination)
|
|
46
45
|
beaches = client.beaches.list(state="CA")
|
|
46
|
+
# Pagination: client.beaches.list(state="CA", offset=100, limit=50)
|
|
47
|
+
# Filter by country: client.beaches.list(country="Cambodia")
|
|
47
48
|
for b in beaches["data"]:
|
|
48
49
|
print(b["name"], b["state"])
|
|
49
50
|
|
|
51
|
+
# Search beaches by name
|
|
52
|
+
malibu = client.beaches.list(search="Malibu")
|
|
53
|
+
print(f"Found {malibu['count']} beaches matching 'Malibu'")
|
|
54
|
+
|
|
50
55
|
# Get full detail for a beach
|
|
51
56
|
beach = client.beaches.get(372)
|
|
52
57
|
print(beach["data"]["name"], beach["data"]["beach_day_score"])
|
|
53
58
|
|
|
54
|
-
# Get current conditions
|
|
59
|
+
# Get current conditions (supports offset/limit)
|
|
55
60
|
conditions = client.beaches.conditions(372)
|
|
61
|
+
# Pagination: client.beaches.conditions(372, offset=30, limit=15)
|
|
56
62
|
print(conditions["data"]["water_quality_grade"])
|
|
57
63
|
|
|
58
|
-
# Get top-scored beaches
|
|
64
|
+
# Get top-scored beaches (supports offset/limit)
|
|
59
65
|
scored = client.beaches.scored(min_score=70, limit=10)
|
|
66
|
+
# Pagination: client.beaches.scored(offset=50, limit=25)
|
|
60
67
|
for b in scored["data"]:
|
|
61
68
|
print(f"{b['name']}: {b['beach_day_score']}")
|
|
62
69
|
|
|
@@ -4,16 +4,16 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "beachdayapi"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.2"
|
|
8
8
|
description = "Python client for the Beach Day API — real-time beach and surf conditions"
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
license =
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE*"]
|
|
11
12
|
authors = [{name = "Beach Day API", email = "hello@beachdayapi.com"}]
|
|
12
13
|
keywords = ["beach", "surf", "water-quality", "weather", "api"]
|
|
13
14
|
classifiers = [
|
|
14
15
|
"Development Status :: 4 - Beta",
|
|
15
16
|
"Intended Audience :: Developers",
|
|
16
|
-
"License :: OSI Approved :: MIT License",
|
|
17
17
|
"Programming Language :: Python :: 3",
|
|
18
18
|
"Programming Language :: Python :: 3.9",
|
|
19
19
|
"Programming Language :: Python :: 3.10",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|