opensafely-actions / safetab

Safetab outputs two-way tables of descriptive statistics
Other
0 stars 0 forks source link

Cl tool #2

Closed CarolineMorton closed 3 years ago

CarolineMorton commented 3 years ago

This PR aims to make this a simple command line tool that can be called within job runner and locally.

It looks in the yaml for 2 keys

The test_json_1.json is a json version of the yaml below:

inputs: ["tests/test_data/test_data.csv"]
config:
  simple_2_way_tabs:
    tab_type: 2-way
    variables: [sex, ageband, copd]
  death_2_way_tab:
    tab_type: target-2-way
    variables: [sex, ageband, copd]
    target: death
  grouped_by_sex:
    tab_type: groupby-2-way
    variables: [ageband, copd, death]
    groupby: sex

Safetab can be called from the command line with `python entrypoint.py "tests/test_json_configs/test_json_1.json" for that example.