Skip to content

NYCPlanning/edr-use-query-tool

Repository files navigation

Land Use Query

The NYC Department of City Planning has updated the Zoning Resolution to ...

User paths

There are two paths a user might take:

  1. They know what their business will be and want to know where it can be
  2. They know where their business will be and want to know what it can be

Knows what, doesn't know where

A user can select a NAICS category and determine which zoning districts allow that land use.

  1. Find an appropriate NAICS code description
  2. Using the 6-digit NAICS code, find the DCP use associated with that code
  3. If the 6-digit code is not in the DCP uses, repeat with the 5-digit code
  4. If the 5-digit code is not in the DCP uses, repeat with the 4-digit code
  5. ...
  6. Note the zoning districts in which this use is allowed and any special ...

Knows where, doesn't know what

A user can select a zoning district and determine which NAICS categories are allowed on that land.

  1. ...

Development

The app is a marimo notebook hosted on GitHub Pages.

A github action converts the notebook to WASM HTML and deploys the page. The action is triggered by changes to the main branch but can be configured to use other branches via the repo's Environment settings.

Setup

Important

uv is the preferred python environment and package manager (install docs) but everything here is possible with pip.

  1. Create a virtual environment with uv venv
  2. (Optional) Recompile python package requirements with uv pip compile --upgrade requirements.in -o requirements.txt
  3. Run uv pip sync requirements.txt to ensure virtual environment has desired packages and their versions
  4. Activate the virtual environment with source .venv/bin/activate

Notebooks

marimo docs

# Open a notebook
marimo edit process_data.py
# Open a notebook in app mode
marimo app query_app.py
# Export to WASM HTML
uvx --verbose marimo export html-wasm --mode run a_notebook.py --output _site_a_notebook
# Run exported notebook
python -m http.server --directory _site_a_notebook

Miscellaneous

Formatting files:

# Format all files in a folder
ruff format utils/
# Format a specific file
ruff format utils/query.py

Running tests:

# Run all tests
python -m pytest
# Run all tests in a file
python -m pytest test/test_utils.py
# Run a specific test
python -m pytest test/test_utils.py::test_query_naics_codes

Docs

marimo - WebAssembly Notebooks marimo - Publish to GitHub Pages

About

Tabularizing use allowances by zoning district

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •