Python at the US Federal Election Commission
She and her team have built a very modern tech stack running modern Flask web apps with APIs powered by SQLAlchemy and Flask-RESTFUL. The app is available open-source on GitHub. And they deploy it with continuous delivery out to cloud.gov.
There are lots of lessons to learn for governmental agencies around the world as well as private organizations, small and large.
Episode Deep Dive
Guest introduction and background
Laura Beaufort, Tech Lead at the U.S. Federal Election Commission (FEC), shares her experience modernizing government software development. She came to software from a background in political science and history, initially unsure if programming was right for her. Over time, Laura dove deep into Python, cloud-based infrastructures, agile development, and open source to help the FEC deliver modern, secure, and data-driven web services.
What to Know If You're New to Python
If you’re relatively new to Python or this type of tech conversation, here are some concepts that might help you follow along:
- Flask: A lightweight web framework that lets you build APIs and web applications with minimal overhead.
- SQLAlchemy: A Python ORM (Object Relational Mapper) for working with databases. Often used together with Flask.
- Cloud.gov: A platform-as-a-service (PaaS) for U.S. government agencies, simplifying hosting and security compliance.
- Open Source: Publishing code publicly so others can use, review, and potentially contribute.
Key points and takeaways
Modern, Open-Source Tech at the U.S. FEC
The FEC’s web apps use Python, Flask RESTful, and SQLAlchemy to handle massive amounts of election finance data. They have open-sourced their API (OpenFEC) on GitHub, allowing public contributions and transparency in government software.Fast and Flexible Deployment with Cloud.gov
Instead of building everything from scratch on AWS or Azure, the FEC team runs their applications on Cloud.gov. This gives them reliable scaling, built-in security, and quick deployments with a single command. The platform especially benefits small teams that lack dedicated DevOps staff.- Links and tools:
- Cloud.gov official site
- AWS RDS for the large Aurora Postgres database
- Links and tools:
Wagtail for Content Management
FEC.gov uses Django Wagtail to empower non-developers to maintain and update content. While Python developers might code the backend, content creators can work in a friendlier CMS interface.- Links and tools:
Partnering with 18F for Government Modernization
The FEC had help from 18F, a government agency that consults on digital services and agile methodologies. 18F guided them through best practices in code reviews, open source, CI/CD, and user-focused development.- Links and tools:
- 18F (18f.gsa.gov)
- CircleCI (circleci.com) for automated build and deploy
- Links and tools:
APIs and Large-Scale Data
Campaign finance data is huge—approaching hundreds of millions of records, with constant inserts and updates. By exposing a RESTful API and using a Postgres Aurora backend, the FEC handles heavy query loads while keeping response times fast.- Links and tools:
Agile Development and “Drinking Their Own Champagne”
The FEC focuses on delivering small, frequent updates. Their public web pages are powered by the same API they publish externally—meaning they continuously test their own endpoints in production and remain aligned with user needs.- Tools and references:
- Flask RESTful (flask-restful.readthedocs.io)
- Government agile best practices from 18F
- Tools and references:
Design and User Experience through the U.S. Web Design System
They use the U.S. Web Design System (USWDS) banner and components to unify federal sites, build trust, and ensure a consistent, modern UI across government websites.- Links and tools:
De-Risking and the Digital Services Playbook
Large-scale government IT projects can be risky. Laura mentions how the U.S. Digital Service Playbook and 18F’s De-Risking Guides help agencies adopt better contracting, QASP (Quality Assurance Surveillance Plan), and agile practices.- References:
Confidence Building for New Developers
Laura’s journey highlights how domain expertise (e.g., campaign finance) can pair with technology skills to create a fulfilling career. She encourages newer developers to start small, find supportive communities, and “just keep going” even if it initially feels overwhelming.- Tools and references:
- Local meetups and Python communities
- “Start with smaller tasks and expand your capabilities.”
- Tools and references:
Infrastructure Cost Savings and Scalability
Migrating from on-premise servers to Cloud Foundry/Cloud.gov drastically cut the FEC’s hosting costs (saving over $1 million a year) and made it possible to provision new instances in seconds rather than months.
- Tools and references:
Interesting quotes and stories
"I think building in the open from the beginning is the best way to successfully have an open source project." — Laura
"We drink our own champagne, meaning all the data on FEC.gov is coming from the very same API that we provide publicly." — Laura
Key definitions and terms
- FEC (Federal Election Commission): U.S. agency regulating campaign finance laws.
- 18F: A government digital consultancy that promotes agile development, open source, and user-centered design.
- Cloud.gov: A federal platform-as-a-service (PaaS) that simplifies deployment, security, and compliance for government agencies.
- Wagtail: A Django-based CMS that simplifies publishing and content management.
- USWDS: U.S. Web Design System, providing accessible and consistent design patterns for federal websites.
- De-Risking Guide: A set of best practices by 18F helping government teams manage technical projects and contracting effectively.
Learning resources
If you're looking to grow your Python expertise further or need a foundational starting point, here are a couple of relevant courses from Talk Python Training.
Python for Absolute Beginners
Ideal for those completely new to programming and Python, covering the core building blocks through real-world examples.Building Data-Driven Web Apps with Flask and SQLAlchemy
A step-by-step course on how to create solid database-driven web apps leveraging Flask and SQLAlchemy, similar to the FEC’s tech stack.
Overall takeaway
By embracing open source technology, a modern Python-based stack, and agile practices, even a traditionally slow-moving organization like the U.S. government can launch fast, scalable, and user-friendly solutions. Laura’s story proves that curiosity, persistence, and learning from supportive communities can have a far-reaching impact—both inside and outside public service.
Links from the show
Wagtail CMS: wagtail.io
FEC: fec.gov
18F: 18f.gsa.gov
Open source at the FEC: code.gov
Cloud.gov PaaS: cloud.gov
18F De-risking Guide: derisking-guide.18f.gov
US Digital Services episode: talkpython.fm
Digital Services Playbook: playbook.cio.gov
Digital.gov Communities of practice: digital.gov
FEC Github Repos: github.com
Laura's presentation to community of practice: youtube.com
YouTube Live Stream: youtube.com
Episode transcripts: talkpython.fm
--- Stay in touch with us ---
Subscribe to Talk Python on YouTube: youtube.com
Talk Python on Bluesky: @talkpython.fm at bsky.app
Talk Python on Mastodon: talkpython
Michael on Bluesky: @mkennedy.codes at bsky.app
Michael on Mastodon: mkennedy