Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
44 changes: 44 additions & 0 deletions statvar_imports/child_birth/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# child_birth

The data set contains USA birth data

Download:
Data download URL : https://data.cdc.gov/api/views/hmz2-vwda/rows.csv?accessType=DOWNLOAD

###Execution steps :

To Download, run:

python3 download_util_script.py --download_url=https://data.cdc.gov/api/views/hmz2-vwda/rows.csv?accessType=DOWNLOAD --output_folder=input_files/
Comment thread
SandeepTuniki marked this conversation as resolved.
Outdated

Note : The downloaded file will be saved as "input_files/rows.csv"

###How to run:

python3 stat_var_processor.py
--input_data=../../statvar_imports/child_birth/input_files/*.csv \
--pv_map=../../statvar_imports/child_birth/pv_map.csv \
--places_resolved_csv=../../statvar_imports/child_birth/place_mapping.csv \
Comment thread
shapateriya marked this conversation as resolved.
Outdated
--config_file=../../statvar_imports/child_birth/metadata.csv \
--existing_statvar_mcf=gs://unresolved_mcf/scripts/statvar/stat_vars.mcf \
--output_path=../../statvar_imports/child_birth/output_files/child_birth



###Example

To Process the files, Run:

Execute the script inside the folder "/data/tools/statvar_importer/"
Comment thread
shapateriya marked this conversation as resolved.
Outdated

```
python3 stat_var_processor.py
--input_data=../../statvar_imports/child_birth/input_files/*.csv
--pv_map=../../statvar_imports/child_birth/pvmap.csv
--places_resolved_csv=../../statvar_imports/child_birth/places_resolved.csv
--config_file=../../statvar_imports/child_birth/metadata.csv
--existing_statvar_mcf=gs://unresolved_mcf/scripts/statvar/stat_vars.mcf
--output_path=../../statvar_imports/child_birth/output_files/child_birth
```


26 changes: 26 additions & 0 deletions statvar_imports/child_birth/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"import_specifications": [
{
"import_name": "usa_child_birth",
"curator_emails": [
"support@datacommons.org"
],
"provenance_url": "https://www.cdc.gov/nchs/nvss/vsrr/provisional-tables.html",
"provenance_description": "The data set contains USA birth data",
"scripts": [
"../../util/download_util_script.py --download_url=https://data.cdc.gov/api/views/hmz2-vwda/rows.csv?accessType=DOWNLOAD --output_folder=input_files/",
"../../tools/statvar_importer/stat_var_processor.py --input_data=input_files/*.csv --pv_map=pvmap.csv --config_file=metadata.csv --places_resolved_csv=places_resolved.csv --existing_statvar_mcf=gs://unresolved_mcf/scripts/statvar/stat_vars.mcf --output_path=output_files/child_birth"
],
"source_files": [
"input_files/*.csv"
],
"import_inputs": [
{
"template_mcf": "output_files/child_birth.tmcf",
"cleaned_csv": "output_files/child_birth.csv"
}
],
"cron_schedule": "0 07 * * 2"
}
]
}
5 changes: 5 additions & 0 deletions statvar_imports/child_birth/metadata.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameter,value
#places_within,country/USA
output_columns,"observationAbout,observationDate,value,variableMeasured,observationPeriod"
header_rows,1
mapped_columns,5
54 changes: 54 additions & 0 deletions statvar_imports/child_birth/places_resolved.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
place_name,dcid
UNITED STATES,country/USA
ALABAMA,geoId/01
ALASKA,geoId/02
ARIZONA,geoId/04
ARKANSAS,geoId/05
CALIFORNIA,geoId/06
COLORADO,geoId/08
CONNECTICUT,geoId/09
DELAWARE,geoId/10
DISTRICT OF COLUMBIA,geoId/11
FLORIDA,geoId/12
GEORGIA,geoId/13
HAWAII,geoId/15
IDAHO,geoId/16
ILLINOIS,geoId/17
INDIANA,geoId/18
IOWA,geoId/19
KANSAS,geoId/20
KENTUCKY,geoId/21
LOUISIANA,geoId/22
MAINE,geoId/23
MARYLAND,geoId/24
MASSACHUSETTS,geoId/25
MICHIGAN,geoId/26
MINNESOTA,geoId/27
MISSISSIPPI,geoId/28
MISSOURI,geoId/29
MONTANA,geoId/30
NEBRASKA,geoId/31
NEVADA,geoId/32
NEW HAMPSHIRE,geoId/33
NEW JERSEY,geoId/34
NEW MEXICO,geoId/35
NEW YORK,geoId/36
NORTH CAROLINA,geoId/37
NORTH DAKOTA,geoId/38
OHIO,geoId/39
OKLAHOMA,geoId/40
OREGON,geoId/41
PENNSYLVANIA,geoId/42
RHODE ISLAND,geoId/44
SOUTH CAROLINA,geoId/45
SOUTH DAKOTA,geoId/46
TENNESSEE,geoId/47
TEXAS,geoId/48
UTAH,geoId/49
VERMONT,geoId/50
VIRGINIA,geoId/51
WASHINGTON,geoId/53
WEST VIRGINIA,geoId/54
WISCONSIN,geoId/55
WYOMING,geoId/56
PUERTO RICO,geoId/72
10 changes: 10 additions & 0 deletions statvar_imports/child_birth/pvmap.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
key,p1,v1,p2,v2,,,,
Comment thread
shapateriya marked this conversation as resolved.
Outdated
Number of Live Births,medicalStatus,LiveBirth,populationType,BirthEvent,measuredProperty,count,statType,measuredValue
Number of Deaths,populationType,MortalityEvent,statType,measuredValue,measuredProperty,count,,
Number of Infant Deaths,populationType,MortalityEvent,age,YearsUpto1,statType,measuredValue,measuredProperty,count
Month,Month,{Data},,,,,,
Year,Year,{Data},,,,,,
Data Value,value,{Number},observationDate,{Month} {Year},,,,
Comment thread
SandeepTuniki marked this conversation as resolved.
Monthly,observationPeriod,P1M,,,,,,
12 Month-ending,observationPeriod,P1Y,,,,,,
State,observationAbout,{Data},,,,,,
Loading
Loading