hpd
is a command-line tool that attempts to create an graph structure of NYC Housing Preservation & Development (HPD) records, along with various subcommands to analyze the graph.
It uses CSV data directly from NYC's open data portal and does not require a database.
The graph is undirected and has the following properties:
-
Each individual name (and, optionally, corporation name) is a node.
-
Each address is a node.
-
A name node and address node are connected via an edge if at least one HPD registration contact contains both (i.e., if the name is associated with the address).
Portfolios are then inferred by finding strongly connected components within the graph.
This algorithm was created by Sam Rabiyah, Samara Trilling, and Atul Varma during the week of July 26, 2021.
You will need Rust.
From the repository root, do the following:
-
Download NYC HPD Registration Contacts to
Registration_Contacts.csv
. -
Download NYC HPD Registrations to
Multiple_Dwelling_Registrations.csv
. -
Run
cargo install --path .
. (Alternatively, you can run the program directly viacargo run --release --
if you don't want to install it.) -
Run
hpd help
.
Note that the required CSV files must be in the current directory when you run the program.
Portfolios can be visualized with hpd dot
, which outputs to the format that can be visualized by graphviz, but it can be difficult to display large portfolios using this method.
Here's an example of generating a portfolio as an SVG:
hpd dot "MOSES GUTMAN" | dot -Tsvg > portfolio.svg
An alternative is to use hpd website
to export the largest portfolios as a static website.
To do this, you will also need yarn and nodejs.
From the repository root, do the following:
-
Run
yarn
. -
Run
yarn build
. -
Run
hpd website
.
If you need to change the website's built JS bundle:
-
Run
yarn watch
. -
Visit http://localhost:1234.
When you make any edits, you can reload your web browser to see the results.