A Jupyter Notebook-based exploration of emissions permits, compliance, and enforcement designed for localization by zip code
See a static sample report here. This demo won't let you look at different locations, it's just a quick sample!
Here's the demo where you can modify the location & see new results. Follow the instructions for Google Colab below:
my_zip
in the code to the zip code you're interested inYou need:
data
folder (should be a .csv and a .xlsx)Run jupyter notebook
in the project repo to start the notebook.
In this section, we will install the programming language Python, and use its package manager "pip" to install Jupyter Notebook.
pip
pre-installed. Type pip
into the command line and press enter just to check.
If it gives you an error message, you may need to debug. Here are some options:
sudo easy_install pip
in the command line; try againpip
to install Jupyter Notebook: run pip install notebook
Hopefully, you should now be able to run jupyter notebook
in the command line. If it's working, it will open your browser and show you all the files in your current directory.
You will need to install git
, which is a version control system that's designed for multiple people to be able to work with the same repo: Git download page. You can test whether it worked by running the command git
in the command line.
Choose where on your computer you want this project to go (Documents
, for example). In your command line, use cd
to navigate to the folder where you want to save the project.
Now "clone" the repo (copy all of the files from the online repository to your computer) by running:
git clone https://github.com/edgi-govdata-archiving/ECHO-by-Zip-Code.git
Once the process completes, navigate into the cloned repo folder:
cd echo-by-zip-code
If you run jupyter notebook
from here, it should open your browser and there should be a file called echo-by-zip.ipynb
. Click to open!
The data we are using is not a part of the repo. (It could be, but isn't in order to keep the repo small.) You will need to download it separately.
Download the ZIP file from ECHO Exporter on the ECHO Data Downloads page.
Unzip the file and move its contents into the data
folder of your local copy of this repo. It should look like:
echo-by-zip-code/data/ECHO_EXPORTER.csv
(You can put the xlsx file there too, but the code doesn't depend on it. It's a useful file to keep around.)
When you open the Jupyter notebook, there will be a little code block near the top with the comment # Import libraries
.
This code block names the different libraries (packages of many specialized functions for e.g. mapping things or manipulating data) that the notebook is using:
For each line with an import
in front of it, you will need to install a library using the command line.
Open a new window of your terminal, then for each library, install with:
pip install <library>
.
For example, since there is a line that says import pandas as pd
in the notebook, enter
pip install pandas
into the command line.
Now that the notebook is running and you have the data & libraries installed, you should be able to run it!
Back in the notebook, you can either click the button that says "Run" to run one cell at a time, or hit "Run All" in the "Cell" menu to run the whole notebook.
It might take a minute to process all that data! When it's done, you should see some maps and graphs about the ECHO permits in the specified zip code area.
Change the zip code in the code as my_zip
to your own zip code and run the notebook again to see a report for your area:
The 'master' branch is no longer the repo's primary branch in line with EDGI's policy decided here: https://github.com/edgi-govdata-archiving/overview/issues/241
If someone has a local clone, they can update their locals like this:
$ git checkout master $ git branch -m master main $ git fetch $ git branch --unset-upstream $ git branch -u origin/main $ git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
The above steps accomplish:
- Go to the master branch
- Rename master to main locally
- Get the latest commits from the server
- Remove the link to origin/master
- Add a link to origin/main
- Update the default branch to be origin/main
(From @jywarren at Public Lab: https://github.com/publiclab/plots2/issues/8077)
Copyright (C)
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the LICENSE
file for details.