Implemented in Flask, Python3, It is a basic CRUD application which supports searching for cities worldwide and adding them as css cards showing their temperature and other details, It also supports deleting the cards.
To use this project.
- Install dependencies & export environment variables.
$ sudo -H pip3 install -r requirements.txt
$ export FLASK_APP=app.py
- Start project using
$ flask run
- Add a file structure here with the basic details about files, below is an example.
.
โโโ apikey.txt
โโโ app.py
โโโ _config.yml
โโโ images
โย ย โโโ logo
โย ย โย ย โโโ logo.png
โย ย โโโ screenshots
โย ย โโโ 1.png
โย ย โโโ 2.png
โโโ LICENSE
โโโ README.md
โโโ requirements.txt
โโโ templates
โโโ a.css
โโโ weather.html
4 directories, 11 files
No | File Name | Details |
---|---|---|
1 | apikey.txt | contains API key obtained from Open Weather Map |
2 | app.py | contains logic for simple weather application |
3 | _config.yml | contains information regarding github pages used for hosting the contents of README |
4 | images/ | contains app screenshots and logo. |
7 | LICENSE | this project uses MIT License. |
8 | requirements.txt | contains all the dependencies used in the app. |
9 | templates/ | contains static html and css file for the frontend. |
- Code Style
In order to maintain the code style consistency across entire project I use a code formatter. I kindly suggest you to do the same whenever you push commits to this project.
The python code formatter I chose is called Black. It is a great tool and it can be installed quickly by running
sudo -H pip3 install black
or
python3.6 -m pip install black
It requires Python 3.6.0+ to run.
- Usage
black {source_file_or_directory}
For more details and available options, please check their psf/black.
I also use isort, it is a Python utility / library to sort imports alphabetically, and automatically separated into sections. It provides a command line utility which can be installed using.
sudo -H pip3 install isort
- Usage
isort {source_file}.py
For more details and available options, please check their timothycrosley/isort.
- Close Issues
Close issues using keywords: how to ?