Boston Checkbook Explorer city expenditures, FY2012 to present: sample notebook

A worked notebook for Boston Checkbook Explorer city expenditures, FY2012 to present, 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
Size
16 files
Format
CSV (in sampled files)
Stored at
data.boston.gov
Access
Free and public. No account with the data provider is needed.

The notebook

Boston Checkbook Explorer city expenditures, FY2012 to present

One row is one distribution line of one voucher: the finest grain at which the city publishes a payment.

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

# checkbook_explorer_fy25_updated.csv — 235,796 rows
RESOURCE = "84dfc1af-28bd-4f17-804a-9cc0c09a237e"

url = "https://data.boston.gov/api/3/action/datastore_search?" + urllib.parse.urlencode(
    {"resource_id": RESOURCE, "limit": 100}
)
with urllib.request.urlopen(url, timeout=120) as r:
    df = pd.DataFrame(json.load(r)["result"]["records"])

print(df.shape)
df.head()

Next

Run it

Open this notebook to run it, see the dataset page for the full description, or browse the full catalog.