YVR SFO

YVR SFO

Google Pixel 8 Pro 18mm f2.8 1/653s ISO20

WS1774

Add your comment...

Related Posts

(Recent Photos)

(Published to the Fediverse as: YVR SFO #photo #plane #sfo #yvr YVR SFO )

SFO YYC

SFO YYC

Google Pixel 8 Pro 7mm f1.7 1/80s ISO21

WS1509

Add your comment...

Related Posts

(Recent Photos)

(Published to the Fediverse as: SFO YYC #photo #plane #sfo #yyc SFO YYC )

San Francisco Budget - The Missing Manual

The city of San Francisco made from origami dollar bills.

I recently released my San Francisco Budget GPT. This is based on open data from DataSF, and while it can answer many questions it helps to have enough context to know what to ask. The published dataset has a data dictionary but it can be frustratingly vague. As well as the downloadable data there is a helpful site where you can generate some reports. This post should help fill in some of the gaps.

Overview

Budget data is available from the 2009-2010 to the 2024 to 2025 fiscal years (which run from July 1 to June 30). In the file the fiscal year is at the end of the period. Every dollar has a source and a use, there is a 'Revenue or Spending' column that is Revenue for sources and Spending for uses. The actual dollar values are in a 'Budget' column. There are three hierarchies that allow you to analyze the data - organization, object and fund. Each hierarchy has three levels, and each level has a code and a description. For the rest of this post I'm using data from the 2023-2024 fiscal year.

The total budget for 2023-2024 is $14.6 billion dollars. That's a little hard to put into context. On the one hand it's about two dimes for every week the universe has existed. On the other, it's only a quarter of Elon Musk's Tesla bonus.

Organization Hierarchy

This is the organizational structure of the city - Organization Group, Department and Program. One example is Public Safety, Police, Operating. Here's the full Organization Group and Department structure:

Organization Group and Department

(A quick note on charts - there is a lot of information to present here. Each chart has a full screen button at the top right and I recommend using this to see the most detail. Charts also have tooltips and so you'll have a much better time with this post if you use a big screen and a mouse. On sunburst (nested pie) charts click any segment to filter to that parent only.)

I haven't included Program here. It sounds like it should be useful, the data dictionary says: "For example, the Police Department has programs for Patrol, Investigations, and Administration." But it doesn't:

Police Department Programs

Maybe this worked at some point, but it's not a lot of help for the current year (It's a bit of a mystery, but not like that time I found out someone redistricted the Farallon Islands.)

It's also helpful to know that the department code has been prefixed to every department. So in the data the Police Department is 'POL Police'. This doesn't seem to happen elsewhere in the dataset. It probably helps to find monstrosities like 'MTA Municipal Transprtn Agncy' because we presumably can't find the spare change for longer column names.

Object Hierarchy

My favorite hierarchy is what we're spending money on at a reasonably granular level, broken down into Character, Object and Sub-object. This works both ways and you can look up sources as well as uses. An example on the revenue side is 'Fines, Forfeitures & Penalties', 'Traffic Fines', 'Traffic Fines - Parking' ($98 million).

Character, Object, Sub-object for Revenue

Character, Object, Sub-object for Spending

Sub-objects for the Police Department

While Program doesn't work, Sub-Object allows us to break down Police department spending in more detail:

Fund Hierarchy

Last but not least the fund hierarchy is where the money comes from. The three levels are Fund Type, Fund and Fund Category. As with objects you can also use this on the Spending side to see where funds are being spent.

Fund Type is critical to understanding the budget. There are three main buckets - General Fund, Enterprise Funds and Special Revenue Funds. Enterprise Funds are for self funding departments, so while $1.2 billion of the budget is for San Francisco International Airport that's not coming out of my pocket. The General Fund is discretionary spending and Special Revenue Funds are dollars that have been restricted to specific uses, for example by the endless ballot measures that San Francisco and California are so fond of.

Fund Type and Fund

This treemap shows the first two levels of the fund hierarchy:

Fund Type to Organization Group

Lastly this chart shows the flow of Fund Types to Organization Groups for Spending, excluding Enterprise Funds:

Add your comment...

Related Posts

(All Politics Posts)

(Published to the Fediverse as: San Francisco Budget - The Missing Manual #politics #sanfrancisco #budget Detailed guide to the three hierarchies of the San Francisco Budget from DataSF. )

San Francisco Budget Chatbot (GPT)

GPT for the San Francisco Budget

I just published a San Francisco Budget GPT to the ChatGPT store. This is free to use, you just need an OpenAI account.

The chatbot is constructed from the 2010-2025 data available on DataSF, the most recent 2025-2026 budget draft and a five year revenue projection. I added some instructions to help interpret the data and I've tested against a range of queries. This is generative AI and so be cautious about what it says. It's pretty good when it can find the right data and will happily invent things if it can't.

Not that this is limited to chatbots. There was a lot of press yesterday around San Francisco being the worst run city in the nation based on this 'analysis' from WalletHub. They are dividing a measure of service quality by budget dollars per capita. This fails to take into account that San Francisco is a city and a county and so the budget includes county services like a Sheriff department. It also ignores that San Francisco runs an international airport and port, not paid for by taxpayers but still in the budget. And it doesn't adjust for regional differences in income that make services more expensive to provide (and higher total dollar taxes to provide them). So I'll take an occasional chatbot glitch over a willfully incurious press pushing out a PR piece that tickles their confirmation biases.

Enjoy, and let me know if it works for you.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: San Francisco Budget Chatbot (GPT) #code #chatgpt #ml #sanfrancisco #gpts #sfpol #budget #openai Custom GPT with 2010-2025 data to answer questions about the city and county of San Francisco. )

Summer Solstice 2024

Summer Solstice 2024 rendered in Catfood Earth

Summer starts at 20:51 UTC on June 20, 2024, Winter if you happen to live south of the equator. Rendered in Catfood Earth.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Summer Solstice 2024 #code #solstice #summer #winter #earth #northern #estival Rendering of the exact moment of Summer Solstice 2024 (20:51 UTC on June 20, 2024). )

2,000 Sea Lions

More than 2,000 Sea Lions at Fisherman's Wharf

Google Pixel 8 Pro 2mm f2.0 1/1,900s ISO41

Closeup of Sea Lions at Fisherman's Wharf

Google Pixel 8 Pro 18mm f2.8 1/200s ISO16

I heard that we have over 2,000 Sea Lions at Fisherman's Wharf and had to check it out. There are thousands of them sleeping off their anchovy comas, a handful swimming around, and overflow onto many nearby docks. Worth checking out.

Add your comment...

Related Posts

(Recent Photos)

(Published to the Fediverse as: 2,000 Sea Lions #photo #sealion #sanfrancisco Photo of the thousands of Sea Lions currently hanging out at Pier 39 in San Francisco. )

Firefly Petunia

Firefly Petunia Glowing

SONY ILCE-7C 20mm f1.8 15.0s ISO800

Firefly Petunia Glowing in Kitchen

SONY ILCE-7C 20mm f1.8 1/1s ISO800

I bought the first commercially available bioluminescent plant on a whim. The Firefly Petunia from light.bio glows thanks to fungal DNA. The plant that arrived was badly damaged from shipping and for a few weeks just looked like it was going to die. But over the last week it rallied and bloomed. It's really quite impressive. Hopefully it doesn't grow up to be a triffid.

Add your comment...

Related Posts

(Recent Photos)

(Published to the Fediverse as: Firefly Petunia #photo #petunia #bioluminescence #fungi #luciferin Photos of a Firefly Petunia which has bioluminescence thanks to fungal DNA. )

Links for May 2024

Maine joins National Popular Vote

Illustration of Maine

Maine just added its four electoral college votes to the National Popular Vote project. This is a compact between states that will elect the President based on the nationwide outcome once 270 electoral college votes are committed. We're now at 209. Two thirds of Americans support this project. Americans are a sensible bunch and support a lot of things that they will never get until we fix the broken electoral system. Visit my democracy page and do the four things listed there right now.

Add your comment...

Related Posts

(All Politics Posts)

(Published to the Fediverse as: Maine joins National Popular Vote #politics #politicalreform #nationalpopularvote #maine #npvic Maine commits 4 electoral college votes, we're at 209/270, and four things you can do help today. )

Sandpipers

Sandpipers at Limantour Beach

SONY ILCE-7C 500mm f6.7 1/1,000s ISO200

Sandpipers flying past Limantour Beach in Point Reyes National Seashore.

Add your comment...

Related Posts

(Recent Photos)

(Published to the Fediverse as: Sandpipers #photo #sandpiper #limantour #pointreyes Photo of sandpipers at Limantour Beach, Point Reyes, California. )