jcconnell / python-magicseaweed Goto Github PK
View Code? Open in Web Editor NEWPython wrapper for the Magic Seaweed API
License: MIT License
Python wrapper for the Magic Seaweed API
License: MIT License
There may be in issue with how the timestamps are handled in this library. I have reached out to MSW for additional information. Some questions that should be answered:
start
and end
URL parameters be in the user's local time or in UTC?localTimestamp
is described in the docs as Unix timestamp adjusted to represent local time for this location.
Should this be converted to a Python datetime object as datetime.fromtimestamp() or datetime.utcfromtimestamp().issueTimestamp
is described as in the docs as GMT unix time for the start of this forecast. Although we call it the ‘issue’ time it’ll always actually become available after this time because we need to create or obtain the model data and prepare it for delivery.
Is this referring to the time when the forecast was made?start
and end
parameters set to datetime.now().timestamp()
(1533770006.53376) returned:[
{
"timestamp": 1533772800,
"localTimestamp": 1533751200,
"issueTimestamp": 1533729600,
"fadedRating": 0,
"solidRating": 0,
"swell": {
"absMinBreakingHeight": 0.82,
"absMaxBreakingHeight": 1.28,
"probability": 75,
"unit": "ft",
"minBreakingHeight": 1,
"maxBreakingHeight": 1,
"components": {
"combined": {
"height": 1.8,
"period": 7,
"direction": 268.24,
"compassDirection": "E"
},
"primary": {
"height": 0.9,
"period": 7,
"direction": 253.39,
"compassDirection": "ENE"
},
"secondary": {
"height": 0.9,
"period": 8,
"direction": 285.52,
"compassDirection": "ESE"
},
"tertiary": {
"height": 1.1,
"period": 3,
"direction": 303.51,
"compassDirection": "ESE"
}
}
},
"wind": {
"speed": 5,
"direction": 305,
"compassDirection": "SE",
"chill": 91,
"gusts": 9,
"unit": "mph"
},
"condition": {
"pressure": 1018,
"temperature": 86,
"weather": "1",
"unitPressure": "mb",
"unit": "f"
},
"charts": {
"swell": "https://hist-1.msw.ms/wave/750/21-1533772800-1.gif",
"period": "https://hist-1.msw.ms/wave/750/21-1533772800-2.gif",
"wind": "https://hist-1.msw.ms/gfs/750/21-1533772800-4.gif",
"pressure": "https://hist-1.msw.ms/gfs/750/21-1533772800-3.gif",
"sst": "https://hist-1.msw.ms/sst/750/21-1533772800-10.gif"
}
}
]
localTimestamp
to a datetime object produced these results:>>> datetime.utcfromtimestamp(1533751200).strftime("%a %-I %p")
'Wed 6 PM'
>>> datetime.fromtimestamp(1533751200).strftime("%a %-I %p")
'Wed 2 PM'
issueTimestamp
to a datetime object produced these results:>>> datetime.utcfromtimestamp(1533729600).strftime("%a %-I %p")
'Wed 12 PM'
>>> datetime.fromtimestamp(1533729600).strftime("%a %-I %p")
'Wed 8 AM'
localTimestamp
should use datetime.utcfromtimestamp()
issueTimestamp
should use datetime.fromTimestamp()
I'm not receiving the swell direction attribute. The only attributes I have showing are:
for the breaking min/max sensors
air_pressure: 1016mb
air_temp: 22° c
stars: 0 solid, 0 faded
begins: Tue 12 PM
issued: Mon 6 PM
max_breaking_height: 0.2 m
min_breaking_height: 0.1 m
probability: 95%
swell_period: 5 seconds
wind_chill: 17°
wind_direction: 219° NE
wind_gusts: 41 kph
wind_speed: 33 kph
unit_of_measurement: m
for the forecast sensor
12PM: 0.1 - 0.2 m
3PM: 0.2 - 0.3 m
6PM: 0.2 - 0.3 m
9PM: 0.2 - 0.3 m
12AM: 0.2 - 0.3 m
3AM: 0.3 - 0.5 m
6AM: 0.3 - 0.4 m
9AM: 0.3 - 0.4 m
unit_of_measurement: m
when I look at my API through a browser there is definitely swell direction information there for whatever reason though it is not being displayed.
The link in the readme to sign up for an API key gets a 404.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.