stdpopsim is a community-maintained library of standard population genetic simulation models. It provides easy access to a growing catalog of published simulation models from a range of organisms and supports multiple simulation-engine backends.

  species = stdpopsim.get_species(
      "HomSap"
  )
  model = species.get_demographic_model(
      "OutOfAfrica_3G09"
  )
  contig = species.get_contig("chr22")
  samples = {
      "YRI": 5,
      "CHB": 5,
      "CEU": 0
  }
  engine = stdpopsim.get_engine(
      "msprime"
  )
  ts = engine.simulate(
      model, contig, samples
  )