package ISO3166

  1. Overview
  2. Docs
OCaml library for working with ISO3166

Install

Dune Dependency

Authors

Maintainers

Sources

ISO3166-0.1.0.tbz
sha256=3f796838653b5d8df1772ca8c5e22aa2c02c832a83721738551ac6bc08b7ba4e
sha512=2c5fd35bf70b21a9ff80035a96f9d2cf88147e6684a4abbdd92103925ab8f7ba7843eb76f7cc1323c3e427c05eb11111c406a3f340f494130842000317399646

Description

This OCaml library provides an interface to the ISO3166 standard (a.k.a country codes)

Published: 24 Nov 2022

README

OCaml ISO3166

This library provides a pure OCaml interface to working with the ISO 3166 standard (a.k.a country codes).

# ISO3166.alpha3_to_country `IRL |> ISO3166.Country.name;;
- : string = "Ireland"

The Country module already contains all of the countries for convenience named after the alpha2 country code.

# ISO3166.Country.fr |> ISO3166.Country.name;;
- : string = "France"
# ISO3166.Country.fr |> ISO3166.Country.numeric |> ISO3166.numeric_to_string;;
- : string = "250"

The original use-case for this library was to encode the conversion from alpha2 country codes to strings. Lots of public APIs that provide country-specific information use ISO3166 to distinguish between countries.

# ISO3166.alpha2_to_string `ES;;
- : string = "ES"

Data Source

The data that generates the OCaml file comes from https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/commit/6741ae83a08ce1802d22849db0a944d99e254bae which has the following disclaimer which applies to this library too.

Dependencies (2)

  1. dune >= "2.9"
  2. ocaml >= "4.03"

Dev Dependencies (2)

  1. odoc with-doc
  2. mdx with-test

Used by

None

Conflicts

None