Analyze Boston, the City of Boston open data portal (232 datasets): sample notebook
A worked notebook for Analyze Boston, the City of Boston open data portal (232 datasets), with 1 code cell and the output each one printed. On Scigantic it opens in a hosted JupyterLab with the dataset already mounted, so nothing is downloaded first.
- Provider
- City of Boston (Department of Innovation and Technology)
- License
- Open Data Commons Public Domain Dedication and License (PDDL) 1.0 for 216 of 232 datasets; 14 unspecified, 1 ODbL
- Size
- 403 files
- Stored at
- data.boston.gov
- Access
- Free and public. No account with the data provider is needed.
The notebook
Analyze Boston, the City of Boston open data portal (232 datasets)
The Analyze Boston portal itself, not one dataset.
Nothing is mounted. This archive is served over the data.boston.gov API, so there are no files to browse — the cell below fetches the data over the network.
import json, urllib.parse, urllib.request
import pandas as pd
url = "https://data.boston.gov/api/3/action/package_search?" + urllib.parse.urlencode({"rows": 100})
with urllib.request.urlopen(url, timeout=120) as r:
result = json.load(r)["result"]
df = pd.DataFrame([
{"name": p["name"], "title": p.get("title"), "resources": len(p.get("resources", []))}
for p in result["results"]
])
print(f"{result['count']:,} datasets on the portal")
df.head(20)
Next
- Every dataset above has its own archive in this portal — open one to get a starter notebook pointed at its data.
- Ask the AI panel on the right to find a dataset by topic.
- Source: https://data.boston.gov/
Run it
Open this notebook to run it, see the dataset page for the full description, or browse the full catalog.