Skip to main content

A package for retrieving Open Flags SVGs

Project description

Open Flags

open_flags is a lightweight Python library for handling flag SVGs. It provides functions to fetch and display SVG flags based on country and region codes. This library is perfect for integrating into web applications or other Python projects.

Installation

Install the package via pip:

pip install open_flags

Usage

Retrieving an SVG

from open_flags import get_flag_svg

svg_content = get_flag_svg('usa', 'colorado')
print(svg_content)

Getting All Flags

from open_flags import get_all_flags

flags = get_all_flags()
print(flags)
Getting Flags by Country
python
Copy code
from open_flags import get_flags_by_country

us_flags = get_flags_by_country('usa')
print(us_flags)

API

get_flag_svg(country: str, region: str) -> str
Returns the SVG content for the specified country and region.

get_all_flags() -> list
Returns a list of all available flags in the format country/region.

get_flags_by_country(country: str) -> list
Returns a list of flags for the specified country.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

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

open_flags-0.0.2.tar.gz (16.7 MB view hashes)

Uploaded Source

Built Distribution

open_flags-0.0.2-py3-none-any.whl (17.0 MB view hashes)

Uploaded Python 3

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