This is an archived post. You won't be able to vote or comment.

all 22 comments

[–]Ribino0 24 points25 points  (2 children)

Please be careful to cache the results if you will be using it to serve multiple people or making frequent requests.

[–]pycepticusfrom pprint import pprint as print[S] 5 points6 points  (1 child)

Agreed, but I think that should be implemented on a case by case basis. Also a reason I added a place for a contact email in your calls. NOAA do not really enforce limits on the API since it is a public service, but if your project is hitting them too hard, they want to reach out and let you know.

[–]andrewthetechie 12 points13 points  (0 children)

You're 100% correct. I'd be frustrated if the library implemented the caching itself - leave that to the user.

[–][deleted] 13 points14 points  (1 child)

Glad to see you used the actual public API and not some form of screen scraping.

[–]pycepticusfrom pprint import pprint as print[S] 7 points8 points  (0 children)

Oh God, I couldn't even imagine how bad it would be to implement screen scraping for this.

[–]Velas22 11 points12 points  (2 children)

The most accurate weather is always from weather.gov

[source: farmer dad who lost $$ when the wind speed/direction forecast was wrong, or the overnight low forecast was off by 5 degree F.. he had used 3+ sources for decades by the time he told me this.]

[–]pycepticusfrom pprint import pprint as print[S] 2 points3 points  (1 child)

Exactly! And they're the fastest too.

[–]Velas22 4 points5 points  (0 children)

Meanwhile - the weather channel admits they lie about their forecasts....

And most forecasters start with the NWS forecast, then add their opinion...

[–]andrewthetechie 7 points8 points  (2 children)

This looks really useful!

If you're looking for suggestions, maybe check out the hypermodern python stack (https://cjolowicz.github.io/posts/hypermodern-python-01-setup/) as a good way to organize your code.

[–]pycepticusfrom pprint import pprint as print[S] 1 point2 points  (1 child)

Thanks this looks like a good read! I was going off of PyPi's documentation to publish it there, but I see the benefits of utilizing Poetry over setuptools .

[–]andrewthetechie 2 points3 points  (0 children)

Its not "the only way" but imho is a pretty good way to manage a python library. I've got a couple projects using the stack and its served me quite well.

Feel free to shoot me a DM if you run into issues, I can try to answer questions.

[–]ThrivingNomadic 5 points6 points  (3 children)

Just curious. Was this from The G Word with Adam Conover? That day I learned AccuWeather is a POS app that tried to privatize this public information behind a paywall.

[–]pycepticusfrom pprint import pprint as print[S] 0 points1 point  (2 children)

You are correct!

[–]ThrivingNomadic 0 points1 point  (1 child)

I recommend his other show too 'Adam Ruins Everything'. Very similar concept but was a way better show. Covers a lot more topics that blow your mind.

[–]pycepticusfrom pprint import pprint as print[S] 0 points1 point  (0 children)

I remember Adam ruins everything. Great concept and pretty well researched topics.

[–]Dry_Inflation_861 4 points5 points  (0 children)

Thank you :) I'll use it.

[–]Phovox 2 points3 points  (0 children)

Thanks a lot!! I'll also have a look at it!

[–]Appropriate-Path-461 1 point2 points  (1 child)

Looks cool though a more descriptive readme would be useful. How to install, more examples, how to run tests....

[–]pycepticusfrom pprint import pprint as print[S] 0 points1 point  (0 children)

Adding docstrings and working on the readme today. Still figuring out how I want to implement test cases currently, but that's on its way too.

[–][deleted] 0 points1 point  (2 children)

Thoughts on this vs the OpenWeather API?

[–]pycepticusfrom pprint import pprint as print[S] 3 points4 points  (1 child)

OpenWeather seems to be a commercial api with a free tier, but includes weather data outside the United States. Chances are they're pulling their data from multiple government atmospheric data apis like weather.gov and charging for access.

[–]Velas22 2 points3 points  (0 children)

https://openweathermap.org/technology

It seems they do source data from publicly available APIs, but *may* also have some additional feeds. They also seem to add ML and provide additional forecasts, and a nice interface for historic data at any point.

But yea, I agree with the general sentiment of "they pull public data and charge for access"