Skip to content

Commit d9d6b96

Browse files
author
nzrymiak
committed
feat: add JailBase support
1 parent 4c41c9d commit d9d6b96

File tree

6 files changed

+368
-0
lines changed

6 files changed

+368
-0
lines changed

README.md

+201
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ You can contribute to this project in two ways. Please check the [contributing g
1818
## Index
1919
* [Art](#art)
2020
* [Business](#business)
21+
* [Crime](#crime)
2122
* [Finance](#finance)
2223
* [Geocoding](#geocoding)
2324
* [Lifestyle](#lifestyle)
@@ -463,6 +464,206 @@ df.drop('total', axis=1)
463464
</details>
464465

465466

467+
### Crime
468+
469+
#### [JailBase](./jailbase) -- Collect Prisoner Data
470+
<details>
471+
<summary>What is the URL for the mugshot of Almondo Smith?</summary>
472+
473+
```python
474+
# You can get ”jailbase_access_token“ by registering as a developer https://rapidapi.com/JailBase/api/jailbase
475+
dc = connect('jailbase', _auth={'access_token':jailbase_access_token})
476+
477+
df = await dc.query('search', source_id='wi-wcsd', last_name='smith', first_name='almondo')
478+
479+
df['mugshot'][0]
480+
```
481+
482+
483+
484+
485+
'https://imgstore.jailbase.com/small/arrested/wi-wcsd/2017-12-29/almondo-smith-679063bf90e389938d70b0b49caf7944.pic1.jpg'
486+
487+
</details>
488+
<details>
489+
<summary>Who were the 10 most recently arrested people by Wood County Sheriff's Department?</summary>
490+
491+
```python
492+
# You can get ”jailbase_access_token“ by registering as a developer https://rapidapi.com/JailBase/api/jailbase
493+
dc = connect('jailbase', _auth={'access_token':jailbase_access_token})
494+
sources = await dc.query('sources')
495+
department = sources[sources['name']=='Wood County Sheriff\'s Dept']
496+
497+
df = await dc.query('recent', source_id=department['source_id'].values[0])
498+
499+
df
500+
```
501+
502+
503+
504+
505+
<div>
506+
<table border="1" class="dataframe">
507+
<thead>
508+
<tr style="text-align: right;">
509+
<th></th>
510+
<th>id</th>
511+
<th>name</th>
512+
<th>mugshot</th>
513+
<th>charges</th>
514+
<th>more_info_url</th>
515+
</tr>
516+
</thead>
517+
<tbody>
518+
<tr>
519+
<th>0</th>
520+
<td>23917656</td>
521+
<td>Curtis Joseph</td>
522+
<td>https://imgstore.jailbase.com/small/arrested/w...</td>
523+
<td>[[]]</td>
524+
<td>http://www.jailbase.com/en/wi-wcsdcurtis-josep...</td>
525+
</tr>
526+
<tr>
527+
<th>1</th>
528+
<td>23917654</td>
529+
<td>Taner Summers</td>
530+
<td>https://imgstore.jailbase.com/small/arrested/w...</td>
531+
<td>[[]]</td>
532+
<td>http://www.jailbase.com/en/wi-wcsdtaner-summer...</td>
533+
</tr>
534+
<tr>
535+
<th>2</th>
536+
<td>23901411</td>
537+
<td>Maryann Randolph</td>
538+
<td>https://imgstore.jailbase.com/small/arrested/w...</td>
539+
<td>[[]]</td>
540+
<td>http://www.jailbase.com/en/wi-wcsdmaryann-rand...</td>
541+
</tr>
542+
<tr>
543+
<th>3</th>
544+
<td>23821284</td>
545+
<td>Antonia Cinodijay</td>
546+
<td>https://imgstore.jailbase.com/widgets/NoMug.gif</td>
547+
<td>[[]]</td>
548+
<td>http://www.jailbase.com/en/wi-wcsdantonia-cino...</td>
549+
</tr>
550+
<tr>
551+
<th>4</th>
552+
<td>23821280</td>
553+
<td>Deangelo Barker</td>
554+
<td>https://imgstore.jailbase.com/small/arrested/w...</td>
555+
<td>[[]]</td>
556+
<td>http://www.jailbase.com/en/wi-wcsddeangelo-bar...</td>
557+
</tr>
558+
<tr>
559+
<th>5</th>
560+
<td>23811811</td>
561+
<td>Tekeisha Faucibus</td>
562+
<td>https://imgstore.jailbase.com/small/arrested/w...</td>
563+
<td>[[]]</td>
564+
<td>http://www.jailbase.com/en/wi-wcsdtekeisha-fau...</td>
565+
</tr>
566+
<tr>
567+
<th>6</th>
568+
<td>23811810</td>
569+
<td>Tariq Nunoke</td>
570+
<td>https://imgstore.jailbase.com/small/arrested/w...</td>
571+
<td>[[]]</td>
572+
<td>http://www.jailbase.com/en/wi-wcsdtariq-nunoke...</td>
573+
</tr>
574+
<tr>
575+
<th>7</th>
576+
<td>23811808</td>
577+
<td>Sarah Jusakaja</td>
578+
<td>https://imgstore.jailbase.com/small/arrested/w...</td>
579+
<td>[[]]</td>
580+
<td>http://www.jailbase.com/en/wi-wcsdsarah-jusaka...</td>
581+
</tr>
582+
<tr>
583+
<th>8</th>
584+
<td>23791805</td>
585+
<td>Angela Burch</td>
586+
<td>https://imgstore.jailbase.com/small/arrested/w...</td>
587+
<td>[[]]</td>
588+
<td>http://www.jailbase.com/en/wi-wcsdangela-burch...</td>
589+
</tr>
590+
<tr>
591+
<th>9</th>
592+
<td>23775367</td>
593+
<td>Suzanne Nicholson</td>
594+
<td>https://imgstore.jailbase.com/small/arrested/w...</td>
595+
<td>[[]]</td>
596+
<td>http://www.jailbase.com/en/wi-wcsdsuzanne-nich...</td>
597+
</tr>
598+
</tbody>
599+
</table>
600+
</div>
601+
602+
</details>
603+
<details>
604+
<summary>How many police offices are in each US state in the JailBase system?</summary>
605+
606+
```python
607+
# You can get ”jailbase_access_token“ by registering as a developer https://rapidapi.com/JailBase/api/jailbase
608+
dc = connect('jailbase', _auth={'access_token':jailbase_access_token})
609+
610+
df = await dc.query('sources')
611+
612+
state_counts = df['state'].value_counts()
613+
state_counts
614+
```
615+
616+
617+
618+
619+
North Carolina 81
620+
Kentucky 75
621+
Missouri 73
622+
Arkansas 70
623+
Iowa 67
624+
Texas 57
625+
Virginia 47
626+
Florida 46
627+
Mississippi 44
628+
Indiana 38
629+
New York 37
630+
South Carolina 35
631+
Ohio 29
632+
Colorado 27
633+
Tennessee 26
634+
Alabama 26
635+
Idaho 23
636+
New Mexico 18
637+
California 18
638+
Michigan 17
639+
Georgia 17
640+
Illinois 14
641+
Washington 13
642+
Wisconsin 11
643+
Oregon 10
644+
Nevada 9
645+
Arizona 9
646+
Louisiana 8
647+
New Jersey 7
648+
Oklahoma 6
649+
Utah 5
650+
Minnesota 5
651+
Pennsylvania 4
652+
Maryland 4
653+
Kansas 3
654+
North Dakota 3
655+
South Dakota 2
656+
Wyoming 2
657+
Alaska 1
658+
West Virginia 1
659+
Nebraska 1
660+
Montana 1
661+
Connecticut 1
662+
Name: state, dtype: int64
663+
664+
665+
</details>
666+
466667

467668
### Finance
468669

api-connectors/jailbase/_meta.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"tables": [
3+
"recent",
4+
"search",
5+
"sources"
6+
]
7+
}

api-connectors/jailbase/recent.json

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"version": 1,
3+
"request": {
4+
"url": "https://jailbase-jailbase.p.rapidapi.com/recent/",
5+
"method": "GET",
6+
"authorization": {
7+
"type": "Header",
8+
"keyName": "x-rapidapi-key"
9+
},
10+
"params": {
11+
"source_id": true,
12+
"page": false
13+
}
14+
},
15+
"examples": {
16+
"source_id": "'al-mlso'"
17+
},
18+
"response": {
19+
"ctype": "application/json",
20+
"tablePath": "$.records[*]",
21+
"schema": {
22+
"id": {
23+
"target": "$.id",
24+
"type": "int"
25+
},
26+
"name": {
27+
"target": "$.name",
28+
"type": "string"
29+
},
30+
"mugshot": {
31+
"target": "$.mugshot",
32+
"type": "string"
33+
},
34+
"charges": {
35+
"target": "$.charges",
36+
"type": "object"
37+
},
38+
"more_info_url": {
39+
"target": "$.more_info_url",
40+
"type": "string"
41+
}
42+
43+
},
44+
"orient": "records"
45+
}
46+
}

api-connectors/jailbase/search.json

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"version": 1,
3+
"request": {
4+
"url": "https://jailbase-jailbase.p.rapidapi.com/search/",
5+
"method": "GET",
6+
"authorization": {
7+
"type": "Header",
8+
"keyName": "x-rapidapi-key"
9+
},
10+
"params": {
11+
"source_id": true,
12+
"last_name": true,
13+
"first_name": false,
14+
"page": false
15+
}
16+
},
17+
"examples": {
18+
"source_id": "'al-mlso'",
19+
"last_name": "'smith'"
20+
},
21+
"response": {
22+
"ctype": "application/json",
23+
"tablePath": "$.records[*]",
24+
"schema": {
25+
"id": {
26+
"target": "$.id",
27+
"type": "int"
28+
},
29+
"name": {
30+
"target": "$.name",
31+
"type": "string"
32+
},
33+
"county_state": {
34+
"target": "$.county_state",
35+
"type": "string"
36+
},
37+
"mugshot": {
38+
"target": "$.mugshot",
39+
"type": "string"
40+
},
41+
"charges": {
42+
"target": "$.charges",
43+
"type": "object"
44+
},
45+
"more_info_url": {
46+
"target": "$.more_info_url",
47+
"type": "string"
48+
}
49+
50+
},
51+
"orient": "records"
52+
}
53+
}

api-connectors/jailbase/sources.json

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"version": 1,
3+
"request": {
4+
"url": "https://jailbase-jailbase.p.rapidapi.com/sources/",
5+
"method": "GET",
6+
"authorization": {
7+
"type": "Header",
8+
"keyName": "x-rapidapi-key"
9+
},
10+
"params": {}
11+
},
12+
"response": {
13+
"ctype": "application/json",
14+
"tablePath": "$.records[*]",
15+
"schema": {
16+
"city": {
17+
"target": "$.city",
18+
"type": "string"
19+
},
20+
"name": {
21+
"target": "$.name",
22+
"type": "string"
23+
},
24+
"source_id": {
25+
"target": "$.source_id",
26+
"type": "string"
27+
},
28+
"state_full": {
29+
"target": "$.state_full",
30+
"type": "string"
31+
},
32+
"address": {
33+
"target": "$.address1",
34+
"type": "string"
35+
},
36+
"county": {
37+
"target": "$.county",
38+
"type": "string"
39+
},
40+
"phone": {
41+
"target": "$.phone",
42+
"type": "string"
43+
},
44+
"zip_code": {
45+
"target": "$.zip_code",
46+
"type": "string"
47+
},
48+
"email": {
49+
"target": "$.email",
50+
"type": "string"
51+
}
52+
53+
},
54+
"orient": "records"
55+
}
56+
}
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from dataprep.connector import Connector
2+
3+
4+
def test_sanity():
5+
Connector("./jailbase")

0 commit comments

Comments
 (0)