Survey123 Fuel Consumption Data Fetcher
This Python script retrieves fuel consumption data from an ArcGIS online survey using the Survey123 API and saves it to an Excel file for further analysis.
- Python 3.x
requests
openpyxl
pandas
-
Clone this repository:
git clone https://github.com/your-username/your-repository.git
-
Navigate to the project directory:
cd your-repository
-
Install dependencies:
pip install -r requirements.txt
-
Modify the script with your ArcGIS online username and password:
username = "Your_ArcGIS_Username" password = "Your_ArcGIS_Password"
-
Run the script:
python main.py
- Fetches data from the ArcGIS online survey using the Survey123 API.
- Saves the data to an Excel file.
- Formats the Excel file, renames columns, and drops unnecessary columns.
- Updates the column width of the Excel file for better readability.
- Removes rows from the Excel file based on a specified date threshold.
excel_sheet = "Survey123-FuelConsumption.xlsx"
grab_data(excel_sheet)
format_excel(excel_sheet)
update_width(excel_sheet)