Created
December 11, 2017 10:14
-
-
Save OriHoch/af86ce44e479ab78b4dd2d1a58c17d89 to your computer and use it in GitHub Desktop.
datapackage example for working with knesset data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datapackage import Package | |
from tabulator import Stream | |
package = Package('https://minio.oknesset.org/committees/datapackage.json') | |
print(package.resource_names) | |
protocols_parsed = package.get_resource('committee_meeting_protocols_parsed') | |
for protocol_num, protocol in enumerate(protocols_parsed.iter(keyed=True)): | |
print(protocol) | |
with Stream("https://minio.oknesset.org/committees/" + protocol["parts_object_name"], headers=1) as stream: | |
for part_num, part in enumerate(stream.iter(keyed=True)): | |
print(part) | |
if part_num == 10: break | |
if protocol_num == 2: break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datapackage>=1.1.4 | |
tabulator>=1.12.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment