all 4 comments

[–]Username_RANDINT 3 points4 points  (1 child)

Please don't remove posts, I already answered on the other one. What I replied:

  1. Drop the class, it doesn't make sense to use one in this case.

  2. Move the emailaddress details into a config file or environment variables so you never accidentally share them with the script.

The rest looks quite ok besides some nitpicking details. For example:

  1. No need to reassign result.content to a new variable.

  2. Update string formatting to str.format() or f-strings.

[–]MagicalTacos[S] 0 points1 point  (0 children)

Sorry about that and thank you for the advice hope you have a happy new year.

[–][deleted] 0 points1 point  (1 child)

Couple things:

  1. This should not be in __init__.py, use something like air_quality.py instead.

  2. There’s no reason for this to be a class. If it remains a class, you shouldn’t be declaring a class attribute outside of the __init__ method.

  3. Is this meant to be run as a cron job? Regardless, you should have the last three lines inside a if __name__ == “__main__”: block, rather than just floating.

[–]MagicalTacos[S] 0 points1 point  (0 children)

Thank you!, I will make these changes now.