| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 |
|
| 22 | (define-module (gnu packages iso-codes)
|
| 23 | #:use-module ((guix licenses) #:prefix license:)
|
| 24 | #:use-module (guix gexp)
|
| 25 | #:use-module (guix packages)
|
| 26 | #:use-module (guix download)
|
| 27 | #:use-module (guix git-download)
|
| 28 | #:use-module (guix build-system gnu)
|
| 29 | #:use-module (guix build-system pyproject)
|
| 30 | #:use-module (gnu packages check)
|
| 31 | #:use-module (gnu packages gettext)
|
| 32 | #:use-module (gnu packages perl)
|
| 33 | #:use-module (gnu packages python)
|
| 34 | #:use-module (gnu packages python-build)
|
| 35 | #:use-module (gnu packages python-science))
|
| 36 |
|
| 37 | (define-public iso-codes/official
|
| 38 | |
| 39 | |
| 40 | (package
|
| 41 | (name "iso-codes")
|
| 42 | (version "4.5.0")
|
| 43 | (home-page "https://salsa.debian.org/iso-codes-team/iso-codes")
|
| 44 | (source (origin
|
| 45 | (method git-fetch)
|
| 46 | (uri (git-reference
|
| 47 | (url home-page)
|
| 48 | (commit (string-append "iso-codes-" version))))
|
| 49 | (file-name (git-file-name name version))
|
| 50 | (sha256
|
| 51 | (base32
|
| 52 | "1q6x9c5x4x0x4q11iygldsmxdyzhz1mb4n8im76glwsgqsqyjs80"))))
|
| 53 | (build-system gnu-build-system)
|
| 54 | (native-inputs
|
| 55 | (list gettext-minimal perl python-wrapper))
|
| 56 | (synopsis "Various ISO standards")
|
| 57 | (description
|
| 58 | "This package provides lists of various ISO standards (e.g. country,
|
| 59 | language, language scripts, and currency names) in one place, rather
|
| 60 | than repeated in many programs throughout the system.
|
| 61 |
|
| 62 | Currently there are lists of languages and countries embedded in
|
| 63 | several different programs, which leads to dozens of lists of
|
| 64 | 200 languages, translated into more than 30 languages... not
|
| 65 | very efficient.
|
| 66 |
|
| 67 | With this package, we create a single \"gettext domain\" for every
|
| 68 | supported ISO standard which contains the translations of
|
| 69 | that domain. It is easy for a programmer to re-use those
|
| 70 | translations instead of maintaining their own translation
|
| 71 | infrastructure. Moreover, the programmer does not need to follow
|
| 72 | changes in the ISO standard and will not work with outdated
|
| 73 | information.")
|
| 74 | (license license:gpl2+))) |
| 75 |
|
| 76 | (define-public iso-codes/pinned
|
| 77 | |
| 78 | |
| 79 | (hidden-package
|
| 80 | (package
|
| 81 | (inherit iso-codes/official)
|
| 82 | (source
|
| 83 | (origin
|
| 84 | (inherit (package-source iso-codes/official))
|
| 85 | (modules '((guix build utils)))
|
| 86 | (snippet
|
| 87 | '(begin
|
| 88 | (substitute* (find-files "." "\\.po$")
|
| 89 | (("#.*Name for TWN,.*") "")
|
| 90 | (("^msgid \"Taiwan, .*") "# Guix doesn't use "))
|
| 91 | (substitute* "data/iso_3166-1.json"
|
| 92 | (("(Taiwan), [^\"]*" _ name) name))))))
|
| 93 | (synopsis "Various ISO standards as used by GNU@tie{}Guix"))))
|
| 94 |
|
| 95 | (define-public iso-codes
|
| 96 | (package
|
| 97 | (inherit iso-codes/pinned)
|
| 98 | (version "4.17.0")
|
| 99 | (source (origin
|
| 100 | (inherit (package-source iso-codes/pinned))
|
| 101 | (uri (git-reference
|
| 102 | (url (package-home-page iso-codes/pinned))
|
| 103 | (commit (string-append "v" version))))
|
| 104 | (file-name (git-file-name (package-name iso-codes/pinned) version))
|
| 105 | (sha256
|
| 106 | (base32
|
| 107 | "0a77b9aid68vakhsa3l3lx2jav5q9fp7vn50mwmzkr2lkr2l4k41"))))))
|
| 108 |
|
| 109 | (define-public python-country-converter
|
| 110 | (package
|
| 111 | (name "python-country-converter")
|
| 112 | (version "1.3.2")
|
| 113 | (source
|
| 114 | (origin
|
| 115 | (method git-fetch)
|
| 116 | (uri (git-reference
|
| 117 | (url "https://github.com/IndEcol/country_converter")
|
| 118 | (commit (string-append "v" version))))
|
| 119 | (file-name (git-file-name name version))
|
| 120 | (sha256
|
| 121 | (base32 "0hmz6ihh0lr8a98fvacc1xpg1zgwx7y02sbn0xi2sh5lg6qrqyap"))))
|
| 122 | (build-system pyproject-build-system)
|
| 123 | (native-inputs
|
| 124 | (list python-pytest
|
| 125 | python-setuptools))
|
| 126 | (propagated-inputs
|
| 127 | (list python-pandas))
|
| 128 | (home-page "https://github.com/IndEcol/country_converter")
|
| 129 | (synopsis "Auto conversion from different country name standards")
|
| 130 | (description
|
| 131 | "The country converter (coco) automates the conversion from different
|
| 132 | standards and version of country names. Internally, coco is based on a table
|
| 133 | specifying the different ISO and UN standards per country together with the
|
| 134 | official name and a regular expression which aim to match all English versions
|
| 135 | of a specific country name. In addition, coco includes classification based
|
| 136 | on UN-, EU-, OECD-membership, UN regions specifications, continents and
|
| 137 | various MRIO and IAM databases.
|
| 138 |
|
| 139 | Supported classification schemas: APEC, BASIC, BRIC, CC41, CIS, Cecilia 2050
|
| 140 | classification, DACcode, EEA membership, EU membership, EXIOBASE 1
|
| 141 | classification, EXIOBASE 2 classification, EXIOBASE 3 classification, Eora,
|
| 142 | FAOcode, G20, G7, GBDcode, GWcode, IEA, IMAGE, IOC ISO 3166-1 alpha-2, ISO
|
| 143 | 3166-1 alpha-3, ISO 3166-1 numeric, MESSAGE 11-region classification, OECD
|
| 144 | membership, REMIND, Schengen region, UN membership, UN numeric code, UN
|
| 145 | region, WIOD classification, ccTLD.")
|
| 146 | (license license:gpl3)))
|
| 147 |
|
| 148 | (define-public python-iso639
|
| 149 | (package
|
| 150 | (name "python-iso639")
|
| 151 | (version "0.4.5")
|
| 152 | (source
|
| 153 | (origin
|
| 154 | (method git-fetch)
|
| 155 | (uri (git-reference
|
| 156 | (url "https://github.com/noumar/iso639")
|
| 157 | (commit version)))
|
| 158 | (file-name (git-file-name name version))
|
| 159 | (sha256
|
| 160 | (base32 "02kx6kr3x43linxqafjlx85zdk04s6ab2fv5ikyglghwr5hsvic4"))))
|
| 161 | (build-system pyproject-build-system)
|
| 162 | (arguments
|
| 163 | (list
|
| 164 | #:test-flags
|
| 165 | #~(list "tests/tests.py"
|
| 166 | "-k" (string-join
|
| 167 | (list
|
| 168 | |
| 169 | "not test_iter"
|
| 170 | |
| 171 | "test_logic_part2"
|
| 172 | |
| 173 | "test_compare_alpha2"
|
| 174 | "test_compare_bibliographic"
|
| 175 | "test_compare_terminology")
|
| 176 | " and not "))
|
| 177 | #:phases
|
| 178 | #~(modify-phases %standard-phases
|
| 179 | (add-before 'check 'configure-tests
|
| 180 | (lambda _
|
| 181 | (setenv "PYTHONPATH"
|
| 182 | (string-append (getcwd) ":"
|
| 183 | (getenv "GUIX_PYTHONPATH"))))))))
|
| 184 | (native-inputs (list python-pycountry python-pytest python-setuptools))
|
| 185 | (home-page "https://github.com/noumar/iso639")
|
| 186 | (synopsis "Python library for ISO 639 standard")
|
| 187 | (description
|
| 188 | "This package provides a Python library for ISO 639 standard that is
|
| 189 | concerned with representation of names for languages and language groups.")
|
| 190 | (license license:agpl3+)))
|
| 191 |
|
| 192 | (define-public python-iso3166
|
| 193 | (package
|
| 194 | (name "python-iso3166")
|
| 195 | (version "2.1.1")
|
| 196 | (source
|
| 197 | (origin
|
| 198 | (method git-fetch)
|
| 199 | (uri (git-reference
|
| 200 | (url "https://github.com/deactivated/python-iso3166")
|
| 201 | (commit (string-append "v" version))))
|
| 202 | (file-name (git-file-name name version))
|
| 203 | (sha256
|
| 204 | (base32 "0j0bnm4bd23cyb7dga00gb20myg9skylchkw4d23yh31b7a315m8"))))
|
| 205 | (build-system pyproject-build-system)
|
| 206 | (native-inputs (list python-pytest python-setuptools))
|
| 207 | (home-page "https://github.com/deactivated/python-iso3166")
|
| 208 | (synopsis "Self-contained ISO 3166-1 country definitions")
|
| 209 | (description "This package provides the ISO 3166-1 country definitions.")
|
| 210 | (license license:expat)))
|
| 211 |
|
| 212 | (define-public python-pycountry
|
| 213 | (package
|
| 214 | (name "python-pycountry")
|
| 215 | (version "24.6.1")
|
| 216 | (source
|
| 217 | (origin
|
| 218 | (method git-fetch)
|
| 219 | (uri (git-reference
|
| 220 | (url "https://github.com/pycountry/pycountry")
|
| 221 | (commit version)))
|
| 222 | (file-name (git-file-name name version))
|
| 223 | (sha256
|
| 224 | (base32 "0qs99acz1vsj96s8pcwbnp3z3s01mzzvdayk7fm0nnl6lf3lz1g1"))))
|
| 225 | (build-system pyproject-build-system)
|
| 226 | (arguments
|
| 227 | (list
|
| 228 | #:phases
|
| 229 | #~(modify-phases %standard-phases
|
| 230 | (add-after 'unpack 'fix-pytest-config
|
| 231 | (lambda _ |
| 232 | (substitute* "pyproject.toml"
|
| 233 | (("^required_plugins =.*")
|
| 234 | "")))))))
|
| 235 | (native-inputs (list python-poetry-core python-pytest))
|
| 236 | (home-page "https://github.com/pycountry/pycountry")
|
| 237 | (synopsis "ISO databases for languages, countries, currencies, etc.")
|
| 238 | (description
|
| 239 | "@code{pycountry} provides the ISO databases for the standards:
|
| 240 | @enumerate
|
| 241 | @item 639-3 (Languages)
|
| 242 | @item 3166 (Countries)
|
| 243 | @item 3166-3 (Deleted Countries)
|
| 244 | @item 3166-2 (Subdivisions of countries)
|
| 245 | @item 4217 (Currencies)
|
| 246 | @item 15924 (Scripts)
|
| 247 | @end enumerate
|
| 248 | It includes a copy from Debian’s pkg-isocodes and makes the data accessible
|
| 249 | through a Python API.")
|
| 250 | (license license:lgpl2.1+)))
|