Skip to main content

Liste de pays en dict

Project description

Intégration continue Couverture des tests

Une librairie pour intégrer des listes (simples) de pays dans ses applications.

Installation

pays est disponible sur pip pour python > 3.

pip install pays

Usage

from pays import Countries

countries = Countries(
    'fra',  # locale 639-2 pour les traductions des noms, optionnel, fra par défaut
    # codes alpha2 de pays à exclure, optionnel
    exclude=['ES'],
    # codes alpha2 de pays à utiliser exclusivement, optionnel
    only=['FR', 'DE']
    # note: on ne peut utiliser que exclude OU only, pas les deux à la fois
)
for country in countries:  # générateur
    print(country)  # __str__ retourne nom commun : France
    print(country.official_name)  # République Française

print(countries.get('FR'))  # France
print(countries.get('FRA', 'ita'))  # Francia en italien
print(countries.get(250, 'nld'))  # Frankrijk en Néerlandais

Pour plus d’informations consultez la documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pays-0.2.3.tar.gz (112.5 kB view details)

Uploaded Source

File details

Details for the file pays-0.2.3.tar.gz.

File metadata

  • Download URL: pays-0.2.3.tar.gz
  • Upload date:
  • Size: 112.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pays-0.2.3.tar.gz
Algorithm Hash digest
SHA256 ce2d225071ae030284002c266ec21bcd051a1d8f13a63d179a5daf66fee0bf7c
MD5 da92be0f1c4342d57e7f1e1e49c0806f
BLAKE2b-256 01e1aad71394624467fbe91cc88f257cadb2dee758b3ba1e11cf88ff1044e1ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page