The world’s leading publication for data science, AI, and ML professionals.

Landlord Spotting in City Property Data

No one should be evicted, period. Python & React can help stop it.

Noah Cote 2020
Noah Cote 2020

Introduction

Eviction is a process of forcibly removing a tenant from their dwelling, legally with a court order, although often done illegally by Do-It-Yourself landlords. Normally, evictions are a rolling process with Municipal Landlord-Tenant court churning through cases and ending with a Sheriff knocking on your door, but we are not in normal times. Most people have been lucky that their landlords follow the law, waiting until the courts reopen to file evictions that have been closed for months due to the on-going COVID-19 crisis. Those lucky enough to have a law-abiding landlord are not lucky; they now live with the knowledge that they will be confronted with homelessness in a non-descript period of time.

Many courts that handle landlord-tenant issues were unable to keep up with eviction cases in the first place, let alone during the current economic downturn. None of this is surprising. The courts are not set up to help tenants; they are bastions of protecting capital that helps landowners make windfall profits. Tenants are often ill-prepared, unsupported by government entities, and cannot afford adequate representation in a system that is built for profiteers. This injustice is left to be combated by local organizations, including tenant unions and sympathetic law groups/services, that lack the tools and Data needed to fight back. Obviously, tenant organizing is its own science, and most of these groups do it very well. Having more information and tools to sift through that data will enable tenant organizers to target neighborhoods and landlords with more accuracy and insight.

Motivation

As a tenant organizer with the Philadelphia Tenants Union and the Drexel Student Tenants Union, I have firsthand experience of its challenges. The first step is always figuring out what one is up against, which usually includes using city data tools like Philadelphia Atlas.

Philadelphia Atlas
Philadelphia Atlas

The Atlas tool is by no means useless; it provides a considerable amount of insight, but only for a single property. The information on that property tends to be out of date or missing the owner’s actual mailing address. This lack of data makes it difficult for the researcher/organizer to draw meaningful conclusions without going down a possibly empty rabbit hole of googling names with cities appended.

I can write a whole other article on how landowners hide behind the data the system generates. Still, for now, I will only explain one pertinent tactic. Landlords, especially problematic ones, will hide behind seemingly endless shell companies that give almost no insight into who owns them. These shell companies, LLCs, and partnerships present another problem by doing this as well, how do you know what "123 Street Road APT 3 LLC" owns? Although most of these very explicitly named companies own only the property they describe, there are times when the data exposes how much they own and where. The Philadelphia Atlas tool will not readily provide you with this information. The system only filters based on a property.

Philadelphia Atlas Property View
Philadelphia Atlas Property View

Only filtering by individual addresses is arguably an individualist approach to presenting property data. This approach paints a situation where only one tenant having problems in a single apartment, is solely on that tenant’s shoulders, in a city of millions. Creating a similar feeling to going into Landlord-Tenant Court without adequate knowledge, support, and/or representation, we can begin to hypothesize that this is part of the same system. There is an awareness that the courts are not set up for tenants. They are part of the gentrifying development machine spreading throughout our cities, and the city’s tools are not free of influence from it.

I set off to see if I can do something to change this. I wanted to use the same data set that the city uses in its Atlas tool, _opa_properties_public.csv_, and present it in a more democratized and collectivized manner. This is the data of the people that reside in Philadelphia, not just trails left behind by the landowners. As an eviction crisis that can rival that of the Great Depression looms, we need to quickly create tools that stop landowners from hiding in messy, inaccurate data, and expose all they own to give tenants and tenant advocates a fighting chance.

Noah Cote 2019
Noah Cote 2019

Data Source and Description

A few months ago, I was set to start the last cooperative module in my education at Drexel University. Still, when COVID-19 shut everything down, my co-op was canceled. Unable to find a replacement co-op and ineligible to take a full term of classes, I decided I needed to do something to make up for the development experience I would have gotten from my last co-op. Through my organizing with the Philadelphia Tenants Union, I knew that the city had a lot of data that can be leveraged for the tenants in our union and the tenants we advocate for.

Open Data Philly contains a catalog of datasets available in the Philadelphia region, 379 datasets, to be exact. I quickly navigated their catalog to find the city’s property assessment data the Atlas tool uses. This data set was created in 2015 and contains hundreds of thousands of properties, but how are these distributed between owners in Philadelphia? Out of the 581,456 properties in the set, there are only 429,983 unique owning entities.

Histogram 1
Histogram 1

The distribution of landlords owning how many properties is reasonably interesting. In Histogram 1, I plotted a histogram of this distribution. The histogram is logged on the y-axis to visualize the data better. Still, the x-axis can be seen as more interesting here. The gaps between the bars are spaced out on the right tail, showing how the wealth gap quickly grows.

Histogram 2
Histogram 2

At first, I was surprised how heavily tailed it was on the left, indicating that most owning entities in this dataset own only one property, but this makes sense. From the experience of looking into who owns property in the city individually, I can claim that this distribution is heavily tailed due to the amount of precariously specifically named companies, LLCs, and partnerships that exist solely to "own" these properties. It’s also fair to assume that most people don’t own large amounts of property, CNBC claims most own 1 to 10 properties, which this histogram is describing.

Starting with Python

To begin interpreting this dataset, I needed to start with sorting and searching through the data. I chose to use Python 3, a language I know can handle processing the 500,00+ entries in the dataset and got to work. The first few things I wanted to know was:

· How many unique owning entities are in this set?

· How many properties do they own?

· What does this distribution look like?

Breaking this up into smaller steps, I began working to create an object that only contained each owning entity once. If they appeared more than once, I needed to update the count for that owning entity. These steps translated to the following Python 3 code.

Realizing that there is a non-trivial amount of owning entities and wanting to use this data for a web app, I realized I needed to break apart the data. I went about this by writing a function that sets a lower limit for what I considered significant landlords.

I also wrote functions to compile JSON objects of just landlords and properties from the original CSV file.

At this point, I started thinking about how I would need to structure this data to be used by a React.JS frontend. I settled on creating an object that would organize the data by landlord and sub-structures for the property information. This code is heavily influenced by how I present data in the frontend. Still, this code should provide the general gist of how it’s structured.

If you want a more detailed look at my data processing or want to fork it, here is the GitHub Repository.

Creating a Node/Express API

After processing the data and creating JSON files that split the data set, I went to work. I began to build a node.js server that utilized Express to make API endpoints. (if you want more information on this, click here). Acknowledging that listing 400,000+ owning entities would crash or extremely slow down a browser, I made endpoints for different JSON files.

To curb rendering the full amount of owning entities, I made an endpoint that only serves significant landlords.

Then I wrote an endpoint that listens for a specific landlord, finds it in the larger dataset, and returns an object that contains data only on the landlord requested.

For the sake of length and presentation, I have truncated the amount of code it takes to run a node/express server. If you want to see the server code in its entirety, here is the GitHub repository.

Building a React.JS Frontend

Building a React.JS frontend came as a natural progression of this project. I have been learning and getting better at writing React apps in the past few years after being kickstarted by my first two Drexel co-ops. I recognize that this isn’t meant to be a programming tutorial, so I will be describing and explaining the screens that resulted from this project. If you are interested in what my code looks like, you can check it out here.

To visualize owning entities’ properties, I searched for a map library for React and settled on react-map-gl. This library allowed me to use MapBox maps, a highly customizable map interface created by Uber. Using markers from Font Awesome, I began to plot the property data on the map.

Plotting individual properties didn’t work out so well for the larger owning entities, especially the Philadelphia Housing Authority, who owns some 4,000+ properties. I figured I’d have to use a clustering algorithm to solve the slow marker rendering. Luckily, MapBox already took the time to develop this for react-map-gl. Someone else developed a library to use this with React Hooks. These two libraries, respectively, are supercluster and use-supercluster. After following a great tutorial on how to use all these together, I made the resulting screen seen below.

philly-landlord-spotter
philly-landlord-spotter

The clustering enabled me to pack more information into the markers on the map. Each marker provides information about the property, such as Street Address, Category, Co-Owner, Recording Date, Sale Date, Sale Price, and Year Built. Providing this information on the map lets users understand what is happening in a neighborhood and how to best approach tenant issues regarding a specific owning entity.

The Landlord Selector on the right-hand side of the screen is less impressive. In the current moment, I only display owning entities that own more than fifty properties. This is mostly due to how long it takes to render lengthy lists in a browser, and I am actively looking for a solution.

Project Evolution

I have only begun to scratch the surface of what a tenant or tenant advocate can find in different representations of Philadelphia property assessment data. I’ve been keeping a running list of what I and others have thought might be useful or interesting to see come out of further development.

  1. Color-coat markers that show when properties were built and a key to describe each time segment.
  2. More owning entity-specific statistics, such as average property age and average sale year.
  3. Cross-referencing PPP data. (Payroll Protection Program)
  4. Cross-referencing Philadelphia eviction filing data.
  5. Packaging this project into a manner into which other cities can begin visualizing their data in a way that works for them.
Noah Cote 2019
Noah Cote 2019

Conclusion

In the tech world, people start or create projects that seem useful at first but ultimately are not as useful or redundant. I hope that philly-landlord-spotter does not fall into either of those categories. Soon massive amounts of people, including families, will be legally evicted from their homes and, in most cases, have nowhere to go. The shelters are either full or ravaged by COVID-19, and this is unacceptable. Everyone deserves a safe place to call home, if they do not currently have one, they need to be provided one, and if they do have one, they need to remain there. More than ever, tenants need to band together to form or join tenants unions to build tenant power and provide community eviction defense.

If you are in Philadelphia, I highly recommend getting involved with the Philadelphia Tenants Union. The PTU fights and advocates for tenants in Philadelphia, including providing eviction defense. If you are in need, do not hesitate to reach out to them!

Outside of Philadelphia, there is a network of tenant unions aptly called Autonomous Tenants Union Network. They would be able to point you in the right direction and have a list of cities where they work with tenants unions.

For anyone more interested in this project’s programming aspect, have ideas that would fit into the scope of this project, or if you just want to chat about it, my email is [email protected].

Otherwise, check out my Github and follow me on Twitter: @n_cote3.


Related Articles