Skip to content

Data Transformation Scripts for the Code For Pittsburgh Food Access Map

Notifications You must be signed in to change notification settings

CodeForPittsburgh/food-access-data-transformation

Repository files navigation

Food Map Data Transformation Scripts

This repository contains the data transformation scripts used to create the backend data store for the Food Access Map. Below is information for configuring your environment to begin working with the project. Information for each script is found in the Data Scripts ReadMe

The map itself lives here: https://codeforpittsburgh.github.io/FoodAccessMap/

Requirements

The project leverages Python to do all of the transformations. You will need the following software on your device.

  • Python 3.11.x - Download
  • Your favorite IDE or Text Editor (VSCode, PyCharm, etc)

VSCode Dev Container

If you are using VSCode, there are also settings to utilize a Dev Container for development instead of installing software to your machine. this will require Docker to be installed prior to opening the project inside the container. Once launched the container will contain the following:

  • VSCode Extensions for Python Development
  • Python 3.11
  • Python Project Packages from merge-requirements.txt
  • Python Project Packages from dev-requirements.txt

Using a Virtual Environment

If you are not using the Dev Container, you can configure a virtual environment for the project using the following commands:

# Create the Environment
python -m venv venv
# Activate the Environment

#Mac/Linux
chmod +x ./venv/bin/activate
source ./venv/bin/activate

# Windows
./venv/Scripts/activate
# Install Dependencies
pip install -r requirements.txt
pip install -r dev-requirements.txt

Unit Tests

Unit Tests exist for the scripts found in the data_scripts directory. All are located in the tests directory. These tests leverage the following modules which are installed through the dev-requirements.txt file:

  • pytest
  • assertpy
  • responses
  • autopep8

Any new tests should be added to this folder and mimic the existing tests that exist. These should also leverage pytest and assertpy modules for format and style.

Running Unit Tests

All Unit Tests can be run from the command line at the root folder with the following command:

pytest

Adding New Sources

New sources are always welcome to be added to this dataset. Each source is currently processed through a source specific script located in the data_scripts directory. Additional data sources should follow this same methodology of creating a source specific script. Additional information on adding new sources as well as common analysis practices can be found in the Add Sources document.

About

Data Transformation Scripts for the Code For Pittsburgh Food Access Map

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages