markup-languages 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: markup-languages
3
+ Version: 1.0.0
4
+ Summary: File extensions for markup languages.
5
+ Author-email: Adam Lui <adam@kudoai.com>
6
+ License-Expression: MIT
7
+ Project-URL: Changelog, https://github.com/adamlui/python-utils/releases/tag/markup-languages-1.0.0
8
+ Project-URL: Documentation, https://github.com/adamlui/python-utils/tree/main/markup-languages/docs
9
+ Project-URL: Funding, https://github.com/sponsors/adamlui
10
+ Project-URL: Homepage, https://github.com/adamlui/python-utils/tree/main/markup-languages/#readme
11
+ Project-URL: Issues, https://github.com/adamlui/python-utils/issues
12
+ Project-URL: PyPI Stats, https://pepy.tech/projects/markup-languages
13
+ Project-URL: Releases, https://github.com/adamlui/python-utils/releases
14
+ Project-URL: Repository, https://github.com/adamlui/python-utils
15
+ Keywords: computer-languages,css,extensions,file-extensions,file‑type-detection,filenames,github,html,language-detection,languages,linguist,markup-languages,syntax-highlighting,xml
16
+ Classifier: Development Status :: 5 - Production/Stable
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Intended Audience :: Education
19
+ Classifier: Intended Audience :: Information Technology
20
+ Classifier: Intended Audience :: Science/Research
21
+ Classifier: Intended Audience :: System Administrators
22
+ Classifier: Natural Language :: English
23
+ Classifier: Operating System :: OS Independent
24
+ Classifier: Programming Language :: Python
25
+ Classifier: Programming Language :: Python :: 2
26
+ Classifier: Programming Language :: Python :: 2.6
27
+ Classifier: Programming Language :: Python :: 2.7
28
+ Classifier: Programming Language :: Python :: 3
29
+ Classifier: Programming Language :: Python :: 3.8
30
+ Classifier: Programming Language :: Python :: 3.9
31
+ Classifier: Programming Language :: Python :: 3.10
32
+ Classifier: Programming Language :: Python :: 3.11
33
+ Classifier: Programming Language :: Python :: 3.12
34
+ Classifier: Programming Language :: Python :: 3.13
35
+ Classifier: Programming Language :: Python :: 3.14
36
+ Classifier: Programming Language :: Python :: 3.15
37
+ Classifier: Topic :: Education
38
+ Classifier: Topic :: Software Development
39
+ Classifier: Topic :: Software Development :: Libraries
40
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
41
+ Classifier: Topic :: Text Processing
42
+ Classifier: Topic :: Text Processing :: Markup
43
+ Classifier: Topic :: Utilities
44
+ Requires-Python: <4,>=2.6
45
+ Description-Content-Type: text/markdown
46
+ License-File: docs/LICENSE.md
47
+ Provides-Extra: dev
48
+ Requires-Dist: nox>=2026.2.9; extra == "dev"
49
+ Requires-Dist: tomli~=2.4.0; extra == "dev"
50
+ Requires-Dist: tomli-w~=1.2.0; extra == "dev"
51
+ Dynamic: license-file
52
+
53
+ <a id="top"></a>
54
+
55
+ # > markup-languages
56
+
57
+ <a href="https://github.com/adamlui/python-utils/releases/tag/markup-languages-1.0.0">
58
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-1.0.0-32fcee.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
59
+ <a href="https://github.com/adamlui/python-utils/blob/main/markup-languages/docs/LICENSE.md">
60
+ <img height=31 src="https://img.shields.io/badge/License-MIT-f99b27.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
61
+ <a href="https://www.codefactor.io/repository/github/adamlui/python-utils">
62
+ <img height=31 src="https://img.shields.io/codefactor/grade/github/adamlui/python-utils?label=Code+Quality&logo=codefactor&logoColor=white&labelColor=464646&color=a0fc55&style=for-the-badge"></a>
63
+ <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_python-utils">
64
+ <img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_python-utils%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=fafc74"></a>
65
+
66
+ > ### _File extensions for markup languages._
67
+
68
+ It's just a [JSON file](https://github.com/adamlui/python-utils/blob/markup-languages-1.0.0/markup-languages/src/markup_languages/markup_languages.json), so you can use it in any environment. Sourced from GitHub's [Linguist](https://github.com/github-linguist/linguist) project (defines all markdown languages known to GitHub). Data is updated via script and released via new package version.
69
+
70
+ ## Installation
71
+
72
+ ```bash
73
+ pip install markup-languages
74
+ ```
75
+
76
+ ## Usage
77
+
78
+ ```py
79
+ import markup_languages
80
+
81
+ html_data = markup_languages['HTML']
82
+
83
+ print(html_data['extensions']) # => ['.hta', '.htm', '.html', '.html.hl', ...]
84
+ ```
85
+
86
+ _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`.
87
+
88
+ ## Examples
89
+
90
+ Get language from an extension:
91
+
92
+ ```py
93
+ def get_lang(file_ext):
94
+ for lang, data in markup_languages.items():
95
+ if file_ext in data['extensions']:
96
+ return lang
97
+
98
+ print(get_lang('.sss')) # => 'SugarSS'
99
+ ```
100
+
101
+ Get language from a file path:
102
+
103
+ ```py
104
+ def get_lang_from_path(filepath):
105
+ from pathlib import Path
106
+ file_ext = Path(filepath).suffix
107
+ for lang, data in markup_languages.items():
108
+ if file_ext in data['extensions']:
109
+ return lang
110
+
111
+ print(get_lang_from_path('index.html')) # => 'HTML'
112
+ print(get_lang_from_path('style.css')) # => 'CSS'
113
+ print(get_lang_from_path('script.js')) # => None (use programming-languages pkg)
114
+ ```
115
+
116
+ ## MIT License
117
+
118
+ Copyright © 2026 [Adam Lui](https://github.com/adamlui).
119
+
120
+ ## Related
121
+
122
+ 🇨🇳 [non-latin-locales](https://github.com/adamlui/python-utils/tree/main/non-latin-locales/#readme) - ISO 639-1 (2-letter) codes for non-Latin locales.
123
+ <br></> [programming-languages](https://github.com/adamlui/python-utils/tree/main/programming-languages/#readme) - File extensions for programming languages.
124
+ <br>🏷️ [project-markers](https://github.com/adamlui/python-utils/tree/main/project-markers/#readme) - Common project root markers.
125
+
126
+ #
127
+
128
+ <a href="#top">Back to top ↑</a>
@@ -0,0 +1,21 @@
1
+ # 🏛️ MIT License
2
+
3
+ **Copyright © 2026 [Adam Lui](https://github.com/adamlui)**
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,76 @@
1
+ <a id="top"></a>
2
+
3
+ # > markup-languages
4
+
5
+ <a href="https://github.com/adamlui/python-utils/releases/tag/markup-languages-1.0.0">
6
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-1.0.0-32fcee.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
7
+ <a href="https://github.com/adamlui/python-utils/blob/main/markup-languages/docs/LICENSE.md">
8
+ <img height=31 src="https://img.shields.io/badge/License-MIT-f99b27.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
9
+ <a href="https://www.codefactor.io/repository/github/adamlui/python-utils">
10
+ <img height=31 src="https://img.shields.io/codefactor/grade/github/adamlui/python-utils?label=Code+Quality&logo=codefactor&logoColor=white&labelColor=464646&color=a0fc55&style=for-the-badge"></a>
11
+ <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_python-utils">
12
+ <img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_python-utils%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=fafc74"></a>
13
+
14
+ > ### _File extensions for markup languages._
15
+
16
+ It's just a [JSON file](https://github.com/adamlui/python-utils/blob/markup-languages-1.0.0/markup-languages/src/markup_languages/markup_languages.json), so you can use it in any environment. Sourced from GitHub's [Linguist](https://github.com/github-linguist/linguist) project (defines all markdown languages known to GitHub). Data is updated via script and released via new package version.
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pip install markup-languages
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```py
27
+ import markup_languages
28
+
29
+ html_data = markup_languages['HTML']
30
+
31
+ print(html_data['extensions']) # => ['.hta', '.htm', '.html', '.html.hl', ...]
32
+ ```
33
+
34
+ _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`.
35
+
36
+ ## Examples
37
+
38
+ Get language from an extension:
39
+
40
+ ```py
41
+ def get_lang(file_ext):
42
+ for lang, data in markup_languages.items():
43
+ if file_ext in data['extensions']:
44
+ return lang
45
+
46
+ print(get_lang('.sss')) # => 'SugarSS'
47
+ ```
48
+
49
+ Get language from a file path:
50
+
51
+ ```py
52
+ def get_lang_from_path(filepath):
53
+ from pathlib import Path
54
+ file_ext = Path(filepath).suffix
55
+ for lang, data in markup_languages.items():
56
+ if file_ext in data['extensions']:
57
+ return lang
58
+
59
+ print(get_lang_from_path('index.html')) # => 'HTML'
60
+ print(get_lang_from_path('style.css')) # => 'CSS'
61
+ print(get_lang_from_path('script.js')) # => None (use programming-languages pkg)
62
+ ```
63
+
64
+ ## MIT License
65
+
66
+ Copyright © 2026 [Adam Lui](https://github.com/adamlui).
67
+
68
+ ## Related
69
+
70
+ 🇨🇳 [non-latin-locales](https://github.com/adamlui/python-utils/tree/main/non-latin-locales/#readme) - ISO 639-1 (2-letter) codes for non-Latin locales.
71
+ <br></> [programming-languages](https://github.com/adamlui/python-utils/tree/main/programming-languages/#readme) - File extensions for programming languages.
72
+ <br>🏷️ [project-markers](https://github.com/adamlui/python-utils/tree/main/project-markers/#readme) - Common project root markers.
73
+
74
+ #
75
+
76
+ <a href="#top">Back to top ↑</a>
@@ -0,0 +1,93 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools~=82.0.0",
4
+ "wheel",
5
+ ]
6
+ build-backend = "setuptools.build_meta"
7
+
8
+ [project]
9
+ name = "markup-languages"
10
+ version = "1.0.0"
11
+ description = "File extensions for markup languages."
12
+ authors = [
13
+ { name = "Adam Lui", email = "adam@kudoai.com" },
14
+ ]
15
+ readme = "docs/README.md"
16
+ license = "MIT"
17
+ license-files = [
18
+ "docs/LICENSE.md",
19
+ ]
20
+ requires-python = ">=2.6,<4"
21
+ keywords = [
22
+ "computer-languages",
23
+ "css",
24
+ "extensions",
25
+ "file-extensions",
26
+ "file‑type-detection",
27
+ "filenames",
28
+ "github",
29
+ "html",
30
+ "language-detection",
31
+ "languages",
32
+ "linguist",
33
+ "markup-languages",
34
+ "syntax-highlighting",
35
+ "xml",
36
+ ]
37
+ classifiers = [
38
+ "Development Status :: 5 - Production/Stable",
39
+ "Intended Audience :: Developers",
40
+ "Intended Audience :: Education",
41
+ "Intended Audience :: Information Technology",
42
+ "Intended Audience :: Science/Research",
43
+ "Intended Audience :: System Administrators",
44
+ "Natural Language :: English",
45
+ "Operating System :: OS Independent",
46
+ "Programming Language :: Python",
47
+ "Programming Language :: Python :: 2",
48
+ "Programming Language :: Python :: 2.6",
49
+ "Programming Language :: Python :: 2.7",
50
+ "Programming Language :: Python :: 3",
51
+ "Programming Language :: Python :: 3.8",
52
+ "Programming Language :: Python :: 3.9",
53
+ "Programming Language :: Python :: 3.10",
54
+ "Programming Language :: Python :: 3.11",
55
+ "Programming Language :: Python :: 3.12",
56
+ "Programming Language :: Python :: 3.13",
57
+ "Programming Language :: Python :: 3.14",
58
+ "Programming Language :: Python :: 3.15",
59
+ "Topic :: Education",
60
+ "Topic :: Software Development",
61
+ "Topic :: Software Development :: Libraries",
62
+ "Topic :: Software Development :: Libraries :: Python Modules",
63
+ "Topic :: Text Processing",
64
+ "Topic :: Text Processing :: Markup",
65
+ "Topic :: Utilities",
66
+ ]
67
+
68
+ [project.urls]
69
+ Changelog = "https://github.com/adamlui/python-utils/releases/tag/markup-languages-1.0.0"
70
+ Documentation = "https://github.com/adamlui/python-utils/tree/main/markup-languages/docs"
71
+ Funding = "https://github.com/sponsors/adamlui"
72
+ Homepage = "https://github.com/adamlui/python-utils/tree/main/markup-languages/#readme"
73
+ Issues = "https://github.com/adamlui/python-utils/issues"
74
+ "PyPI Stats" = "https://pepy.tech/projects/markup-languages"
75
+ Releases = "https://github.com/adamlui/python-utils/releases"
76
+ Repository = "https://github.com/adamlui/python-utils"
77
+
78
+ [project.optional-dependencies]
79
+ dev = [
80
+ "nox>=2026.2.9",
81
+ "tomli~=2.4.0",
82
+ "tomli-w~=1.2.0",
83
+ ]
84
+
85
+ [tool.setuptools.packages.find]
86
+ where = [
87
+ "src",
88
+ ]
89
+
90
+ [tool.setuptools.package-data]
91
+ markup_languages = [
92
+ "markup_languages.json",
93
+ ]
@@ -0,0 +1,7 @@
1
+ [bdist_wheel]
2
+ universal = 1
3
+
4
+ [egg_info]
5
+ tag_build =
6
+ tag_date = 0
7
+
@@ -0,0 +1,6 @@
1
+ import json, os, sys
2
+
3
+ with open(os.path.join(os.path.dirname(__file__), 'markup_languages.json')) as file:
4
+ markup_languages = json.load(file)
5
+
6
+ sys.modules[__name__] = markup_languages
@@ -0,0 +1,83 @@
1
+ {
2
+ "Antlers": { "extensions": [".antlers.html",".antlers.php",".antlers.xml"] },
3
+ "API Blueprint": { "extensions": [".apib"] },
4
+ "Astro": { "extensions": [".astro"] },
5
+ "BibTeX": { "extensions": [".bib",".bibtex"] },
6
+ "Bikeshed": { "extensions": [".bs"] },
7
+ "Blade": { "extensions": [".blade",".blade.php"] },
8
+ "Bru": { "extensions": [".bru"] },
9
+ "Closure Templates": { "extensions": [".soy"] },
10
+ "Cooklang": { "extensions": [".cook"] },
11
+ "CSS": { "extensions": [".css"] },
12
+ "D2": { "extensions": [".d2"] },
13
+ "Ecmarkup": { "extensions": [".html"] },
14
+ "Edge": { "extensions": [".edge"] },
15
+ "EJS": { "extensions": [".ect",".ejs",".ejs.t",".jst"] },
16
+ "Genero per": { "extensions": [".per"] },
17
+ "Go Template": { "extensions": [".gohtml",".gotmpl",".html.tmpl",".tmpl",".tpl"] },
18
+ "Haml": { "extensions": [".haml",".haml.deface"] },
19
+ "Handlebars": { "extensions": [".handlebars",".hbs"] },
20
+ "HTML": { "extensions": [".hta",".htm",".html",".html.hl",".inc",".xht",".xhtml"] },
21
+ "HTML+ECR": { "extensions": [".ecr"] },
22
+ "HTML+EEX": { "extensions": [".heex",".html.eex",".leex"] },
23
+ "HTML+ERB": { "extensions": [".erb",".erb.deface",".rhtml"] },
24
+ "HTML+PHP": { "extensions": [".phtml"] },
25
+ "HTML+Razor": { "extensions": [".cshtml",".razor"] },
26
+ "Jinja": { "extensions": [".j2",".jinja",".jinja2"] },
27
+ "Jupyter Notebook": { "extensions": [".ipynb"] },
28
+ "Kit": { "extensions": [".kit"] },
29
+ "kvlang": { "extensions": [".kv"] },
30
+ "Latte": { "extensions": [".latte"] },
31
+ "Less": { "extensions": [".less"] },
32
+ "Liquid": { "extensions": [".liquid"] },
33
+ "Marko": { "extensions": [".marko"] },
34
+ "Mask": { "extensions": [".mask"] },
35
+ "mdsvex": { "extensions": [".svx"] },
36
+ "MDX": { "extensions": [".mdx"] },
37
+ "Mermaid": { "extensions": [".mermaid",".mmd"] },
38
+ "MTML": { "extensions": [".mtml"] },
39
+ "Mustache": { "extensions": [".mustache"] },
40
+ "Nunjucks": { "extensions": [".njk"] },
41
+ "Pic": { "extensions": [".chem",".pic"] },
42
+ "PostCSS": { "extensions": [".pcss",".postcss"] },
43
+ "PostScript": { "extensions": [".eps",".epsi",".pfa",".ps"] },
44
+ "Pug": { "extensions": [".jade",".pug"] },
45
+ "RAML": { "extensions": [".raml"] },
46
+ "Rich Text Format": { "extensions": [".rtf"] },
47
+ "Riot": { "extensions": [".riot"] },
48
+ "Roff": {
49
+ "extensions": [
50
+ ".1", ".1in", ".1m", ".1x", ".2", ".3", ".3in", ".3m", ".3p", ".3pm", ".3qt", ".3x", ".4", ".5", ".6", ".7", ".8",
51
+ ".9", ".l", ".man", ".mdoc", ".me", ".ms", ".n", ".nr", ".rno", ".roff", ".tmac"
52
+ ]
53
+ },
54
+ "Roff Manpage": {
55
+ "extensions": [
56
+ ".1", ".1in", ".1m", ".1x", ".2", ".3", ".3in", ".3m", ".3p", ".3pm", ".3qt", ".3x", ".4", ".5", ".6", ".7", ".8",
57
+ ".9", ".man", ".mdoc"
58
+ ]
59
+ },
60
+ "RUNOFF": { "extensions": [".rnh",".rno"] },
61
+ "Sass": { "extensions": [".sass"] },
62
+ "Scaml": { "extensions": [".scaml"] },
63
+ "SCSS": { "extensions": [".scss"] },
64
+ "Slim": { "extensions": [".slim"] },
65
+ "Slint": { "extensions": [".slint"] },
66
+ "SRecode Template": { "extensions": [".srt"] },
67
+ "StringTemplate": { "extensions": [".st"] },
68
+ "Stylus": { "extensions": [".styl"] },
69
+ "SugarSS": { "extensions": [".sss"] },
70
+ "Svelte": { "extensions": [".svelte"] },
71
+ "Tea": { "extensions": [".tea"] },
72
+ "templ": { "extensions": [".templ"] },
73
+ "Terraform Template": { "extensions": [".tftpl"] },
74
+ "TeX": {
75
+ "extensions": [".aux",".bbx",".cbx",".cls",".dtx",".ins",".lbx",".ltx",".mkii",".mkiv",".mkvi",".sty",".tex",".toc"]
76
+ },
77
+ "Twig": { "extensions": [".twig"] },
78
+ "Velocity Template Language": { "extensions": [".vtl"] },
79
+ "Vento": { "extensions": [".vto"] },
80
+ "Vim Snippet": { "extensions": [".snip",".snippet",".snippets"] },
81
+ "Vue": { "extensions": [".vue"] },
82
+ "YASnippet": { "extensions": [".yasnippet"] }
83
+ }
@@ -0,0 +1,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: markup-languages
3
+ Version: 1.0.0
4
+ Summary: File extensions for markup languages.
5
+ Author-email: Adam Lui <adam@kudoai.com>
6
+ License-Expression: MIT
7
+ Project-URL: Changelog, https://github.com/adamlui/python-utils/releases/tag/markup-languages-1.0.0
8
+ Project-URL: Documentation, https://github.com/adamlui/python-utils/tree/main/markup-languages/docs
9
+ Project-URL: Funding, https://github.com/sponsors/adamlui
10
+ Project-URL: Homepage, https://github.com/adamlui/python-utils/tree/main/markup-languages/#readme
11
+ Project-URL: Issues, https://github.com/adamlui/python-utils/issues
12
+ Project-URL: PyPI Stats, https://pepy.tech/projects/markup-languages
13
+ Project-URL: Releases, https://github.com/adamlui/python-utils/releases
14
+ Project-URL: Repository, https://github.com/adamlui/python-utils
15
+ Keywords: computer-languages,css,extensions,file-extensions,file‑type-detection,filenames,github,html,language-detection,languages,linguist,markup-languages,syntax-highlighting,xml
16
+ Classifier: Development Status :: 5 - Production/Stable
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Intended Audience :: Education
19
+ Classifier: Intended Audience :: Information Technology
20
+ Classifier: Intended Audience :: Science/Research
21
+ Classifier: Intended Audience :: System Administrators
22
+ Classifier: Natural Language :: English
23
+ Classifier: Operating System :: OS Independent
24
+ Classifier: Programming Language :: Python
25
+ Classifier: Programming Language :: Python :: 2
26
+ Classifier: Programming Language :: Python :: 2.6
27
+ Classifier: Programming Language :: Python :: 2.7
28
+ Classifier: Programming Language :: Python :: 3
29
+ Classifier: Programming Language :: Python :: 3.8
30
+ Classifier: Programming Language :: Python :: 3.9
31
+ Classifier: Programming Language :: Python :: 3.10
32
+ Classifier: Programming Language :: Python :: 3.11
33
+ Classifier: Programming Language :: Python :: 3.12
34
+ Classifier: Programming Language :: Python :: 3.13
35
+ Classifier: Programming Language :: Python :: 3.14
36
+ Classifier: Programming Language :: Python :: 3.15
37
+ Classifier: Topic :: Education
38
+ Classifier: Topic :: Software Development
39
+ Classifier: Topic :: Software Development :: Libraries
40
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
41
+ Classifier: Topic :: Text Processing
42
+ Classifier: Topic :: Text Processing :: Markup
43
+ Classifier: Topic :: Utilities
44
+ Requires-Python: <4,>=2.6
45
+ Description-Content-Type: text/markdown
46
+ License-File: docs/LICENSE.md
47
+ Provides-Extra: dev
48
+ Requires-Dist: nox>=2026.2.9; extra == "dev"
49
+ Requires-Dist: tomli~=2.4.0; extra == "dev"
50
+ Requires-Dist: tomli-w~=1.2.0; extra == "dev"
51
+ Dynamic: license-file
52
+
53
+ <a id="top"></a>
54
+
55
+ # > markup-languages
56
+
57
+ <a href="https://github.com/adamlui/python-utils/releases/tag/markup-languages-1.0.0">
58
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-1.0.0-32fcee.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
59
+ <a href="https://github.com/adamlui/python-utils/blob/main/markup-languages/docs/LICENSE.md">
60
+ <img height=31 src="https://img.shields.io/badge/License-MIT-f99b27.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
61
+ <a href="https://www.codefactor.io/repository/github/adamlui/python-utils">
62
+ <img height=31 src="https://img.shields.io/codefactor/grade/github/adamlui/python-utils?label=Code+Quality&logo=codefactor&logoColor=white&labelColor=464646&color=a0fc55&style=for-the-badge"></a>
63
+ <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_python-utils">
64
+ <img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_python-utils%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=fafc74"></a>
65
+
66
+ > ### _File extensions for markup languages._
67
+
68
+ It's just a [JSON file](https://github.com/adamlui/python-utils/blob/markup-languages-1.0.0/markup-languages/src/markup_languages/markup_languages.json), so you can use it in any environment. Sourced from GitHub's [Linguist](https://github.com/github-linguist/linguist) project (defines all markdown languages known to GitHub). Data is updated via script and released via new package version.
69
+
70
+ ## Installation
71
+
72
+ ```bash
73
+ pip install markup-languages
74
+ ```
75
+
76
+ ## Usage
77
+
78
+ ```py
79
+ import markup_languages
80
+
81
+ html_data = markup_languages['HTML']
82
+
83
+ print(html_data['extensions']) # => ['.hta', '.htm', '.html', '.html.hl', ...]
84
+ ```
85
+
86
+ _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`.
87
+
88
+ ## Examples
89
+
90
+ Get language from an extension:
91
+
92
+ ```py
93
+ def get_lang(file_ext):
94
+ for lang, data in markup_languages.items():
95
+ if file_ext in data['extensions']:
96
+ return lang
97
+
98
+ print(get_lang('.sss')) # => 'SugarSS'
99
+ ```
100
+
101
+ Get language from a file path:
102
+
103
+ ```py
104
+ def get_lang_from_path(filepath):
105
+ from pathlib import Path
106
+ file_ext = Path(filepath).suffix
107
+ for lang, data in markup_languages.items():
108
+ if file_ext in data['extensions']:
109
+ return lang
110
+
111
+ print(get_lang_from_path('index.html')) # => 'HTML'
112
+ print(get_lang_from_path('style.css')) # => 'CSS'
113
+ print(get_lang_from_path('script.js')) # => None (use programming-languages pkg)
114
+ ```
115
+
116
+ ## MIT License
117
+
118
+ Copyright © 2026 [Adam Lui](https://github.com/adamlui).
119
+
120
+ ## Related
121
+
122
+ 🇨🇳 [non-latin-locales](https://github.com/adamlui/python-utils/tree/main/non-latin-locales/#readme) - ISO 639-1 (2-letter) codes for non-Latin locales.
123
+ <br></> [programming-languages](https://github.com/adamlui/python-utils/tree/main/programming-languages/#readme) - File extensions for programming languages.
124
+ <br>🏷️ [project-markers](https://github.com/adamlui/python-utils/tree/main/project-markers/#readme) - Common project root markers.
125
+
126
+ #
127
+
128
+ <a href="#top">Back to top ↑</a>
@@ -0,0 +1,11 @@
1
+ pyproject.toml
2
+ setup.cfg
3
+ docs/LICENSE.md
4
+ docs/README.md
5
+ src/markup_languages/__init__.py
6
+ src/markup_languages/markup_languages.json
7
+ src/markup_languages.egg-info/PKG-INFO
8
+ src/markup_languages.egg-info/SOURCES.txt
9
+ src/markup_languages.egg-info/dependency_links.txt
10
+ src/markup_languages.egg-info/requires.txt
11
+ src/markup_languages.egg-info/top_level.txt
@@ -0,0 +1,5 @@
1
+
2
+ [dev]
3
+ nox>=2026.2.9
4
+ tomli~=2.4.0
5
+ tomli-w~=1.2.0
@@ -0,0 +1 @@
1
+ markup_languages