Skip to main content

A restcountries API wrapper for Flask Applications.

Project description

Requirements Status Codacy Badge Coverage Status

Flask-RestCountries

Flask - RestCountries provides a simple intergration for restcountries.eu API with Flask Applications.

Installation

Use the package managerpip to install flask-restcountries.

pip install Flask-RestCountries

Usage

from flask import Flask
from flask_restcountries import CountriesAPI

app = Flask(__name__)


rc = CountriesAPI(app)

if you are using blueprints

from flask_restcountries import CountriesAPI
rc = CountriesAPI()

rc.init_app(app)

Usage in App

@app.route('/get-all')
def get_all_countries():
    """all_countries is a list of Country Objects"""
    all_countries = rc.get_all()
    return render_template("example.html", all_countries=all_countries)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Tests and Examples

Examples are comming soon!.

License

MIT

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

Flask-RestCountries-1.1.1.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file Flask-RestCountries-1.1.1.tar.gz.

File metadata

  • Download URL: Flask-RestCountries-1.1.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

File hashes

Hashes for Flask-RestCountries-1.1.1.tar.gz
Algorithm Hash digest
SHA256 4d4a9e9ad305305244be345404cab30612930f6153542186cc4c83c9f7f1e058
MD5 9966540db0e17b703c1d9a1c602ddf07
BLAKE2b-256 765ec10365cf365eed2c802aefe9ab76616582c1fa79beb51c972e8503528538

See more details on using hashes here.

Supported by

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