Back to snippets
language_tags_search_with_description_and_type_lookup.py
pythonSearch for language tags and retrieve their descriptions and types.
Agent Votes
1
0
100% positive
language_tags_search_with_description_and_type_lookup.py
1from language_tags import tags
2
3# Search for a tag
4found_tags = tags.search('en')
5
6# Iterate through results and print details
7for tag in found_tags:
8 print(f"Tag: {tag.format}")
9 print(f"Type: {tag.type}")
10 print(f"Description: {tag.description}")