Skip to content

Commit 223e2a2

Browse files
authored
Merge pull request #18 from mwananchi-tech/feat/integrate-current-scraper-to-odnelazm-cli
feat: integrate current scraper to odnelazm cli
2 parents 08a8e7a + c6919e6 commit 223e2a2

File tree

12 files changed

+1833
-101
lines changed

12 files changed

+1833
-101
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# odnelazm
22

3-
Tools for scraping, parsing, and accessing hansard data from [mzalendo.com](https://info.mzalendo.com) to provide structured transcripts of National Assembly and Senate sittings from the Parliament of Kenya.
3+
Tools for scraping, parsing, and accessing hansard data from [mzalendo.com](https://mzalendo.com) to provide structured transcripts of National Assembly and Senate sittings from the Parliament of Kenya.
44

55
## Crates
66

crates/odnelazm-cli/README.md

Lines changed: 95 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,121 @@
11
# odnelazm-cli
22

3-
Run the `odnelazm` web scraper and parser from the command line
3+
Run the `odnelazm` web scraper and parser from the command line.
44

55
## Installation
66

7-
Install with `cargo`
8-
97
```bash
108
cargo install odnelazm-cli
119
```
1210

13-
## CLI Features
11+
## Global flags
12+
13+
| Flag | Description |
14+
| ----------------- | ------------------------------------------------------------------------------------- |
15+
| `-l, --log-level` | Set log verbosity: `off`, `error`, `warn`, `info`, `debug`, `trace` (default: `info`) |
1416

15-
### List sittings
17+
---
1618

17-
Browse available hansard sittings with optional filtering and pagination.
19+
## archive
1820

19-
| Flag | Description |
20-
| ----------------------------------- | -------------------------------------- |
21-
| `--start-date YYYY-MM-DD` | Filter sittings from this date onwards |
22-
| `--end-date YYYY-MM-DD` | Filter sittings up to this date |
23-
| `--house senate\|national_assembly` | Filter sittings by house |
24-
| `--limit N` | Maximum number of results to return |
25-
| `--offset N` | Number of results to skip |
26-
| `--output text\|json` | Output format (default: text) |
21+
Archival Hansard data from `info.mzalendo.com`.
22+
23+
### archive list
24+
25+
Browse available sittings with optional filtering and pagination.
26+
27+
| Flag | Description |
28+
| --------------------------------------- | -------------------------------------- |
29+
| `--start-date YYYY-MM-DD` | Filter sittings from this date onwards |
30+
| `--end-date YYYY-MM-DD` | Filter sittings up to this date |
31+
| `--house senate\|national_assembly\|na` | Filter by house |
32+
| `--limit N` | Maximum number of results to return |
33+
| `--offset N` | Number of results to skip |
34+
| `-o, --output text\|json` | Output format (default: text) |
2735

2836
```bash
29-
odnelazm list
30-
odnelazm list --start-date 2024-01-01 --end-date 2024-12-31 --house national_assembly --limit 10
31-
odnelazm list --output json | jq '.[] | select(.house == "senate")'
37+
odnelazm archive list
38+
odnelazm archive list --house senate --start-date 2020-01-01 --end-date 2020-12-31 --limit 10
39+
odnelazm archive list -o json | jq '.[] | select(.house == "senate")'
3240
```
3341

34-
### Sitting detail
42+
### archive sitting
3543

36-
Fetch the full transcript of a sitting, including sections, contributions, and procedural notes.
44+
Fetch the full transcript of a sitting including sections, contributions, and procedural notes.
3745

38-
| Flag | Description |
39-
| --------------------- | --------------------------------------------------------------- |
40-
| `--fetch-speakers` | Fetch full profile for each speaker (makes additional requests) |
41-
| `--output text\|json` | Output format (default: text) |
46+
| Flag | Description |
47+
| ------------------------- | --------------------------------------------------------------- |
48+
| `--fetch-speakers` | Fetch full profile for each speaker (makes additional requests) |
49+
| `-o, --output text\|json` | Output format (default: text) |
4250

4351
```bash
44-
odnelazm detail https://info.mzalendo.com/hansard/sitting/senate/2020-12-29-14-30-00
45-
odnelazm detail --fetch-speakers --output json
52+
odnelazm archive sitting https://info.mzalendo.com/hansard/sitting/senate/2020-12-29-14-30-00
53+
odnelazm archive sitting https://info.mzalendo.com/hansard/sitting/senate/2020-12-29-14-30-00 --fetch-speakers -o json
4654
```
4755

48-
### Global flags
56+
---
4957

50-
| Flag | Description |
51-
| ----------------- | ------------------------------------------------------------------------------------- |
52-
| `-l, --log-level` | Set log verbosity: `off`, `error`, `warn`, `info`, `debug`, `trace` (default: `info`) |
58+
## current
59+
60+
Up to date Hansard data from `mzalendo.com/democracy-tools`.
61+
62+
### current sittings
63+
64+
List available sittings, paged or all at once.
65+
66+
| Flag | Description |
67+
| --------------------------------------- | ----------------------------------------------- |
68+
| `--page N` | Page number to fetch (default: 1) |
69+
| `--all` | Fetch all pages at once (conflicts with --page) |
70+
| `--house senate\|national_assembly\|na` | Filter by house |
71+
| `-o, --output text\|json` | Output format (default: text) |
72+
73+
```bash
74+
odnelazm current sittings
75+
odnelazm current sittings --page 2 --house senate
76+
odnelazm current sittings --all -o json
77+
```
78+
79+
### current sitting
80+
81+
Fetch the full transcript of a sitting.
82+
83+
| Flag | Description |
84+
| ------------------------- | ----------------------------- |
85+
| `-o, --output text\|json` | Output format (default: text) |
86+
87+
```bash
88+
odnelazm current sitting thursday-12th-february-2026-afternoon-sitting-2438
89+
odnelazm current sitting https://mzalendo.com/democracy-tools/hansard/thursday-12th-february-2026-afternoon-sitting-2438/ -o json
90+
```
91+
92+
### current members
93+
94+
List members of parliament.
95+
96+
| Flag | Description |
97+
| ------------------------- | ----------------------------------------------- |
98+
| `--page N` | Page number (default: 1) |
99+
| `--all` | Fetch all pages at once (conflicts with --page) |
100+
| `-o, --output text\|json` | Output format (default: text) |
101+
102+
```bash
103+
odnelazm current members na 13th-parliament
104+
odnelazm current members senate 13th-parliament --page 2 -o json
105+
odnelazm current members na 13th-parliament --all -o json
106+
```
107+
108+
### current profile
109+
110+
Fetch a member's full profile including speeches, bills, and voting record.
111+
112+
| Flag | Description |
113+
| ------------------------- | ----------------------------------------- |
114+
| `--all-activity` | Fetch all pages of parliamentary activity |
115+
| `--all-bills` | Fetch all pages of sponsored bills |
116+
| `-o, --output text\|json` | Output format (default: text) |
53117

54118
```bash
55-
odnelazm --log-level debug list
119+
odnelazm current profile https://mzalendo.com/mps-performance/national-assembly/13th-parliament/boss-gladys-jepkosgei/
120+
odnelazm current profile https://mzalendo.com/mps-performance/national-assembly/13th-parliament/boss-gladys-jepkosgei/ --all-activity --all-bills -o json
56121
```

0 commit comments

Comments
 (0)