Why we open source

We believe that collaboration across the news industry is key to solving our common problems. We also believe that our code is our journalism and that obligates us to be transparent with our source whenever we can.

Open sourcing our work also has the practical advantage of inviting others to participate, which increases our capacity to do good work. It's also a critical feature of how we manage projects on our team. (Turns out imagining how strangers will use our code is a pretty good way to guess how we'll use it a few weeks down the line.)

For any of the projects listed below, we welcome collaboration and feedback. Try them out, open issues and submit pull requests.

Our work

archieml-pipe

archieml-pipe is a library to help easily export data structured in ArchieML in Google Docs to local JSON. You can then use that data as context to render HTML templates.

django-crosswalk

Django-crosswalk is an entity service that provides a few basic, but highly extensible tools to resolve entity IDs and create linked records of known aliases.

We use it to standardize IDs across datasets, to create a master crosswalk of all known aliases and as a reference library for entity metadata, augmenting libraries like us.

DjangoRecord linkage

django-foreignform

Dynamic fieldsets for your Django ModelAdmin using JSON schema and react-jsonschema-form.

Define dynamic fieldsets with react-jsonschema-form. Store the schema on a foreign-keyed model. Serialize the fieldsets' back to a native Django JSON field in the admin.

Django

django-kanban-budget

A dead simple kanban-style project management application with tiny GitHub and Slack integrations.

Django

django-slack-events-router

Lets you extend your use of free Slack by creating an events router to send Slack Events API messages to any number of endpoints via custom webhook routes. You can then configure filters for your custom routes based on event type or channel, giving you a powerful way to filter the Event API's firehose to just the messages your downstream apps need.

DjangoSlack

django-slack-forms

Create and process custom Slack Dialogs with data validation.

DjangoSlack

django-slackchat-serializer

A pluggable Django app to serialize chat messages in a Slack channel. Works as the bridge between Slack and your CMS or any custom renderer to publish your slackchats.

DjangoSlack

generator-politico-django-package

This is a Yeoman generator that creates a basic scaffold for a pluggable Django application.

The scaffold comes with:

  • a node-based static files build system
  • utilities for publishing to AWS S3
  • a settings conf for pluggable apps
  • pre-made structure for Django Rest Framework and Celery
  • a built-in, preconfigured example project
  • development environment management with pipenv

Gspan

Gspan is a command line utility that takes a Google Doc formatted to the specification in NPR's anno-docs and turns into JSON suitable for using in a front-end application.

lambda_layer-pandas

An AWS Lambda layer pre-loaded with numpy and pandas.

PythonLambda

markdown-react-loader

A Webpack loader that loads markdown files as React components with templating context.

ReactWebpack

markslack

A simple Slack message to Markdown converter. Handles text emphasis, hyperlinks, emoji, custom markup and more.

PythonSlack

parcel-plugin-react-markdown

A plugin for Parcel.js bundler that renders markdown files into React components using react-markdown.

ReactParcel.js

Politico Civic

Politico Civic is a Django project that houses all of our election-centric data projects. Within Civic are multiple pluggable Django apps that work especially well in concert, but a few are useful as standalone Django apps as well. Each of these pluggable apps contains models about election data and serializers that can pass them to JSON.

Entity

Entity houses models for people and organizations. For example, the Republican Party is an organization, and Mitt Romney is a person. Their roles as political parties and candidates will come in downstream apps, but Entity houses the base level information about them.

Geography

Geography houses models for all of the geographic political divisions in the United States. It contains bootstrap scripts that get shapefiles from the Census Bureau for states, counties and congressional districts and load them into your database. It also creates a simplified geography for each of those objects.

Demography

Demography collects and aggregates Census variables by the political divisions defined in Geography.

Government

Government contains information about political jurisdictions, bodies, and offices. For example, the United States Federal Government is a jurisdiction, the U.S. Senate is a body, and the Class 1 Senate seat from Texas is an office. It also contains the modeling for political parties.

Election

Election models information about races for particular offices. It also models candidate information, which inherits people from Entity and attaches them to races in Election.

Vote

Vote models various types of voting that happens in elections.

politico-style

POLITICO Style is our team's style guide and contains all of the component CSS for our base applications.

secondlunch

A successor to NPR's Lunchbox, reimplemented with reusable components.

template_lambda-etl

Develop and deploy custom ETL pipelines. Raw file uploads through Slack, serverless processing in AWS Lambda.

PythonSlackLambda