DEV Community

Tasbi Tasbi
Tasbi Tasbi

Posted on

Hacktoberfest Adventure: Adding Weather Magic to 100LinesOfPythonCode 🌦️✨

Hey everyone! 👋

I just wrapped up my fourth Pull Request for Hacktoberfest 2024, and it’s been such a rewarding experience. This time, I tackled an issue in the 100LinesOfPythonCode repo, where I added a Weather App that pulls in today’s forecast using the OpenWeatherMap API. Let me take you through my journey of coding, challenges, and fun.

🌤️ The Weather App PR

The goal was pretty straightforward: create a Python app that fetches weather information using an API. This is now live in the pull request #18. It’s not just your regular weather app, though! I spiced things up by using the rich library to make the terminal output look fabulous—complete with colored tables and loading animations. After all, why settle for boring text when you can make it beautiful, right? 😉

This PR adds the ability to get today’s forecast by simply entering the city name. I also made sure the data gets saved to a local JSON file so you can revisit it later. It’s a fun little project that really showcases how much visual polish matters, even in CLI apps.

🌀 The "Challenges" (A.K.A. The Hard Parts)

This project wasn't without its tricky moments. One of the hardest parts was handling asynchronous API data fetching while maintaining a clean and user-friendly terminal output. Managing the response timing with the loading animation needed careful tweaking, especially to avoid unnecessary delays while still making the user feel like the data-fetching process was smooth. Getting the balance between user engagement and efficiency was a real challenge.

Lastly, keeping my fork up-to-date was tricky because the owner kept making changes to the main branch. I had to frequently merge upstream changes into my working branch to avoid conflicts. This was a great learning experience in managing merge conflicts and maintaining a clean history, but it certainly added some complexity!

🚦 PR Waiting Game: My Third Hacktoberfest PR

My third Hacktoberfest PR was a bit of a waiting game. I was working on the Terminal Cricket Game, where I added core features and improved the terminal experience. The owner asked me to make changes in the root directory, and since then, I've been waiting for a response. It's part of the Hacktoberfest adventure—the thrill of coding, submitting, and waiting for that sweet, sweet "merged" notification. 🚀

🌈 Lessons Learned

  1. Presentation Matters: It’s not just about the data; it’s about how you present it. The rich library really helped me take this weather app from "meh" to "wow!".
  2. Keep Your Fork Updated: The owner made some changes while I was working on my fork, so I had to frequently pull from the upstream to stay synced. It’s a good habit to learn when contributing to open source.
  3. Persistence is Key: Waiting for a PR to be reviewed can feel like forever, but staying engaged and being patient is all part of the experience.

🚀 What’s Next?

I’ve got a few more PRs to go for Hacktoberfest, and I’m looking for even more exciting issues to tackle. If you have any suggestions or projects, drop them in the comments below! I’m loving this journey so far, and can’t wait to see what else I can contribute to.

Until next time, stay curious and keep coding! 🌟

Check out my Weather App PR here

Follow my Hacktoberfest journey on DEV

Top comments (0)