GithubHelp home page GithubHelp logo

globalcountryexplorer's Introduction

CountryInfoFetcher

CountryInfoFetcher is a Python project designed to fetch and display information about countries using the restcountries.com API. It provides details such as the country name, capital city, and a link to the flag image in PNG format, displayed in a tabular format in the console.

Features

  • Fetches country data from the restcountries.com API.
  • Displays country information in a readable tabular format.
  • Logs activities and errors for easy debugging and monitoring.

Requirements

  • Python 3.6+
  • requests library
  • tabulate library

Installation

  1. Clone the repository:

    git clone https://github.com/igor20192/CountryInfoFetcher.git
    cd CountryInfoFetcher
  2. Install the required libraries:

    pip install requests tabulate

Usage

To fetch and display the country information, run the main.py script:

python country.py 

The script will fetch data from the API and display it in the console in a tabular format, including the country name, capital city, and flag URL.

Project Structure

  • country_info.py: Contains the CountryInfo class which handles fetching and displaying the data.
  • README.md: Project documentation.

Example Output

When you run the script, the output will be displayed in a table format like this:

+-----------------+----------------+-------------------------------------------------------------+
| Country Name    | Capital        | Flag URL                                                    |
+-----------------+----------------+-------------------------------------------------------------+
| Afghanistan     | Kabul          | https://flagcdn.com/w320/af.png                             |
| Albania         | Tirana         | https://flagcdn.com/w320/al.png                             |
| Algeria         | Algiers        | https://flagcdn.com/w320/dz.png                             |
| ...             | ...            | ...                                                         |
+-----------------+----------------+-------------------------------------------------------------+

Logging

The application uses Python's logging module to log information and errors. The logs include details about fetching data, any HTTP errors, connection issues, and more.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.

Contact

If you have any questions or suggestions, feel free to open an issue or contact me at [[email protected]].

globalcountryexplorer's People

Contributors

igor20192 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.