Open data for the Philippine Congress: track representatives, senators, bills, and voting records. Transparent and community-maintained.
See our Contributing Guide for information on how to help improve the data.
This project aggregates publicly available information from official Philippine government sources:
- Senate of the Philippines: https://web.senate.gov.ph
- House of Representatives: https://congress.gov.ph
- Legislative Documents and Records: https://ldr.senate.gov.ph
- eCongress: https://econgress.gov.ph
All data files are organized in the data/ directory with subdirectories for
each entity type:
data/congress/- Philippine Congress entities (8th through 20th)data/group/chamber/- Chamber entities (Senate and House of Representatives)data/committee/- Senate committee entitiesdata/person/- Senator and representative entitiesdata/document/- Legislative documents (House Bills and Senate Bills)data/document/hb/- House Bills organized by congress numberdata/document/sb/- Senate Bills organized by congress number
The following graph shows the current entities and their relationships in the dataset:
graph TD
%% Node definitions with styling
Congress["🏛️ Congress<br/>━━━━━━━<br/>• id<br/>• congress_number<br/>• congress_website_key<br/>• name<br/>• ordinal<br/>• year_range<br/>• start_date<br/>• end_date"]
Chamber["🏢 Chamber (Group)<br/>━━━━━━━<br/>• id<br/>• name<br/>• type: 'chamber'<br/>• subtype: 'senate' | 'house'<br/>• congress"]
Committee["📋 Committee<br/>━━━━━━━<br/>• id<br/>• name<br/>• type<br/>• senate_website_keys[]"]
Person["👤 Person<br/>━━━━━━━<br/>• id<br/>• first_name<br/>• last_name<br/>• middle_name<br/>• senate_website_keys[]<br/>• aliases[]<br/>• memberships[]"]
Document["📄 Document<br/>━━━━━━━<br/>• id<br/>• type<br/>• subtype: 'hb' | 'sb'<br/>• bill_number<br/>• title<br/>• congress<br/>• date_filed<br/>• subjects[]"]
%% Relationships
Chamber -->|BELONGS_TO| Congress
Committee -->|BELONGS_TO| Congress
Person -->|MEMBER_OF| Chamber
Person -->|AUTHORED| Document
Document -->|FILED_IN| Congress
%% Styling
classDef congressNode fill:#4a90e2,stroke:#2c5aa0,stroke-width:2px,color:#fff
classDef chamberNode fill:#9c27b0,stroke:#6a1b9a,stroke-width:2px,color:#fff
classDef committeeNode fill:#7cb342,stroke:#558b2f,stroke-width:2px,color:#fff
classDef personNode fill:#ff7043,stroke:#d84315,stroke-width:2px,color:#fff
classDef documentNode fill:#ffd54f,stroke:#f9a825,stroke-width:2px,color:#333
class Congress congressNode
class Chamber chamberNode
class Committee committeeNode
class Person personNode
class Document documentNode
- Congress: Central entity representing each Philippine Congress (8th through 20th)
- Chamber (Group): Represents Senate or House of Representatives for a specific Congress
- Committee: Senate committees that operate within specific congresses
- Person: Senators and representatives who serve in various congresses
- Document: Legislative documents including House Bills (HB) and Senate Bills (SB)
The data follows a hierarchical structure:
- Congress is the top-level entity
- Chambers (Senate/House) belong to specific Congresses
- Committees belong to specific Congresses
- People are members of Chambers (not directly connected to Congress)
- Documents are filed in specific Congresses and authored by People
This structure accurately represents the bicameral nature of the Philippine Congress, where individuals serve as members of either the Senate or the House of Representatives for specific Congress sessions, and author legislative documents during their service.
Person entities contain a memberships array that defines their chamber affiliations:
[[memberships]]
type = "chamber"
congress = 15
subtype = "house" # Person was a House member in 15th Congress
[[memberships]]
type = "chamber"
congress = 16
subtype = "senate" # Person was a Senator in 16th CongressThis allows tracking of politicians who may have served in different chambers across different congresses (e.g., moving from House to Senate).
The repository includes a Neo4j sync script (scripts/sync_to_neo4j.py) that imports all data into a graph database for advanced querying and analysis.
- Neo4j database instance (local or remote)
- Python 3.7+
- Required Python packages:
neo4j,tomlkit,pyyaml,python-dotenv
- Create a
.envfile with your Neo4j credentials:
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your_password- Install dependencies:
pip install neo4j tomlkit pyyaml python-dotenv# Normal sync (updates existing data)
python scripts/sync_to_neo4j.py
# Clear database first with confirmation prompt
python scripts/sync_to_neo4j.py --clear
# Clear database without confirmation (for CI/CD)
python scripts/sync_to_neo4j.py --clear --yesThe sync script uses several optimizations for fast import:
- Large batch operations (1000 documents per batch)
- Progress tracking during file loading to monitor sync status
- Optimized relationship creation with grouped queries
- Automatic indexing for optimal query performance
These optimizations significantly reduce sync time for database operations.
For detailed database schema documentation, see DATABASE.md.
We want your help. No, really.
There may be a little voice inside your head that is telling you that you're not ready to be an open source contributor; that your skills aren't nearly good enough to contribute. What could you possibly offer a project like this one?
We assure you - the little voice in your head is wrong. If you can write code at all, you can contribute code to open source. Contributing to open source projects is a fantastic way to advance one's coding skills. Writing perfect code isn't the measure of a good developer (that would disqualify all of us!); it's trying to create something, making mistakes, and learning from those mistakes. That's how we all improve, and we are happy to help others learn.
Being an open source contributor doesn't just mean writing code, either. You can help out by writing documentation, tests, or even giving feedback about the project (and yes - that includes giving feedback about the contribution process). Some of these contributions may be the most valuable to the project as a whole, because you're coming to the project with fresh eyes, so you can see the errors and assumptions that seasoned contributors have glossed over.
Remember:
- No contribution is too small
- Everyone started somewhere
- Questions are welcome
- Mistakes are learning opportunities
- Your perspective is valuable
(Impostor syndrome disclaimer adapted from Adrienne Friend)
This repository is dedicated to the public domain under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.
You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
- No Copyright
- No Rights Reserved
- No Attribution Required
For more information, see the CC0 1.0 Universal license.