Open Source

Available to Everyone

The Urban Displacement Project’s GitHub repository is a place to share our code to the public so you can replicate our work in your own area. If you’ve never used Git or Github before, you can still download the code and data to your computer. Below we outline what is Github, how to download the data, and steps to recreate maps for your area.

What Is Git and Github and Why Use It?

Git is a version control system built for maintaining a history of your code (e.g. Python, R, javascript, etc.) but can be used for a multitude of other platforms too (e.g. HTML, Word etc.). Github is an open source, industry standard, website to store and share your code and its history to the public or privately within your own team. In addition to storing code, Github can host simple websites and allows users to keep track of the state of a project. For example, our latest maps were created using Leaflet in Python and R and are hosted online through GitHub.

How Can I Download the Data or Code?

You can download our data and code even if you’ve never used GitHub before. To do that, you can simply navigate to our organization list of repositories, select the repository you’re interested in (e.g. displacement-typologies) and download the entire repository or select specific code scripts or data files. 

    • To download the entire repository, 
      • click on the green “Code” button towards the top right and 
      • select “Download Zip” at the bottom of the list. 
    • If you want to download one or more of our scripts, 
      • click on the “code” directory on the landing page of the repository of your choice
      • click on the script you want to download 
      • click “Raw” (next to the “Blame” button) in the upper right hand corner. That will take you to a page with just the script. 
      • select the entire script/text (On a PC, press control-A to select the entire script, or on a Mac, press Command-A) 
      • copy the selected script (e.g. Control-C on a PC or Command-C on a Mac)
      • open up a text editor 
      • paste the script in a new text editor file
      • save the file as the name listed in the repository including the extension (e.g. 5_map_creation.r or 4_typology.py)
    • For data (e.g. .csv or shapefiles) from the project
  • click on the data directory on the landing page of the repository of your choice
  • click on the public data directory 
  • click on the the file of your choice 
  • click on the “Download” or “Raw” button, whichever shows up, on the upper right hand corner 
      • Files that are smaller than 1mb will say “Raw” and will show you a preview of that file. In this case, you’ll have the “Raw” option to click
      • Files larger than 1mb will have a “Download” option.

If you are familiar with GitHub, you can fork the repo (recommended) and work on it from your own profile.

How Do I Recreate the Displacement Typologies for My City?

You should start with the 1_download_data.py file and work your way through the 5_map_creation.r file in that order. Most of the code is annotated and should provide an explanation of the steps. But, if you run into a problem, post an issue on our Displacement Typologies repo. We’ll try to answer your questions through that.