This is the code for the OpenSAFELY cohort extractor tool which supports the authoring of OpenSAFELY-compliant research, by:

  1. Allowing developers to generate random data based on their study expectations. They can then use this as input data when developing analytic models.

  2. Supporting downloading of codelist CSVs from the OpenSAFELY codelists repository, for incorporation into the study definition

  3. Providing tools to understand and visualise the properties of real data, without having direct access to it

It is also the mechanism by which cohorts are extracted from live database backends within the OpenSAFELY framework.