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.0.tar.gz (2.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: Flask-RestCountries-1.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 bc9f916a82633e17a97512a9145b0859a1374fe513744b488a9a5a3edc7557bd
MD5 bc9ae3fc1d50f63e3a17deb2ff2bbaf3
BLAKE2b-256 20aa8486b2fcadc3f103383d6fcd39816124c4a60a40adee86ac409ac6d03ae6

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