ReVisPort is a Python command line reporting tool that enables users to create simple reports. The reports provide the user with a descriptive summary of climate data for EU countries, presented by Our World in Data. Besides that, ReVisPort offers users the option to add the created reports to their personalised favourites list. Notes or findings can be added to simplify the task of finding interesting data insights. In addition, the user has the possibility of contacting the developers of ReVisPort. View the app online.
The goal of ReVisPort is to search for interesting insights in climate data. ReVisPort targets particularly interested users in climate data and data generally. Users do not have to have any prior knowledge about reporting; ReVisPort navigates users step by step. However, basic knowledge of descriptive statistics is required in order to interpret results.
- U1: As a User, I would like to create a report without any programming knowledge.
- U2: As a User, I would like to be able to change the choices I make.
- U3: As a User, I would like to display a created report with all standard aspects.
- U4: As a User, I would like to make notes about the data insights.
- U5: As a User, I would like to have the possibility of saving a report.
- U6: As a User, I would like to see all my saved reports and come back to each of them.
- U7: As a User, I would like to delete a saved report, which I do not need anymore.
- U8: As a User, I would like to return to the home menu without restarting the application.
- U9: As a User, I would like to write a reference or contact the application developer.
- App structure was designed using a flow chart created in Lucid. The app was designed using a menu system. All flow charts are displayed below:
- Data Structure
- The app data is structured data, i.e., a table with columns and rows.
- The data is stored in Google Sheet.
- Code Structure
- Python code is structured into modules, which are organised in the revisport package.
- Following modules were created:
colours.py
- Contains constants for ANSI colour definitions.contact.py
- Contains functions and a class definition related to the CONTACT submenu.favourites.py
- Contains functions related to FAVOURITES submenu.helpers.py
- Contains supportive functions.home.py
- Contains functions related to the HOME menu.quit.py
- Contains functions related to the QUIT submenu.reporting.py
- Contains functions and a class definition related to the REPORTING submenu.
Coloured text using ANSI code was considered to make the command-line application more user-friendly. In total, five colours were selected. Each colour was used only for one purpose; see the table below.
Color | ANSI Code | Purpose | Examples |
---|---|---|---|
White | [95m | displayed information or user inputs | |
Green | [92m | actions, successes | Saving report ... |
Purple | [95m | asking for user inputs | Enter your choice: |
Yellow | [33m | warnings | Invalid data |
Cyan | [96m | questions or menus | Select a time period from 2000 and 2020 |
In the original CI template, the red colour of the button was selected. This was changed to black to better fit with the background image.
The app uses a menu system to ask the user for input data in order to create a report. The user's choices are always validated for correctness. In the case of incorrect input or input format, a warning message is displayed. The warning mostly tells the user the reason for an invalid input and asks them to try again.
Overview of existing features
Detailed description of existing features:
-
-
User is informed about the content and actions in the REPORTING submenu. There is still the possibility of going back to the HOME menu..
-
- In the following, a user is asked to enter the inputs to generate the first report table and then additional report aspects.
- Report table inputs
- Report table inputs confirmation
- Report tables
- Two tables are displayed. First, the raw data are shown. In the case of missing data, a user is informed with a warning message. Second, a summary table containing basic descriptive statistics.
- Finally, the user should decide if the tables should be saved. The option to return to the HOME menu is also available.
- Implementation:
-
- Once the user confirms to finish the report, the tables are saved, and the following information needs to be filled in:
- Report title (required and unique)
- Report author (not required)
- Report notes & findings (not required)
- Implementation:
- The user is asked to confirm the given information and save the report to FAVOURITES.
- Note: The report information is saved in a Google Sheet. The report tables are saved as a CSV file in the report folder.
- Once the user confirms to finish the report, the tables are saved, and the following information needs to be filled in:
-
-
-
The Favourites submenu displays first all saved reports, and then the menu is shown.
-
The overview of the saved reports displays the title, author, and notes of the report. Only 17 characters from each are displayed.
-
The user can select from the following, including the option of returning to the HOME menu.
-
- View a report
-
- Delete a report
-
- Create a report - the user is navigated to the REPORTING submenu.
-
- HOME menu - the user is navigated back to HOME.
-
-
-
After selecting the option "View a report", the user is first asked to select the report ID.
-
Displayed report
- Once the report ID is entered, the corresponding report is displayed.
- The report contains the following aspects: title, author, notes, summary data table, and raw data table.
- Implementation:
- Any key can be pressed to close the report and come back to FAVOURITES, see implementation
-
-
- After selecting the option "Delete a report", the user is asked to select the report ID.
- Implementation:
- A user is informed about deleting the report and directed back to FAVOURITES with the list of available reports; see implementation
- Note: Report is removed from Google Sheet. The report tables are removed from the report folder.
-
-
-
User is informed about the possible procedures in the CONTACT Menu. The user can either send a message or go back HOME.
-
- Once the user agrees to send the message, a contact form must be filled out.
- The following information is required:
- First name (not required)
- Last name (not required)
- Email (a required input)
- Message (a required input)
- The user has the option to change the entered information.
- Implementation:
- The user is informed about sending a message and asked to press any key to return HOME; see implementation
-
- Login Menu with guest and registered user rights.
- Guest users do not have any login information. The users have limited rights, like not saving or deleting a report.
- Registered users have the same login information. The login is available only to a limited number of users. The users have all the rights
- Download the report as PDF using the fpdf library (see more). Add a button and javascript event to enable downloading the report.
- A line plot to visualise the data trends (using pandas or seaborn libraries).
The website was continuously tested after implementing a feature. The main part of testing includes manual, functional testing as well as webpage validation using existing tools (e.g. PEP8); see the detailed testing report.
The following issues were detected during the manual testing.
ID | Description | BUG/ISSUE | FIX |
---|---|---|---|
T06 | Invalid input for Home Menu | Aborts when pressing enter. | An IndexValue added in handling the exception. |
T18 | Confirmation with a valid input to generate a summary table | Error when missing data | Exclude missing data and add a warning message about missing data |
T25 | Report title with an invalid input | Incorrect validation for a title with blank spaces | Modify the condition from unequal all to not equal all. |
T36 | Select ID and view report | A report with all sections is displayed. A message to press any key to continue is displayed. In the case of too long findings, a text is not broken appropriately. | Unfixed, it will be fixed in next iterations. |
T38 | Select ID with invalid data | Warning message displays incorrect available ID's | Adjust the displayed IDs which are available. |
The app was testing by a mentor. The mentor tested the logic flow of the app. The app aborted when trying to view several reports with FileNotFoundError. To fix this, try-except block was added in the code. The directory where the reports are saved was cleaned up and the corresponding worksheet as well. After that, it was not possible to reconstruct the same error again. The assumption is that during debugging of deleting or creating a report, the logic flow was not completed till the end.
The app was developed using GitPod and pushed to a GitHub repository. The development was continuously documented through commit messages containing the type of commit; see more. The app was deployed on Heroku.
In order to clone the repository locally, follow the steps:
- On Git
- Go to the repository, i.e. https://github.com/brodsa/re-vis-port.
- You see the content of the repository, i.e. all the files are listed. On the right side at the top of the list, find the Code drop down button and click on it.
- Copy the repository HTTPS link to the clipboard.
- In the terminal (Note: git must be preinstalled)
- Open the terminal and navigate, where you want to clone the repository.
- Type
git clone
and insert the content from the clipboard, leading to the commandgit clone https://github.com/brodsa/re-vis-port.git
. - Once the project is cloned, you can start using the repository locally.
In order to deploy the app on Heroku, an account is required. The steps for the deyploment are as follows:
- Click "New" and "Create new App" from the menu at right top, see screenshot.
- Insert an app name and select a region. Click "Create App"; see screenshot.
- Select the "GitHub" deployment method; see screenshot
- Search for a repository to connect and a branch to deploy; see screenshot
- In the "Setting" tab, go to the section "Buildpacks" and add two buildpacks in the following order (see screenshot):
heroku/python
heroku/nodejs
- In the "Config Var" section, add two variables (see screenshot):
PORT
: 8000CREDS
: credentials to connect with a Google worksheet
- In the "Domain" section, copy the URL to view the app; see screenshot.
- Python
- Markdown
- CSS & HTML
- Lucid to create a flow chart.
- Generator of Markdown tables to generate markdown tables.
- PEP8 validator to validate Python code.
- Image compressor was used to compress the images.
- Image converter was used to convert all images to the webp format.
- Spell checker to correct typos.
- Data Sources
- Documentation of all listed python libraries; see Section Languages
- Empty directory
- Color definition
- ANSI color coding
- Background image by Mika Baumeister on Unsplash
- Repository Template from Code Institute
- Stack Overflow
I would like to thank my mentors, Gareth McGirr and Darío Carrasquel, for their guidance through my project and their valuable input. And my special thanks go to my husband for being supportive during the development of the app.