semvec/pypi-packages huggingface dataset:
python-countries 1.0.1
Python bindings for REST Countries API
Requires Python: >=3.6
Keywords: REST Countries API

# <p align="center"> python-countries </p>

<p align="center">
<a href="https://travis-ci.com/leonkozlowski/python-countries"><img alt="Build Status" src="https://travis-ci.com/leonkozlowski/python-countries.svg?branch=master"></a>
<a href='https://coveralls.io/github/leonkozlowski/python-countries'><img src='https://coveralls.io/repos/github/leonkozlowski/python-countries/badge.svg' alt='Coverage Status' /></a>
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
<a href="https://pypi.org/project/python-countries"><img alt="PyPI" src="https://img.shields.io/pypi/v/python-countries"></a>
</p>


Wraps [REST Countries](https://restcountries.eu/#api-endpoints-calling-code)


## Installation

From Build:
```bash
$ pip install python-countries
```

From Source:
```bash
$ git clone https://github.com/leonkozlowski/python-countries.git
$ cd python-countries
$ pip install -e .
```

## Usage

Create the client
```bash
>>> client = CountriesApi()
```

Show available endpoints
```bash
>>> client.endpoints()
>>> ['country_name', 'full_name', 'iso_code', 'currency', 'language', 'capital_city', 'calling_code', 'region']
```

Request for country data by full name
```bash
>>> client.full_name('Colombia')
```

Response for `full_name` endpoint
```bash
{
    "name": "Colombia",
    "topLevelDomain": [".co"],
    "alpha2Code": "CO",
    "alpha3Code": "COL",
    "callingCodes": ["57"],
    "capital": "Bogotá",
    "altSpellings": ["CO", "Republic of Colombia", "República de Colombia"],
    "region": "Americas",
    "subregion": "South America",
    "population": 48759958,
    "latlng": [4.0, -72.0],
    "demonym": "Colombian",
    "area": 1141748.0,
    "gini": 55.9,
    "timezones": ["UTC-05:00"],
    "borders": ["BRA", "ECU", "PAN", "PER", "VEN"],
    "nativeName": "Colombia",
    "numericCode": "170",
    "currencies": [{
        "code": "COP",
        "name": "Colombian peso",
        "symbol": "$"
    }],
    "languages": [{
        "iso639_1": "es",
        "iso639_2": "spa",
        "name": "Spanish",
        "nativeName": "Español"
    }],
    "translations": {
        "de": "Kolumbien",
        "es": "Colombia",
        "fr": "Colombie",
        "ja": "コロンビア",
        "it": "Colombia",
        "br": "Colômbia",
        "pt": "Colômbia"
    },
    "flag": "https://restcountries.eu/data/col.svg",
    "regionalBlocs": [{
        "acronym": "PA",
        "name": "Pacific Alliance",
        "otherAcronyms": [],
        "otherNames": ["Alianza del Pacífico"]
    }, {
        "acronym": "USAN",
        "name": "Union of South American Nations",
        "otherAcronyms": ["UNASUR", "UNASUL", "UZAN"],
        "otherNames": ["Unión de Naciones Suramericanas"..."]
    }],
    "cioc": "COL"
}
```

`CountryResponse` facade for easy attribute access
```python
>>> colombia = client.full_name('Colombia')

>>> colombia.name
>>> "Colombia"

>>> colombia.flag
>>> "https://restcountries.eu/data/col.svg"
```
wikibase-api 0.1.2
Wrapper library for the Wikibase API
Requires Python: >=3.6,<4.0
Keywords: wikibase,wikidata,bot,api,wrapper

# wikibase-api

**`wikibase-api` is a Python library for simple access to the [Wikibase API](https://www.wikidata.org/w/api.php?action=help).**

It simplifies the authentication process and can be used to query and edit information on Wikidata or any other Wikibase instance.

**For a simpler, object-oriented abstraction of the Wikibase API, have a look at [`python-wikibase`](https://github.com/samuelmeuli/python-wikibase).**

## Installation

```sh
pip install wikibase-api
```

## Usage

Simple example for fetching all information about a Wikidata page:

```py
from wikibase_api import Wikibase

wb = Wikibase()
r = wb.entity.get("Q1")
print(r)
```

Output:

```python
{
  "entities": {
    "Q1": {
      # ...
    }
  },
  "success": 1,
}
```

**See the [documentation](https://wikibase-api.readthedocs.io) for descriptions and examples of all commands.**

## Development

### Contributing

Suggestions and contributions are always welcome! Please discuss larger changes via issue before submitting a pull request.

### Setup

See [this guide](https://wikibase-api.readthedocs.io/en/latest/development/development.html) on how to set up a development environment for this package.

## Related

- [`python-wikibase`](https://github.com/samuelmeuli/python-wikibase) – Wikibase queries and edits made easy