Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kenya crime and economy #1083

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions statvar_imports/country/kenya/crimes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Table of Contents

1. [About the Dataset](#about-the-dataset)
2. [Type of place](#about-the-import)
3. [Statvar](#statvar)
4. [Verticals: Crimes]
5. [years]
6. [how to run]

## About the Dataset
The dataset describes about the types of crime in Kenya country.

### How to download data
Went through the website https://kenya.opendataforafrica.org/ selected the variables manually and downloaded.

### type of place: Country level

### statvars: Crimes

### years: 2016-2020

###place resolve: Manually

### how to run:

Open a terminal or command prompt.
To process your data, type the following command and replace the bracketed parts with your actual file paths:
python3 stat_var_processor.py --input_data='<input csv>' --pv_map="<pv_map*.csv>" --config="<metadata.csv>" --

python3 stat_var_processor.py --existing_statvar_mcf=stat_vars.mcf --input_data=statvar_imports/country/kenya/crimes/sample_input/<input_file>.csv --pv_map=statvar_imports/country/kenya/crimes/pv_map/_pvmap.csv --config=statvar_imports/country/kenya/crimes/pv_map/.csv --output_path=statvar_imports/country/kenya/crimes/test_data/sample_output/

The script generates CSV, TMCF, & MCF files.


14 changes: 14 additions & 0 deletions statvar_imports/country/kenya/crimes/kenya_crime_metadata.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
parameter,value
url,https://kenya.opendataforafrica.org/
description,Kenya crimes
#place_type,Country
#places_within,country/KEN
start_date,2016
end_date,2020
release_frequency,
process,
comments,
output_columns,"observationAbout,observationDate,value,variableMeasured,unit,scalingFactor,#input"
header_rows,1
drop_statvars_without_svobs,0
#existing_statvar_mcf,""""""
29 changes: 29 additions & 0 deletions statvar_imports/country/kenya/crimes/kenya_crimes_pvmap.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
key,prop,value,p1,v1,p2,v2,p3,v3,,
Crime,name,"""{Data}""",,,,,,,,
place,observationAbout,{Data},,,,,,,,
Total,populationType,CriminalActivities,measuredProperty,count,name,"""Total Criminal Activities""",,,,
Homicide,populationType,CriminalActivities,measuredProperty,count,crimeType,Homicide,name,"""Homicide Criminal Activity""",,
Offences against morality,measurementQualifier,Offense,measuredProperty,count,crimeType,CrimeAgainstMorality,populationType,CriminalActivities,name,"""Crime Against Morality"""
Other offences against persons,measurementQualifier,Offense,measuredProperty,count,crimeType,CrimeAgainstPerson,populationType,CriminalActivities,name,"""Crime Against Person"" "
Robbery,populationType,CriminalActivities,measuredProperty,count,crimeType,Robbery,name,"""Number of robberies""",,
Breakings,populationType,CriminalActivities,measuredProperty,count,crimeType,CrimeBreakings,name,"""Number of breaking crimes""",,
Theft of stock,populationType,CriminalActivities,measuredProperty,count,crimeType,TheftOfStock,name,"""Number of theft of stock""",,
Stealing,populationType,CriminalActivities,measuredProperty,count,crimeType,Stealing,name,"""Number of Criminal Activities involving stealing""",,
Theft by servant,populationType,CriminalActivities,measuredProperty,count,crimeType,TheftByServant,name,"""Number of thefts by servant""",,
Theft of Vehicles and other thefts,populationType,CriminalActivities,measuredProperty,count,crimeType,TheftOfMotorVehicle__OtherTheft,name,"""Number of Motor Vehicle or Other Theft""",,
Dangerous drugs,populationType,CriminalActivities,measuredProperty,count,crimeType,DangerousDrugs,name," ""Number of crimes related to dangerous drugs""",,
Traffic offences,populationType,CriminalActivities,measuredProperty,count,crimeType,TrafficOffences,name,"""Number of traffic offences""",,
Criminal damage,populationType,CriminalActivities,measuredProperty,count,crimeType,CriminalDamage,name,"""Number of criminal damage""",,
Economic crimes,populationType,CriminalActivities,measuredProperty,count,crimeType,EconomicCrime,name,"""Number of economic crimes""",,
Corruption,populationType,CriminalActivities,measuredProperty,count,crimeType,CorruptionCrime,name,"""Number of corruption crimes""",,
Offences involving police officers,measurementQualifier,Offense,measuredProperty,count,crimeType,CrimeInvolvingPoliceOfficers,populationType,CriminalActivities,name,"""Crime Involving Police Officers"""
Offences involving tourists,measurementQualifier,Offense,measuredProperty,count,crimeType,CrimeInvolvingTourists,populationType,CriminalActivities,name,"""Crime Involving Tourists"""
Other penal code offences,populationType,CriminalActivities,measuredProperty,count,crimeType,KEN_OtherPenalCodeOffence,populationType,CriminalActivities,name,"""Kenya Other Penal Code Offence"""
2013,value,{Number},observationDate,2013,,,,,,
2014,value,{Number},observationDate,2014,,,,,,
2015,value,{Number},observationDate,2015,,,,,,
2016,value,{Number},observationDate,2016,,,,,,
2017,value,{Number},observationDate,2017,,,,,,
2018,value,{Number},observationDate,2018,,,,,,
2019,value,{Number},observationDate,2019,,,,,,
2020,value,{Number},observationDate,2020,,,,,,
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
place,Crime,Units,2016,2017,2018,2019,2020
country/KEN,Total,,76986,77992,88268,93411,69645
country/KEN,Homicide,,2751,2774,2856,2971,3111
country/KEN,Offences against morality,,6228,5492,7233,8051,9153
country/KEN,Other offences against persons,,22295,22515,25049,27196,19288
country/KEN,Robbery,,2697,2713,2935,2858,2384
country/KEN,Breakings,,5621,6131,5970,5976,4252
country/KEN,Theft of stock,,1918,2136,2077,1962,1556
country/KEN,Stealing,,10361,11656,12845,13954,8709
country/KEN,Theft by servant,,2440,2632,2477,2226,1467
country/KEN,Theft of Vehicles and other thefts,,1355,1404,1370,1298,1031
country/KEN,Dangerous drugs,,6160,5565,8021,8011,4477
country/KEN,Traffic offences,,139,69,213,341,186
country/KEN,Criminal damage,,4307,4262,4783,4852,3530
country/KEN,Economic crimes,,3503,3695,4100,4786,3488
country/KEN,Corruption,,92,75,119,130,133
country/KEN,Offences involving police officers,,57,86,174,77,64
country/KEN,Offences involving tourists,,15,15,93,48,26
country/KEN,Other penal code offences,,7047,6772,7953,8674,6790
Loading
Loading