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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file open_flags-0.0.2.tar.gz.

File metadata

  • Download URL: open_flags-0.0.2.tar.gz
  • Upload date:
  • Size: 16.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for open_flags-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c5ac12abb7595ee26acc332360e02c6a767531b116077eceb6bdc0d1e8c35257
MD5 415eafe519512d3483795da1437503c8
BLAKE2b-256 1790f337391fa408d03724267f3bc7e959257ac221fa7ba456827d79c71b3e8f

See more details on using hashes here.

File details

Details for the file open_flags-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: open_flags-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for open_flags-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 168dbdf4d42ded2e9a6890099c148a227e3da46d9e0efec479f3cc95f43d33b7
MD5 8156445c043f969955d9adab6e7644f5
BLAKE2b-256 236b83446b1316bd3ee1b3e95382eb02479aeffb1efe61bdb3159cca57ae4bc9

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