semvec/pypi-packages huggingface dataset:
vexpy 0.1.1
Python vexillology library using https://flagpedia.net/
License: MIT
Keywords: python,flag,flags,vexillology

# VexPy

Python vexillology library using <https://flagpedia.net/>

Source code on GitHub <https://github.com/awesomeplaya211/vexpy>

Originally made for <https://github.com/awesomeplaya211/RockyBot>

Dedicated to bob-a tea#6991 on Discord

## Installation

VexPy can be installed with:

```sh
pip install vexpy
```

## Documentation

### Functions and Classes

#### vexpy.**flag_src**(*iso*, *width=1280*)

Returns link to png file of *iso* country's flag *width* pixels wide

Arguments:

* **iso** - `str` - a country's [2-character ISO-3361 alpha-2 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
* **width** - `int` - if set to a valid width (20, 40, 80, 160, 320, 640, 1280, 2560) , return the flag png file that is *width* pixels wide; **defaults to 1280**

#### vexpy.**iso**()

Returns a Python dictionary (`dict`) with [2-character ISO-3361 alpha-2 country codes](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) as keys with the country's common names in a `list` as the values

First element in `list` is the most commonly used name for the country

#### vexpy.**iso_code**(*iso*)

Returns the most commonly used name for the country which the 2-char ISO code represents

Equivalant to `vexpy.iso()[iso][0]`

Arguments:

* **iso** - `str` - a country's [2-character ISO-3361 alpha-2 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)

### Exceptions

#### IsoKeyError

Raised if key is not found within `vexpy.iso`

#### InvalidWidthError

Raised if width is not in valid widths (20, 40, 80, 160, 320, 640, 1280, 2560)