Coder Social home page Coder Social logo

daniel-parke / rac_data_download Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 571 KB

Python script for downloading historical data from RAC Foundation data portal.

Home Page: https://www.racfoundation.org/data

Python 100.00%
rac rac-foundation uk uk-data uk-cost-of-living uk-vehicles

rac_data_download's Introduction

RAC Data Downloader

General Use Guidelines

This script is designed to download historical data from the RAC Foundation website, allowing the user to add/remove required datasets by updating RAC_API_Sheet.csv sheet.

How to Run

Execute the rac_datadownload.py file via the command line to start the data collection process. This script generates individual CSV files for each API key provided and compiles an Excel (.xlsx) file with all information allocated to separate sheets.

Before running the program, ensure you meet the basic requirements to ensure its correct execution. If you are not using an IDE like Jupyter or VSCode, then remember to install Python 3.9 or higher first. Run the .py file in your terminal to start the process, assuming you meet the requirements listed below.

Requirements

  • RAC_API_Sheet.csv: This file must be located in the same directory as the .py file. It contains the current API keys, data descriptions, and source information.

  • Customization: You can adjust the description and source information within RAC_API_Sheet.csv to suit your needs, provided a valid API key is used. The default values are accurate as of publishing but may need updating if the RAC Foundation changes their web links.

  • Modifying Data Categories: To exclude a dataset from the download list, simply delete its row from RAC_API_Sheet.csv.

  • Excel Sheet Names: Correspond to the descriptions found in RAC_API_Sheet.csv.

  • CSV File Naming: The data source from RAC_API_Sheet.csv precedes the description in the filename, separated by an underscore (_), e.g., RAC_FuelPrice.csv.

Data Categories Available

  • FuelPumpPrice
  • WholesaleFuel
  • MotoringCost
  • TravelCost
  • EUDieselPrice
  • EUPetrolPrice
  • UKFuelConsumption
  • FuelDutyMonthly
  • FuelDutyAnnual
  • UKVehicleTax
  • UKPumpPriceTax
  • UKTotalEVs
  • UKTopTenEVs
  • OilMarketPrice
  • GreenFleetIndex
  • FillingUpCost

Installation Commands

pip install pandas
pip install openpyxl
pip install xlsxwriter
pip install httpx
pip install backoff

Libraries used within RAC data downloader:

import asyncio
import os
import sys
from timeit import default_timer as timer
import httpx
import pandas as pd
from backoff import on_exception, expo

WiseWattage

rac_data_download's People

Contributors

daniel-parke avatar

Watchers

 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.