Giter Site home page Giter Site logo

aaryamantriescode / cameron-highlands-weather-logger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pizofreude/cameron-highlands-weather-logger

0.0 0.0 0.0 16 KB

This project logs the weather data in Cameron Highlands every six hours on daily basis.

License: Apache License 2.0

Python 100.00%

cameron-highlands-weather-logger's Introduction

Cameron Highlands Weather Logger

This is a Python project that logs the weather data in Cameron Highlands, Tanah Rata, Pahang, Malaysia every six hours daily. The project uses the Talk Python Weather API to get the current temperature and saves it to a status.log file.

Requirements

  • Python 3.8 or higher
  • requests library
  • logging library
  • CHWL_SECRET environment variable

Usage

To run the project, you need to set the CHWL_SECRET environment variable to Cameron Highland Weather Logger repository. You can set it from:

  • Repository settings
  • Under Security
  • Under Secrets and Variable
  • Under Actions and create New Repository Secret
  • Create CHWL_SECRET and enter your own arbitrarily chosen token value

Then, you can run the main.py file as follows:

python main.py

The project will log the current temperature in Cameron Highlands to the status.log file, along with the date, time, and level of the message. The status.log file will rotate when it reaches 1 MB in size, and keep one backup file.

Example Output

Here is an example of the output in the status.log file:

2023-12-02 22:41:41,123 - __main__ - INFO - Token value: 1234567890
2023-12-02 22:41:42,456 - __main__ - INFO - Weather in Cameron Highlands: 18

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

cameron-highlands-weather-logger's People

Contributors

pizofreude avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.