{ "cells": [ { "cell_type": "code", "execution_count": 31, "id": "6c4898b7", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import json\n", "from pathlib import Path\n", "from datasets import load_dataset" ] }, { "cell_type": "code", "execution_count": 2, "id": "e8f4075f", "metadata": {}, "outputs": [], "source": [ "# !ls records/session/118/bill/hr1.*\n", "base = Path(\"records/session/118/bill\")" ] }, { "cell_type": "code", "execution_count": 3, "id": "423587ee", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "16971" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bills = sorted(list(base.glob('*')))\n", "len(bills)" ] }, { "cell_type": "code", "execution_count": 4, "id": "980385c7", "metadata": {}, "outputs": [], "source": [ "p = bills[0]" ] }, { "cell_type": "code", "execution_count": 5, "id": "d3f4a030", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['hconres1', '2023-03-17T17-45-06Z']" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "p.parts[-1].split('.')" ] }, { "cell_type": "code", "execution_count": 6, "id": "0c7c740b", "metadata": {}, "outputs": [], "source": [ "bits = []\n", "for p in bills:\n", " bits.append([p, *p.parts[-1].split('.')])" ] }, { "cell_type": "code", "execution_count": 7, "id": "028480f8", "metadata": {}, "outputs": [], "source": [ "paths = pd.DataFrame(bits, columns=['path', 'key', 'date']).sort_values(['key', 'date'])" ] }, { "cell_type": "code", "execution_count": 8, "id": "4f0f546b", "metadata": {}, "outputs": [], "source": [ "measures = paths.groupby('key').last()" ] }, { "cell_type": "code", "execution_count": 25, "id": "84f1767f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
actionsamendmentscommitteescosponsorsindexrelatedbillssubjectssummariestexttitles
0{'actions': [{'actionDate': '2023-01-23', 'sou...{'amendments': [], 'pagination': {'count': 0},...{'committees': [], 'request': {'billNumber': '...{'cosponsors': [], 'pagination': {'count': 0, ...{'bill': {'actions': {'count': 7, 'url': 'http...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 2}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
1{'actions': [{'actionCode': 'H11100', 'actionD...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'P000605', 'dis...{'bill': {'actions': {'count': 4, 'url': 'http...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
2{'actions': [{'actionDate': '2023-02-02', 'sou...{'amendments': [], 'pagination': {'count': 0},...{'committees': [], 'request': {'billNumber': '...{'cosponsors': [], 'pagination': {'count': 0, ...{'bill': {'actions': {'count': 10, 'url': 'htt...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 3}, 'request': {'bill...{'pagination': {'count': 3}, 'request': {'bill...{'pagination': {'count': 3}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
3{'actions': [{'actionCode': 'H11000', 'actionD...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'K000380', 'dis...{'bill': {'actions': {'count': 5, 'url': 'http...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 6}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
4{'actions': [{'actionCode': 'H11100', 'actionD...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'C001066', 'dis...{'bill': {'actions': {'count': 3, 'url': 'http...{'pagination': {'count': 1}, 'relatedBills': [...{'pagination': {'count': 2}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
.................................
6070{'actions': [{'actionDate': '2023-03-07', 'com...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'W000817', 'fir...{'bill': {'actions': {'count': 2, 'url': 'http...{'pagination': {'count': 1}, 'relatedBills': [...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 0}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
6071{'actions': [{'actionDate': '2023-03-08', 'com...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'C000141', 'fir...{'bill': {'actions': {'count': 2, 'url': 'http...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
6072{'actions': [{'actionDate': '2023-03-08', 'com...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'H000601', 'fir...{'bill': {'actions': {'count': 2, 'url': 'http...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 0}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
6073{'actions': [{'actionDate': '2023-03-08', 'com...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'B001267', 'fir...{'bill': {'actions': {'count': 2, 'url': 'http...{'pagination': {'count': 1}, 'relatedBills': [...{'pagination': {'count': 5}, 'request': {'bill...{'pagination': {'count': 0}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
6074{'actions': [{'actionDate': '2023-05-10', 'sou...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'C001035', 'fir...{'bill': {'actions': {'count': 7, 'url': 'http...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 11}, 'request': {'bil...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
\n", "

6075 rows × 10 columns

\n", "
" ], "text/plain": [ " actions \n", "0 {'actions': [{'actionDate': '2023-01-23', 'sou... \\\n", "1 {'actions': [{'actionCode': 'H11100', 'actionD... \n", "2 {'actions': [{'actionDate': '2023-02-02', 'sou... \n", "3 {'actions': [{'actionCode': 'H11000', 'actionD... \n", "4 {'actions': [{'actionCode': 'H11100', 'actionD... \n", "... ... \n", "6070 {'actions': [{'actionDate': '2023-03-07', 'com... \n", "6071 {'actions': [{'actionDate': '2023-03-08', 'com... \n", "6072 {'actions': [{'actionDate': '2023-03-08', 'com... \n", "6073 {'actions': [{'actionDate': '2023-03-08', 'com... \n", "6074 {'actions': [{'actionDate': '2023-05-10', 'sou... \n", "\n", " amendments \n", "0 {'amendments': [], 'pagination': {'count': 0},... \\\n", "1 {'amendments': [], 'pagination': {'count': 0},... \n", "2 {'amendments': [], 'pagination': {'count': 0},... \n", "3 {'amendments': [], 'pagination': {'count': 0},... \n", "4 {'amendments': [], 'pagination': {'count': 0},... \n", "... ... \n", "6070 {'amendments': [], 'pagination': {'count': 0},... \n", "6071 {'amendments': [], 'pagination': {'count': 0},... \n", "6072 {'amendments': [], 'pagination': {'count': 0},... \n", "6073 {'amendments': [], 'pagination': {'count': 0},... \n", "6074 {'amendments': [], 'pagination': {'count': 0},... \n", "\n", " committees \n", "0 {'committees': [], 'request': {'billNumber': '... \\\n", "1 {'committees': [{'activities': [{'date': '2023... \n", "2 {'committees': [], 'request': {'billNumber': '... \n", "3 {'committees': [{'activities': [{'date': '2023... \n", "4 {'committees': [{'activities': [{'date': '2023... \n", "... ... \n", "6070 {'committees': [{'activities': [{'date': '2023... \n", "6071 {'committees': [{'activities': [{'date': '2023... \n", "6072 {'committees': [{'activities': [{'date': '2023... \n", "6073 {'committees': [{'activities': [{'date': '2023... \n", "6074 {'committees': [{'activities': [{'date': '2023... \n", "\n", " cosponsors \n", "0 {'cosponsors': [], 'pagination': {'count': 0, ... \\\n", "1 {'cosponsors': [{'bioguideId': 'P000605', 'dis... \n", "2 {'cosponsors': [], 'pagination': {'count': 0, ... \n", "3 {'cosponsors': [{'bioguideId': 'K000380', 'dis... \n", "4 {'cosponsors': [{'bioguideId': 'C001066', 'dis... \n", "... ... \n", "6070 {'cosponsors': [{'bioguideId': 'W000817', 'fir... \n", "6071 {'cosponsors': [{'bioguideId': 'C000141', 'fir... \n", "6072 {'cosponsors': [{'bioguideId': 'H000601', 'fir... \n", "6073 {'cosponsors': [{'bioguideId': 'B001267', 'fir... \n", "6074 {'cosponsors': [{'bioguideId': 'C001035', 'fir... \n", "\n", " index \n", "0 {'bill': {'actions': {'count': 7, 'url': 'http... \\\n", "1 {'bill': {'actions': {'count': 4, 'url': 'http... \n", "2 {'bill': {'actions': {'count': 10, 'url': 'htt... \n", "3 {'bill': {'actions': {'count': 5, 'url': 'http... \n", "4 {'bill': {'actions': {'count': 3, 'url': 'http... \n", "... ... \n", "6070 {'bill': {'actions': {'count': 2, 'url': 'http... \n", "6071 {'bill': {'actions': {'count': 2, 'url': 'http... \n", "6072 {'bill': {'actions': {'count': 2, 'url': 'http... \n", "6073 {'bill': {'actions': {'count': 2, 'url': 'http... \n", "6074 {'bill': {'actions': {'count': 7, 'url': 'http... \n", "\n", " relatedbills \n", "0 {'pagination': {'count': 0}, 'relatedBills': [... \\\n", "1 {'pagination': {'count': 0}, 'relatedBills': [... \n", "2 {'pagination': {'count': 0}, 'relatedBills': [... \n", "3 {'pagination': {'count': 0}, 'relatedBills': [... \n", "4 {'pagination': {'count': 1}, 'relatedBills': [... \n", "... ... \n", "6070 {'pagination': {'count': 1}, 'relatedBills': [... \n", "6071 {'pagination': {'count': 0}, 'relatedBills': [... \n", "6072 {'pagination': {'count': 0}, 'relatedBills': [... \n", "6073 {'pagination': {'count': 1}, 'relatedBills': [... \n", "6074 {'pagination': {'count': 0}, 'relatedBills': [... \n", "\n", " subjects \n", "0 {'pagination': {'count': 2}, 'request': {'bill... \\\n", "1 {'pagination': {'count': 1}, 'request': {'bill... \n", "2 {'pagination': {'count': 3}, 'request': {'bill... \n", "3 {'pagination': {'count': 6}, 'request': {'bill... \n", "4 {'pagination': {'count': 2}, 'request': {'bill... \n", "... ... \n", "6070 {'pagination': {'count': 1}, 'request': {'bill... \n", "6071 {'pagination': {'count': 1}, 'request': {'bill... \n", "6072 {'pagination': {'count': 1}, 'request': {'bill... \n", "6073 {'pagination': {'count': 5}, 'request': {'bill... \n", "6074 {'pagination': {'count': 11}, 'request': {'bil... \n", "\n", " summaries \n", "0 {'pagination': {'count': 2}, 'request': {'bill... \\\n", "1 {'pagination': {'count': 1}, 'request': {'bill... \n", "2 {'pagination': {'count': 3}, 'request': {'bill... \n", "3 {'pagination': {'count': 1}, 'request': {'bill... \n", "4 {'pagination': {'count': 1}, 'request': {'bill... \n", "... ... \n", "6070 {'pagination': {'count': 0}, 'request': {'bill... \n", "6071 {'pagination': {'count': 1}, 'request': {'bill... \n", "6072 {'pagination': {'count': 0}, 'request': {'bill... \n", "6073 {'pagination': {'count': 0}, 'request': {'bill... \n", "6074 {'pagination': {'count': 1}, 'request': {'bill... \n", "\n", " text \n", "0 {'pagination': {'count': 1}, 'request': {'bill... \\\n", "1 {'pagination': {'count': 1}, 'request': {'bill... \n", "2 {'pagination': {'count': 3}, 'request': {'bill... \n", "3 {'pagination': {'count': 1}, 'request': {'bill... \n", "4 {'pagination': {'count': 1}, 'request': {'bill... \n", "... ... \n", "6070 {'pagination': {'count': 1}, 'request': {'bill... \n", "6071 {'pagination': {'count': 1}, 'request': {'bill... \n", "6072 {'pagination': {'count': 1}, 'request': {'bill... \n", "6073 {'pagination': {'count': 1}, 'request': {'bill... \n", "6074 {'pagination': {'count': 2}, 'request': {'bill... \n", "\n", " titles \n", "0 {'pagination': {'count': 2}, 'request': {'bill... \n", "1 {'pagination': {'count': 2}, 'request': {'bill... \n", "2 {'pagination': {'count': 2}, 'request': {'bill... \n", "3 {'pagination': {'count': 2}, 'request': {'bill... \n", "4 {'pagination': {'count': 2}, 'request': {'bill... \n", "... ... \n", "6070 {'pagination': {'count': 2}, 'request': {'bill... \n", "6071 {'pagination': {'count': 2}, 'request': {'bill... \n", "6072 {'pagination': {'count': 2}, 'request': {'bill... \n", "6073 {'pagination': {'count': 2}, 'request': {'bill... \n", "6074 {'pagination': {'count': 2}, 'request': {'bill... \n", "\n", "[6075 rows x 10 columns]" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "rows = []\n", "for path in measures['path']:\n", " path = Path(path)\n", " row = {}\n", " for file_name in path.glob('*.json'):\n", " column = file_name.name.split('.')[0]\n", " # print(column)\n", " with file_name.open('r') as fp:\n", " dd = json.load(fp)\n", " # print(file_name)\n", " row[column] = dd\n", " # print()\n", " rows.append(row)\n", " # break\n", "records = pd.DataFrame(rows)\n", "records" ] }, { "cell_type": "code", "execution_count": 26, "id": "1c164166", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "1\n", "HCONRES\n", "118\n", "1\n", "Rep. Cole, Tom [R-OK-4]\n", "Regarding consent to assemble outside the seat of government.\n" ] } ], "source": [ "print(records['index'][0]['bill']['number'])\n", "print(records['index'][0]['bill']['type'])\n", "print(records['index'][0]['bill']['congress'])\n", "print(records['index'][0]['bill']['sponsors'][0]['fullName'])\n", "print(records['index'][0]['bill']['title'])" ] }, { "cell_type": "code", "execution_count": 50, "id": "c1fb5bdb", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
keytitlesponsoractionsamendmentscommitteescosponsorsindexrelatedbillssubjectssummariestexttitles
0118HCONRES1Regarding consent to assemble outside the seat...Rep. Cole, Tom [R-OK-4]{'actions': [{'actionDate': '2023-01-23', 'sou...{'amendments': [], 'pagination': {'count': 0},...{'committees': [], 'request': {'billNumber': '...{'cosponsors': [], 'pagination': {'count': 0, ...{'bill': {'actions': {'count': 7, 'url': 'http...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 2}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
1118HCONRES10Expressing the sense of Congress that the Unit...Rep. Tiffany, Thomas P. [R-WI-7]{'actions': [{'actionCode': 'H11100', 'actionD...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'P000605', 'dis...{'bill': {'actions': {'count': 4, 'url': 'http...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
2118HCONRES11Providing for a joint session of Congress to r...Rep. Scalise, Steve [R-LA-1]{'actions': [{'actionDate': '2023-02-02', 'sou...{'amendments': [], 'pagination': {'count': 0},...{'committees': [], 'request': {'billNumber': '...{'cosponsors': [], 'pagination': {'count': 0, ...{'bill': {'actions': {'count': 10, 'url': 'htt...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 3}, 'request': {'bill...{'pagination': {'count': 3}, 'request': {'bill...{'pagination': {'count': 3}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
3118HCONRES12Expressing the sense of Congress that all dire...Rep. Cammack, Kat [R-FL-3]{'actions': [{'actionCode': 'H11000', 'actionD...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'K000380', 'dis...{'bill': {'actions': {'count': 5, 'url': 'http...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 6}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
4118HCONRES13Supporting the Local Radio Freedom Act.Rep. Womack, Steve [R-AR-3]{'actions': [{'actionCode': 'H11100', 'actionD...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'C001066', 'dis...{'bill': {'actions': {'count': 3, 'url': 'http...{'pagination': {'count': 1}, 'relatedBills': [...{'pagination': {'count': 2}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
..........................................
6070118SRES95A resolution honoring the life of Dr. Paul Far...Sen. Brown, Sherrod [D-OH]{'actions': [{'actionDate': '2023-03-07', 'com...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'W000817', 'fir...{'bill': {'actions': {'count': 2, 'url': 'http...{'pagination': {'count': 1}, 'relatedBills': [...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 0}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
6071118SRES96A resolution celebrating the extraordinary acc...Sen. Risch, James E. [R-ID]{'actions': [{'actionDate': '2023-03-08', 'com...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'C000141', 'fir...{'bill': {'actions': {'count': 2, 'url': 'http...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
6072118SRES97A resolution expressing concern about economic...Sen. Risch, James E. [R-ID]{'actions': [{'actionDate': '2023-03-08', 'com...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'H000601', 'fir...{'bill': {'actions': {'count': 2, 'url': 'http...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 0}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
6073118SRES98A resolution declaring March 8, 2023, as \"Nati...Sen. Hickenlooper, John W. [D-CO]{'actions': [{'actionDate': '2023-03-08', 'com...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'B001267', 'fir...{'bill': {'actions': {'count': 2, 'url': 'http...{'pagination': {'count': 1}, 'relatedBills': [...{'pagination': {'count': 5}, 'request': {'bill...{'pagination': {'count': 0}, 'request': {'bill...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
6074118SRES99A resolution supporting the goals of Internati...Sen. Shaheen, Jeanne [D-NH]{'actions': [{'actionDate': '2023-05-10', 'sou...{'amendments': [], 'pagination': {'count': 0},...{'committees': [{'activities': [{'date': '2023...{'cosponsors': [{'bioguideId': 'C001035', 'fir...{'bill': {'actions': {'count': 7, 'url': 'http...{'pagination': {'count': 0}, 'relatedBills': [...{'pagination': {'count': 11}, 'request': {'bil...{'pagination': {'count': 1}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...{'pagination': {'count': 2}, 'request': {'bill...
\n", "

6075 rows × 13 columns

\n", "
" ], "text/plain": [ " key title \n", "0 118HCONRES1 Regarding consent to assemble outside the seat... \\\n", "1 118HCONRES10 Expressing the sense of Congress that the Unit... \n", "2 118HCONRES11 Providing for a joint session of Congress to r... \n", "3 118HCONRES12 Expressing the sense of Congress that all dire... \n", "4 118HCONRES13 Supporting the Local Radio Freedom Act. \n", "... ... ... \n", "6070 118SRES95 A resolution honoring the life of Dr. Paul Far... \n", "6071 118SRES96 A resolution celebrating the extraordinary acc... \n", "6072 118SRES97 A resolution expressing concern about economic... \n", "6073 118SRES98 A resolution declaring March 8, 2023, as \"Nati... \n", "6074 118SRES99 A resolution supporting the goals of Internati... \n", "\n", " sponsor \n", "0 Rep. Cole, Tom [R-OK-4] \\\n", "1 Rep. Tiffany, Thomas P. [R-WI-7] \n", "2 Rep. Scalise, Steve [R-LA-1] \n", "3 Rep. Cammack, Kat [R-FL-3] \n", "4 Rep. Womack, Steve [R-AR-3] \n", "... ... \n", "6070 Sen. Brown, Sherrod [D-OH] \n", "6071 Sen. Risch, James E. [R-ID] \n", "6072 Sen. Risch, James E. [R-ID] \n", "6073 Sen. Hickenlooper, John W. [D-CO] \n", "6074 Sen. Shaheen, Jeanne [D-NH] \n", "\n", " actions \n", "0 {'actions': [{'actionDate': '2023-01-23', 'sou... \\\n", "1 {'actions': [{'actionCode': 'H11100', 'actionD... \n", "2 {'actions': [{'actionDate': '2023-02-02', 'sou... \n", "3 {'actions': [{'actionCode': 'H11000', 'actionD... \n", "4 {'actions': [{'actionCode': 'H11100', 'actionD... \n", "... ... \n", "6070 {'actions': [{'actionDate': '2023-03-07', 'com... \n", "6071 {'actions': [{'actionDate': '2023-03-08', 'com... \n", "6072 {'actions': [{'actionDate': '2023-03-08', 'com... \n", "6073 {'actions': [{'actionDate': '2023-03-08', 'com... \n", "6074 {'actions': [{'actionDate': '2023-05-10', 'sou... \n", "\n", " amendments \n", "0 {'amendments': [], 'pagination': {'count': 0},... \\\n", "1 {'amendments': [], 'pagination': {'count': 0},... \n", "2 {'amendments': [], 'pagination': {'count': 0},... \n", "3 {'amendments': [], 'pagination': {'count': 0},... \n", "4 {'amendments': [], 'pagination': {'count': 0},... \n", "... ... \n", "6070 {'amendments': [], 'pagination': {'count': 0},... \n", "6071 {'amendments': [], 'pagination': {'count': 0},... \n", "6072 {'amendments': [], 'pagination': {'count': 0},... \n", "6073 {'amendments': [], 'pagination': {'count': 0},... \n", "6074 {'amendments': [], 'pagination': {'count': 0},... \n", "\n", " committees \n", "0 {'committees': [], 'request': {'billNumber': '... \\\n", "1 {'committees': [{'activities': [{'date': '2023... \n", "2 {'committees': [], 'request': {'billNumber': '... \n", "3 {'committees': [{'activities': [{'date': '2023... \n", "4 {'committees': [{'activities': [{'date': '2023... \n", "... ... \n", "6070 {'committees': [{'activities': [{'date': '2023... \n", "6071 {'committees': [{'activities': [{'date': '2023... \n", "6072 {'committees': [{'activities': [{'date': '2023... \n", "6073 {'committees': [{'activities': [{'date': '2023... \n", "6074 {'committees': [{'activities': [{'date': '2023... \n", "\n", " cosponsors \n", "0 {'cosponsors': [], 'pagination': {'count': 0, ... \\\n", "1 {'cosponsors': [{'bioguideId': 'P000605', 'dis... \n", "2 {'cosponsors': [], 'pagination': {'count': 0, ... \n", "3 {'cosponsors': [{'bioguideId': 'K000380', 'dis... \n", "4 {'cosponsors': [{'bioguideId': 'C001066', 'dis... \n", "... ... \n", "6070 {'cosponsors': [{'bioguideId': 'W000817', 'fir... \n", "6071 {'cosponsors': [{'bioguideId': 'C000141', 'fir... \n", "6072 {'cosponsors': [{'bioguideId': 'H000601', 'fir... \n", "6073 {'cosponsors': [{'bioguideId': 'B001267', 'fir... \n", "6074 {'cosponsors': [{'bioguideId': 'C001035', 'fir... \n", "\n", " index \n", "0 {'bill': {'actions': {'count': 7, 'url': 'http... \\\n", "1 {'bill': {'actions': {'count': 4, 'url': 'http... \n", "2 {'bill': {'actions': {'count': 10, 'url': 'htt... \n", "3 {'bill': {'actions': {'count': 5, 'url': 'http... \n", "4 {'bill': {'actions': {'count': 3, 'url': 'http... \n", "... ... \n", "6070 {'bill': {'actions': {'count': 2, 'url': 'http... \n", "6071 {'bill': {'actions': {'count': 2, 'url': 'http... \n", "6072 {'bill': {'actions': {'count': 2, 'url': 'http... \n", "6073 {'bill': {'actions': {'count': 2, 'url': 'http... \n", "6074 {'bill': {'actions': {'count': 7, 'url': 'http... \n", "\n", " relatedbills \n", "0 {'pagination': {'count': 0}, 'relatedBills': [... \\\n", "1 {'pagination': {'count': 0}, 'relatedBills': [... \n", "2 {'pagination': {'count': 0}, 'relatedBills': [... \n", "3 {'pagination': {'count': 0}, 'relatedBills': [... \n", "4 {'pagination': {'count': 1}, 'relatedBills': [... \n", "... ... \n", "6070 {'pagination': {'count': 1}, 'relatedBills': [... \n", "6071 {'pagination': {'count': 0}, 'relatedBills': [... \n", "6072 {'pagination': {'count': 0}, 'relatedBills': [... \n", "6073 {'pagination': {'count': 1}, 'relatedBills': [... \n", "6074 {'pagination': {'count': 0}, 'relatedBills': [... \n", "\n", " subjects \n", "0 {'pagination': {'count': 2}, 'request': {'bill... \\\n", "1 {'pagination': {'count': 1}, 'request': {'bill... \n", "2 {'pagination': {'count': 3}, 'request': {'bill... \n", "3 {'pagination': {'count': 6}, 'request': {'bill... \n", "4 {'pagination': {'count': 2}, 'request': {'bill... \n", "... ... \n", "6070 {'pagination': {'count': 1}, 'request': {'bill... \n", "6071 {'pagination': {'count': 1}, 'request': {'bill... \n", "6072 {'pagination': {'count': 1}, 'request': {'bill... \n", "6073 {'pagination': {'count': 5}, 'request': {'bill... \n", "6074 {'pagination': {'count': 11}, 'request': {'bil... \n", "\n", " summaries \n", "0 {'pagination': {'count': 2}, 'request': {'bill... \\\n", "1 {'pagination': {'count': 1}, 'request': {'bill... \n", "2 {'pagination': {'count': 3}, 'request': {'bill... \n", "3 {'pagination': {'count': 1}, 'request': {'bill... \n", "4 {'pagination': {'count': 1}, 'request': {'bill... \n", "... ... \n", "6070 {'pagination': {'count': 0}, 'request': {'bill... \n", "6071 {'pagination': {'count': 1}, 'request': {'bill... \n", "6072 {'pagination': {'count': 0}, 'request': {'bill... \n", "6073 {'pagination': {'count': 0}, 'request': {'bill... \n", "6074 {'pagination': {'count': 1}, 'request': {'bill... \n", "\n", " text \n", "0 {'pagination': {'count': 1}, 'request': {'bill... \\\n", "1 {'pagination': {'count': 1}, 'request': {'bill... \n", "2 {'pagination': {'count': 3}, 'request': {'bill... \n", "3 {'pagination': {'count': 1}, 'request': {'bill... \n", "4 {'pagination': {'count': 1}, 'request': {'bill... \n", "... ... \n", "6070 {'pagination': {'count': 1}, 'request': {'bill... \n", "6071 {'pagination': {'count': 1}, 'request': {'bill... \n", "6072 {'pagination': {'count': 1}, 'request': {'bill... \n", "6073 {'pagination': {'count': 1}, 'request': {'bill... \n", "6074 {'pagination': {'count': 2}, 'request': {'bill... \n", "\n", " titles \n", "0 {'pagination': {'count': 2}, 'request': {'bill... \n", "1 {'pagination': {'count': 2}, 'request': {'bill... \n", "2 {'pagination': {'count': 2}, 'request': {'bill... \n", "3 {'pagination': {'count': 2}, 'request': {'bill... \n", "4 {'pagination': {'count': 2}, 'request': {'bill... \n", "... ... \n", "6070 {'pagination': {'count': 2}, 'request': {'bill... \n", "6071 {'pagination': {'count': 2}, 'request': {'bill... \n", "6072 {'pagination': {'count': 2}, 'request': {'bill... \n", "6073 {'pagination': {'count': 2}, 'request': {'bill... \n", "6074 {'pagination': {'count': 2}, 'request': {'bill... \n", "\n", "[6075 rows x 13 columns]" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "records['key'] = records.apply(\n", " lambda x:'%s%s%s' % (x['index']['bill']['congress'], x['index']['bill']['type'], x['index']['bill']['number']),\n", " axis=1\n", ")\n", "records['sponsor'] = records.apply(\n", " lambda x: x['index']['bill']['sponsors'][0]['fullName'],\n", " axis=1\n", ")\n", "records['title'] = records.apply(\n", " lambda x: x['index']['bill']['title'],\n", " axis=1\n", ")\n", "\n", "cols = [\n", " 'key',\n", " 'title',\n", " 'sponsor',\n", " 'actions',\n", " 'amendments',\n", " 'committees',\n", " 'cosponsors',\n", " 'index',\n", " 'relatedbills',\n", " 'subjects',\n", " 'summaries',\n", " 'text',\n", " 'titles',\n", "]\n", "\n", "records = records[cols]\n", "records" ] }, { "cell_type": "code", "execution_count": 51, "id": "aafc8b27", "metadata": {}, "outputs": [], "source": [ "records.to_parquet('records.parquet')" ] }, { "cell_type": "code", "execution_count": 52, "id": "d67e5da3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Downloading and preparing dataset parquet/default to /home/calliope/.cache/huggingface/datasets/parquet/default-de71cc2901977da2/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec...\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4722f3b509d944fcb01c7c9788269e7b", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading data files: 0%| | 0/1 [00:00