url <- "https://raw.githubusercontent.com/nanxstats/ggsci/refs/heads/master/R/palettes.R"
source(url)

header <- c(
  "# Generated by scripts/update_palettes_data.sh: do not edit by hand",
  "# Please run sh scripts/update_palettes_data.sh to regenerate this file\n",
  "\"\"\"",
  "Color palettes data",
  "\"\"\"\n",
  "PALETTES = "
)
body <- jsonlite::toJSON(ggsci_db)
txt <- paste0(paste0(header, collapse = "\n"), body)

writeLines(txt, con = "src/ggsci/data.py")
