Futura-Py / weather

Coming soon
MIT License
4 stars 1 forks source link

feat(api): package `pyowm` for easy usage of API #14

Closed im-coder-lg closed 1 year ago

im-coder-lg commented 1 year ago

~We need to test if it is compatible with packaging into files, i.e. if it would make the files heavy, which I will.~

Tasks

Please, do not change anything.

Note to self: Go to Gitpod and open your instance to code. Do not forget.

Edit(7 Aug 2023): Video proof on Zorin OS 16.3 Core

https://github.com/Futura-Py/weather/assets/76845820/68ee54ac-6218-4ade-b4b7-9f83ff6c06c5


I will have to add the other data, which I will do slowly. @Moosems can we make the label extend dynamically? That way, when the app launches, it would look small, but it will automatically enlarge upon searching for a city. We have to expand the row limit, maybe by incrementing with 1 when the search query is received... Your idea?

sumeshir26 commented 1 year ago

@im-coder-lg Imo the UI is a bit plain rn, and it needs a bit of improvements... Any ideas anyone?

im-coder-lg commented 1 year ago

We'll add Sun Valley after this PR. I wanted to start the repo this way, focusing on the UI in the end, since it would be cumbersome to manage.

im-coder-lg commented 1 year ago

I think you can try replacing it with Sun Valley slowly to see how it might turn out. And we need an icon. Get some ideas, and try creating it like with TimerX, that was perfect, and I can bet my Flash GIFs that you will make the best Weather icon. I'll try looking into other images to get some ideas, which I will post in a discussion soon.

im-coder-lg commented 1 year ago

Alright, it's night for me!

the-flash-salute

Moosems commented 1 year ago

What is pyowm?

Moosems commented 1 year ago

I could add a loading bar as it retrieves the info :D.

Moosems commented 1 year ago

Yes, I can make it dynamically expand ;). Permission to mess around with the PR?

Moosems commented 1 year ago

My idea:

It by default uses the minimum space, upon button press it updates the name, clears the entry, adds the loading bar, and expands the app to the proper size, and then as the data comes in and is processed the loading bar disappears and shows everything.

Moosems commented 1 year ago

We'll add Sun Valley after this PR. I wanted to start the repo this way, focusing on the UI in the end, since it would be cumbersome to manage.

Screams in lag.

Moosems commented 1 year ago

I think you can try replacing it with Sun Valley slowly to see how it might turn out. And we need an icon. Get some ideas, and try creating it like with TimerX, that was perfect, and I can bet my Flash GIFs that you will make the best Weather icon.

I'll try looking into other images to get some ideas, which I will post in a discussion soon.

My issue is the fact that it's either dark or light mode. I, though it's an unpopular opinion, prefer light mode.

im-coder-lg commented 1 year ago

Well, let's integrate a settings menu with the Sun Valley UI so that people can adjust the app to their choice+use their API if they want to.

im-coder-lg commented 1 year ago

What is pyowm?

A famous module just for OWM. It simplifies the API usage, though sometimes either could be inaccurate, as I have noticed at times.

Moosems commented 1 year ago

Our system never had any issues so why swap over?

im-coder-lg commented 1 year ago

I could add a loading bar as it retrieves the info :D.

Yeah, once we are done with this PR, we will do the loading bar. Maybe we get a light and dark variant to support both light mode and dark mode.

Yes, I can make it dynamically expand ;). Permission to mess around with the PR?

Unfortunately not now. Let me finish the changes and then you can add the dynamic expansion. If I am not wrong, you will have to add an increment to the values when a city is searched for, right? Tell me if I am right. And also, can we add the city name on top of the search bar? I'll take it from the API request or PyOWM and we shall see..

My idea: It by default uses the minimum space, upon button press it updates the name, clears the entry, adds the loading bar, and expands the app to the proper size, and then as the data comes in and is processed the loading bar disappears and shows everything.

🤔 Let's try that, but for the loading bar, can we keep it in minimum space till the data is received? Then we can expand the window size. Also, sometimes when a request timeout occurs via PyOWM, we have to update the status label(where we can put loading bar and take it as a double meaning in our method) to show "Request timeout. Please try again" or a similar message/pop-up(which I prefer).

We'll add Sun Valley after this PR. I wanted to start the repo this way, focusing on the UI in the end, since it would be cumbersome to manage.

Screams in lag.

Bro why?

My issue is the fact that it's either dark or light mode. I, though it's an unpopular opinion, prefer light mode.

Well, I prefer it before sunset, so we shall add both+system theme :)

Our system never had any issues so why swap over?

I don't know whether I told this, but I tested OWM on a Colab instance, and I used PyOWM for getting some of the data. Unlike the API, PyOWM processes the data for immediate use, so we wouldn't have to do the math we used to do so. Better in my opinion.

im-coder-lg commented 1 year ago

Anything else to add, guys? Till now, I added:

We need to make them modifiable, which we will do in later PRs. Anything I missed?

im-coder-lg commented 1 year ago

Oh, I forgot about the city name above the search bar. That's easy. I'll add it later. I need some time for managing the school work.

im-coder-lg commented 1 year ago

/ping @Moosems requesting a review from you! Check when free, artifacts are at latest action run :)

sumeshir26 commented 1 year ago

@im-coder-lg I just made a quick logo, feedback please! Futura Weather

im-coder-lg commented 1 year ago

yeah!

That. Is. Schway.

schwayyyy

Motion Approved!

im-coder-lg commented 1 year ago

@Moosems my changes are done here. You can add the dynamic scaling in this PR or another one(which can be preferred for neatness). Now, I added a label for the city so that when you search for a city, the actual name and country code appears on the label. For example, it is known in India that the city Bengaluru is usually referred to as Bangalore, just like that, and trust me, I know it. If I were to search either of the names for the same city, then the city name will still remain Bengaluru, since I took the name directly from the API. Neat trick, right?

Now, you can change the UI whichever way you want. I saw you mention that upon searching, the entry will be erased. In that case, make sure that there is a label for the city name, so that people would know the city name even after the entry is cleared. And make it a bit bigger in terms of font. Also, if you can, can you bind the Return/Enter key to the Search button? I tried, it didn't work, but I think if you do so, it might. Anyway, again, it is night for me. See ya soon!

the-flash-salute

Moosems commented 1 year ago

I'll make a branch off this PR and make my changes there.

sumeshir26 commented 1 year ago

@im-coder-lg I wont be able to review, you can go ahead and merge.

im-coder-lg commented 1 year ago

@sumeshir26 it's fine. @Moosems how's the dynamic scaling turning out? I want to merge this and then want to add the dynamic scaling, what do you think?

Moosems commented 1 year ago

Hadn't started on it until your changes were done. Will begin work tomorrow.

im-coder-lg commented 1 year ago

@Moosems I added two more changes to this PR, it is related to the Code Formatting workflow, which I just fixed. I just wanted to update you. I expect to be done with this by now, but I'll go through the code to find some errors that need to be refactored.

Moosems commented 1 year ago

Let me know when it's stable and I'll get a solid few days without changes.

im-coder-lg commented 1 year ago

Well, hoping this is the last one! Can you check the updated README? Pushed it here.

im-coder-lg commented 1 year ago

Yep, that's the last one. @Moosems are the changes ready or are you working on them? Maybe we could merge this, and then add the dynamic scaling, but what do you think we can do?

im-coder-lg commented 1 year ago

Does anybody want to use the Wiki page in GitHub? I'd like to start with a table-of-contents, with steps for coding and pushing the PRs here if we do need it... Do we need it?

sumeshir26 commented 1 year ago

Does anybody want to use the Wiki page in GitHub? I'd like to start with a table-of-contents, with steps for coding and pushing the PRs here if we do need it... Do we need it?

IMO it's not necessary at the moment, when this app gets more popular/complex we can add it.

im-coder-lg commented 1 year ago

I made a project when we started the repo, only realised that it was set to private for so long, so I made it public and added the @Futura-Py/reviewers team there. I added a list of things that we must add before Release v1.0.0, so anything that you want to add can be done so there. Don't use the Roadmap view yet, that is a hassle in and of itself.

Moosems commented 1 year ago

Yep, that's the last one. @Moosems are the changes ready or are you working on them? Maybe we could merge this, and then add the dynamic scaling, but what do you think we can do?

Merge this and then I add the UI updates as a separate PR.

im-coder-lg commented 1 year ago

Merging this PR!