This web application, built with Python and Flask, provides a comprehensive solution for managing and visualizing data from various sources including Google Sheets and a MySQL database. It allows users to perform operations such as viewing, editing, deleting, and saving data, both locally and online.
- Data Entry: Submit data via forms and save it to Excel, Google Sheets, or a MySQL database.
- View Data: View data stored in MySQL, with options to edit or delete individual records.
- Download Sheets: Download Google Sheets as Excel files.
- Manage Sheets: List and delete Google Sheets documents.
- Error Handling: Inform users about errors or successful operations with appropriate messages.
https://github.com/netto14cr/Data_management_application_01.git
Create a .env file in the project root and add your Instagram credentials:
MYSQL_USER=your_mysql_user
MYSQL_PASSWORD=your_mysql_password
MYSQL_HOST=your_mysql_host
MYSQL_DATABASE=your_mysql_database
python -m venv env
source env/bin/activate # For Linux/Mac
.\env\Scripts\activate # For Windows
pip install -r requirements.txt
In the db folder, there is a file named db.sql. Use this file to create the necessary database schema:
mysql -u your_mysql_user -p your_mysql_database < db/db.sql
python app.py
- Navigate to / to access the main page of the application.
- List Sheets: Access /manage_sheets to view and manage Google Sheets.
- View Sheet Data: Navigate to /view_sheet_data/<file_id> to view data from a specific Google Sheet.
- Download Sheet: Download Google Sheets as Excel files via /download_sheet/<file_id>.
- Delete Sheet: Remove a Google Sheet with the /delete_sheet/<file_id> endpoint.
- Excel Data Entry: Submit data to Excel through /data_entry.
- Google Sheets Data Entry: Submit data to Google Sheets with /data_entry_sheets.
- MySQL Data Entry: Submit data to a MySQL database at /data_entry_mysql.
- View Data: View all records stored in MySQL via /cloud_data.
- View Specific Data: Access detailed views of records through /view_cloud_data/int:record_id.
- Edit Data: Modify existing records at /edit_cloud_data/int:record_id.
- Update Data: Save changes to records via /update_cloud_data/int:record_id.
- Delete Data: Remove records from MySQL using /delete_cloud_data/int:record_id.
- Python
- Flask
- Google Sheets API
- Google Drive API
- MySQL
- Bootstrap
- HTML/CSS
- Go to the Google Cloud Console.
- Click on the Select a Project dropdown at the top and then click on New Project.
- Enter a project name and click Create.
- Navigate to APIs & Services > Library.
- Search for Google Sheets API and click on it.
- Click Enable to enable the API for your project.
- Similar to the Google Sheets API, go to APIs & Services > Library.
- Search for Google Drive API and enable it.
- Go to APIs & Services > Credentials.
- Click Create Credentials and select Service Account.
- Fill in the service account details (name, description) and click Create.
- Assign the Editor role to the service account (or a more specific role if necessary) and click Continue.
- Click Done to finish creating the service account.
- Click on the newly created service account and go to the Keys tab.
- Click Add Key > Create New Key.
- Select JSON and click Create. Save the downloaded JSON file to
google/key/credentials.json
in your project directory.
- Open Google Sheets and create or select a sheet you want the service account to access.
- Share the sheet with the service account email found in your JSON file. This email usually ends with
@<project-id>.iam.gserviceaccount.com
.
-
Add the following line to your
.env
file:GOOGLE_SERVICE_ACCOUNT_FILE=google/key/credentials.json
Shows the main page of the application with menu options and buttons for navigating the project.
Displays the form used for entering data into an Excel sheet.
Shows the completed form for Excel data entry alongside an .xlsx file displaying the stored data.
Displays the form for entering data into a MySQL database.
Shows the completed MySQL data entry form with correct data input.
Features a table listing existing Google Sheets documents, with options to view, manage, and download each document.
Shows a selected Google Sheets document in a tabular format with options to return, download, delete, or edit.
Displays the form for entering data into a Google Sheets document.
Shows the form for editing an existing Google Sheets entry, with fields for updating the document's data.
Illustrates the Google Sheets entry form and an open .xlsx file showing the downloaded data.
Features a table displaying documents created through the MySQL data entry form, with options to view, edit, or delete.
Shows the form for editing a cloud-stored record, with options to update fields and cancel or confirm changes.
Displays a record view with details from the database, demonstrating that the record is stored correctly.
Shows that the application supports installation as a Progressive Web App (PWA) on devices, including Windows, Android, or iOS, and displays the option or prompt to install the app on the device.
Displays a custom SweetAlert prompt to encourage users to install the PWA, with options to install now or later based on user interaction.
Displays the application installed on a Windows computer, demonstrating its appearance as a Progressive Web App (PWA).
Shows the application on mobile devices, highlighting its responsive design and adjustment to different screen sizes and orientations.
This project is licensed under the MIT License for educational use only. For professional or commercial use, please obtain proper licensing. See the LICENSE file for more details.