> markup-languages
File extensions for markup languages.
It's just a JSON file, so you can use it in any environment. Sourced from GitHub's Linguist project (defines all 69 markup languages known to GitHub). Data is updated via script and released via new package version.
Installation
pip install markup-languages
Usage
import markup_languages
html_lang_data = markup_languages['HTML']
print(html_lang_data['extensions']) # => ['.hta', '.htm', '.html', '.html.hl', ...]
Note: Most type checkers will falsely warn markup_languages is not subscriptable because they are incapable of analyzing runtime behavior (where the module is replaced w/ a dictionary for cleaner, direct access). You can safely suppress such warnings using # type: ignore.
Examples
Get language(s) from an extension:
def get_lang(file_ext):
lang_matches = [
lang for lang, data in markup_languages.items()
if file_ext in data['extensions']
]
return lang_matches[0] if len(lang_matches) == 1 else lang_matches
print(get_lang('.sss')) # => SugarSS
Get language(s) from a file path:
def get_lang_from_path(filepath):
from pathlib import Path
file_ext = Path(filepath).suffix
lang_matches = [
lang for lang, data in markup_languages.items()
if file_ext in data['extensions']
]
return lang_matches[0] if len(matches) == 1 else lang_matches
print(get_lang_from_path('index.html')) # => ['Ecmarkup', 'HTML']
print(get_lang_from_path('style.css')) # => CSS
print(get_lang_from_path('script.js')) # => [] (use programming-languages pkg)
MIT License
Copyright © 2026 Adam Lui
Related
🇨🇳 non-latin-locales - ISO 639-1 (2-letter) codes for non-Latin locales.
#! programming-languages - File extensions for programming languages.
🏷️ project-markers - Common project root markers.
Metadata
Release files for markup-languages 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| markup_languages-1.0.5.tar.gz | 6.3 kB | With provenance | Details for markup_languages-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| markup_languages-1.0.5-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for markup_languages-1.0.5-py2.py3-none-any.whl |
Total release size: 12.2 kB
Release files / markup_languages-1.0.5.tar.gz
| Download URL | markup_languages-1.0.5.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5e0908508425d99b634bcf174fe1bdccee0ca20fd20ba818e75584c5304771d
|
|
BLAKE2b-256 checksum How to use checksums |
f7cea43cb341cd83554c4578f8b9e0bdfd0524254aafcc65e6a33b4ae6ae140b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logRelease files / markup_languages-1.0.5-py2.py3-none-any.whl
| Download URL | markup_languages-1.0.5-py2.py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7f9a0ed774bffdb17a8014ec2077af4e43601de9e57fde360440af69da9b2d1b
|
|
BLAKE2b-256 checksum How to use checksums |
828b234252a9ffd32b1a22078dc173243e5225be36e9d868ddc5e50d786c6773
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logSecurity for markup-languages 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for markup_languages-1.0.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.