Skip to content

feat: Basic CLI and OpenWeatherMap setup#4

Merged
im-coder-lg merged 13 commits into
mainfrom
indev-001
Feb 1, 2023
Merged

feat: Basic CLI and OpenWeatherMap setup#4
im-coder-lg merged 13 commits into
mainfrom
indev-001

Conversation

@im-coder-lg
Copy link
Copy Markdown
Member

Our first order of business, fellas!

P.S. to test, use VS Code.
P. P. S. now we can test the API to make sure our request always works.

@im-coder-lg im-coder-lg added the enhancement New feature or request label Jan 26, 2023
@im-coder-lg im-coder-lg self-assigned this Jan 26, 2023
@im-coder-lg
Copy link
Copy Markdown
Member Author

im-coder-lg commented Jan 26, 2023

P. P. P. S. just can now be used as our scriptrunner!

@not-nef
Copy link
Copy Markdown
Member

not-nef commented Jan 26, 2023

isnt os.getenv for getting an environment variable? do you expect all devs to get an api token?

@sumeshir26
Copy link
Copy Markdown
Member

@im-coder-lg OpenWeatherMap's API is reallay liberal so I feel there is no reason not to keep a common key. You are allowed one request/second which is pretty good IMO for now

@im-coder-lg
Copy link
Copy Markdown
Member Author

I am SCARED of leaking that into open-source space right now. Plus, getting the API key for every individual is always easy, and also - we ought to look into it right now. I felt scared to death seeing the public key out there - right now, having .envs will work. It's just something in my formulated plan, except the old commit.

@im-coder-lg
Copy link
Copy Markdown
Member Author

do you expect all devs to get an api token?

sorta? Right now, I need to think carefully. 2000 calls ain't gonna work always, right?

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 26, 2023

I am SCARED of leaking that into open-source space right now. Plus, getting the API key for every individual is always easy, and also - we ought to look into it right now. I felt scared to death seeing the public key out there - right now, having .envs will work. It's just something in my formulated plan, except the old commit.

It's just a weather api, if its free no harm, right?

@im-coder-lg
Copy link
Copy Markdown
Member Author

im-coder-lg commented Jan 26, 2023

Well, the API is for free use in this world, right? There is a possibility of someone finding this API key and using it for their own work. I can't end up finding my account just got billed, right? It could be just straight-up dangerous for me. Plus, we will have to help them get an API key for themselves, and perhaps fuel them to have ideas for this project/their own project. We can think of new ways for it later - right now, we don't want these hindrances.

I'm just being paranoid, this is my "panic mode".

# edit: signing off

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 26, 2023

I've got an idea. We set up a server that has it's own api and gets a forecast for major cities so that the key never has to go public and the app just calls the server for some of the major cities that the user has added and the key never goes public (do less than 1,000 calls per day from the main server and the api is free too and now its just about setting up a free server (I'm supposed to get a raspberry pi sometime soon so maybe I could rig up my old one (raspberry pi 2B) to be the main server...) and then calling that server 😃 )

@im-coder-lg
Copy link
Copy Markdown
Member Author

Who will have to pay for the domain tho...

@sumeshir26
Copy link
Copy Markdown
Member

@im-coder-lg If you are scared about your account getting billed, we can use my API key.
BTW you don't get billed for going over the API limit(I did that once), the request just fails.

@im-coder-lg
Copy link
Copy Markdown
Member Author

Huh. Well is there a way to keep it hidden from the users, just as a simple thing?

@im-coder-lg
Copy link
Copy Markdown
Member Author

A plan is formulating inside my brain, I bet it will be insanely cool.

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 27, 2023

The reason I say no source folder is because I can set up the build action easier without one and I think it would be so cool to use this on my menubar

@im-coder-lg
Copy link
Copy Markdown
Member Author

Hmm @Moosems there IS one issue. The domain - how would we achieve that? Would DuckDNS work?

@im-coder-lg
Copy link
Copy Markdown
Member Author

The reason I say no source folder is because I can set up the build action easier without one and I think it would be so cool to use this on my menubar

I didn't get you here. What do you mean by a source folder? I thought we could use AppImages and Flatpaks... Right?

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 27, 2023

I mean that in all other Futura projects there's a src folder but this would require some special functions to get images and whatnot when working with pyinstaller builds and mac application bundles

@sumeshir26
Copy link
Copy Markdown
Member

No, just put the .spec file inside /src and make workflows cd src

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 27, 2023

Hmm @Moosems there IS one issue. The domain - how would we achieve that? Would DuckDNS work?

A flask web app hosted on a raspberry pi doesn't require a domain

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 27, 2023

I just have to ensure it NEVER turns off and has no important data on it (like location)

@im-coder-lg
Copy link
Copy Markdown
Member Author

No, a domain to access the server!

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 28, 2023

-_- I know what you're saying, there's also free servers that provide a domain

booyah ha!
@im-coder-lg
Copy link
Copy Markdown
Member Author

gottem guys

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 31, 2023

And @im-coder-lg this is currently just prototype/POC code right? No production style quite yet

@im-coder-lg
Copy link
Copy Markdown
Member Author

Guys, this is ready for merge.

Screenshot of how I wanted it to work:

image

To-do list(I'll make it official):

  • Add TOKEN switcher
  • Primitive GUI
  • Add Assets to GUI
  • Add workflows
  • Setup build tools and workflows
  • Final touches
  • v1.0.0-alpha
  • Add Sun Valley GUI
  • Backgrounds cooperating w/ theme
  • Icons
  • Linux Support(PROPER)
  • v1.0.0-beta
  • More tools
  • Tabview(?)
  • v1.0.0

Does this look good? Anything I have to remove/change? I need to know, gotta plan availability.

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 31, 2023

Never works when I type in the city :\

@im-coder-lg
Copy link
Copy Markdown
Member Author

Huh. Can you send a screenshot?

@im-coder-lg
Copy link
Copy Markdown
Member Author

Maybe you didn't enter the city name properly? It happened when I tried searching for NYC once, y'know. The second try worked though.

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 31, 2023

It's the TOKEN as an env variable, mac likes to be picky

@im-coder-lg
Copy link
Copy Markdown
Member Author

Wait, hold on. I put the TOKEN variable as a globally-declared string! Screenshots, please! I gotta know what went wrong.

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 31, 2023

Because you put the TOKEN = os.getenv("TOKEN") after it turns into the env var and I can't set it for some reason on my mac

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 31, 2023

can't set the env var*

@Moosems
Copy link
Copy Markdown
Member

Moosems commented Jan 31, 2023

Screen Shot 2023-01-31 at 8 31 31 AM

I added a print (TOKEN) to OWMCITY

@im-coder-lg
Copy link
Copy Markdown
Member Author

Oh, now I see what you did there.

And yeah, even I see it now. Odd. Very odd.

@im-coder-lg
Copy link
Copy Markdown
Member Author

Lemme debug this and see.

@im-coder-lg
Copy link
Copy Markdown
Member Author

@Moosems fixed 👍

I think I accidentally added the .env part, which is damn odd...

@im-coder-lg
Copy link
Copy Markdown
Member Author

2023-01-31.20-46-44.mp4

Fix proved here ⬆️

@im-coder-lg
Copy link
Copy Markdown
Member Author

im-coder-lg commented Jan 31, 2023

As you can see, restarting leads to errors. I think I know a fix though.

Edit: fix fail :(

@sumeshir26 sumeshir26 changed the title Indev-001 feat: Basic CLI and OpenWeatherMap setup Jan 31, 2023
@im-coder-lg
Copy link
Copy Markdown
Member Author

@sumeshir26 I need help in clearing the CITY variable on every restart. Can you help?

@sumeshir26
Copy link
Copy Markdown
Member

@sumeshir26 I need help in clearing the CITY variable on every restart. Can you help?

Sure

Copy link
Copy Markdown
Member

@Moosems Moosems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good first draft. Lets set some clear cut goals now and go from there :)

@im-coder-lg im-coder-lg merged commit 3ba6691 into main Feb 1, 2023
@im-coder-lg im-coder-lg deleted the indev-001 branch March 3, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants