computer-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,143 @@
1
+ Metadata-Version: 2.4
2
+ Name: computer-languages
3
+ Version: 1.0.0
4
+ Summary: File extensions for computer 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/computer-languages-1.0.0
8
+ Project-URL: Documentation, https://github.com/adamlui/python-utils/tree/main/computer-languages/docs
9
+ Project-URL: Funding, https://github.com/sponsors/adamlui
10
+ Project-URL: Homepage, https://github.com/adamlui/python-utils/tree/main/computer-languages/#readme
11
+ Project-URL: Issues, https://github.com/adamlui/python-utils/issues
12
+ Project-URL: PyPI Stats, https://pepy.tech/projects/computer-languages
13
+ Project-URL: Releases, https://github.com/adamlui/python-utils/releases
14
+ Project-URL: Repository, https://github.com/adamlui/python-utils
15
+ Keywords: asciidoc,bash,c,c#,c++,code-languages,computer-languages,csv,dart,data-languages,extensions,file‑type-detection,file-extensions,filenames,github,go,html,java,javascript,json,kotlin,language-detection,languages,linguist,markdown,markup-languages,php,powershell,programming-languages,prose-languages,python,ruby,rust,shell,sql,swift,syntax-highlighting,toml,typescript,xml,yaml
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 :: Database
38
+ Classifier: Topic :: Documentation
39
+ Classifier: Topic :: Education
40
+ Classifier: Topic :: Internet
41
+ Classifier: Topic :: Internet :: WWW/HTTP
42
+ Classifier: Topic :: Scientific/Engineering
43
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
44
+ Classifier: Topic :: Software Development
45
+ Classifier: Topic :: Software Development :: Libraries
46
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
47
+ Classifier: Topic :: Text Processing
48
+ Classifier: Topic :: Text Processing :: General
49
+ Classifier: Topic :: Text Processing :: Linguistic
50
+ Classifier: Topic :: Text Processing :: Markup
51
+ Classifier: Topic :: Utilities
52
+ Requires-Python: <4,>=2.6
53
+ Description-Content-Type: text/markdown
54
+ License-File: docs/LICENSE.md
55
+ Provides-Extra: dev
56
+ Requires-Dist: nox>=2026.2.9; extra == "dev"
57
+ Requires-Dist: tomli~=2.4.0; extra == "dev"
58
+ Requires-Dist: tomli-w~=1.2.0; extra == "dev"
59
+ Dynamic: license-file
60
+
61
+ <a id="top"></a>
62
+
63
+ # ⊕ computer-languages
64
+
65
+ <a href="https://github.com/adamlui/python-utils/releases/tag/computer-languages-1.0.0">
66
+ <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>
67
+ <a href="https://github.com/adamlui/python-utils/blob/main/computer-languages/docs/LICENSE.md">
68
+ <img height=31 src="https://img.shields.io/badge/License-MIT-f99b27.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
69
+ <a href="https://www.codefactor.io/repository/github/adamlui/python-utils">
70
+ <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>
71
+ <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_python-utils">
72
+ <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>
73
+
74
+ > ### _File extensions for computer languages._
75
+
76
+ It's just a [JSON file](https://github.com/adamlui/python-utils/blob/computer-languages-1.0.0/computer-languages/src/computer_languages/computer_languages.json), so you can use it in any environment. Sourced from GitHub's [Linguist](https://github.com/github-linguist/linguist) project (defines all 700+ languages known to GitHub). Data is updated via script and released via new package version.
77
+
78
+ ## Installation
79
+
80
+ ```bash
81
+ pip install computer-languages
82
+ ```
83
+
84
+ ## Usage
85
+
86
+ ```py
87
+ import computer_languages
88
+
89
+ py_lang_data = computer_languages['Python']
90
+
91
+ print(py_lang_data['type']) # => 'programming'
92
+ print(py_lang_data['extensions']) # => ['.cgi', '.fcgi', '.gyp', ...]
93
+ ```
94
+
95
+ _Note: Most type checkers will falsely warn_ `computer_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`.
96
+
97
+ ## Examples
98
+
99
+ List all extensions for a language:
100
+
101
+ ```py
102
+ js_exts = computer_languages['JavaScript']['extensions']
103
+
104
+ print(js_exts) # => ['._js', '.bones', '.cjs', '.es', ...]
105
+ ```
106
+
107
+ Get language from an extension:
108
+
109
+ ```py
110
+ def get_lang(file_ext):
111
+ for lang, data in computer_languages.items():
112
+ if file_ext in data['extensions']:
113
+ return lang
114
+
115
+ print(get_lang('.rs')) # => 'Rust'
116
+ ```
117
+
118
+ Filter by language type:
119
+
120
+ ```py
121
+ markup_langs = [
122
+ lang for lang, data in computer_languages.items()
123
+ if data['type'] == 'markup'
124
+ ]
125
+
126
+ print(markup_langs) # => ['Antlers', 'API Blueprint', 'Astro', 'BibTeX', ...]
127
+ print(f'{len(markup_langs)} markup languages') # -> '69 markup languages'
128
+ ```
129
+
130
+ ## MIT License
131
+
132
+ Copyright © 2026 [Adam Lui](https://github.com/adamlui).
133
+
134
+ ## Related
135
+
136
+ </> [markup-languages](https://github.com/adamlui/python-utils/tree/main/markup-languages/#readme) - File extensions for markup languages.
137
+ <br>## [prose-languages](https://github.com/adamlui/python-utils/tree/main/prose-languages/#readme) - File extensions for prose languages.
138
+ <br>{ } [data-languages](https://github.com/adamlui/python-utils/tree/main/data-languages/#readme) - File extensions for data languages.
139
+ <br>#! [programming-languages](https://github.com/adamlui/python-utils/tree/main/programming-languages/#readme) - File extensions for programming languages.
140
+
141
+ #
142
+
143
+ <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,83 @@
1
+ <a id="top"></a>
2
+
3
+ # ⊕ computer-languages
4
+
5
+ <a href="https://github.com/adamlui/python-utils/releases/tag/computer-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/computer-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 computer languages._
15
+
16
+ It's just a [JSON file](https://github.com/adamlui/python-utils/blob/computer-languages-1.0.0/computer-languages/src/computer_languages/computer_languages.json), so you can use it in any environment. Sourced from GitHub's [Linguist](https://github.com/github-linguist/linguist) project (defines all 700+ languages known to GitHub). Data is updated via script and released via new package version.
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pip install computer-languages
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```py
27
+ import computer_languages
28
+
29
+ py_lang_data = computer_languages['Python']
30
+
31
+ print(py_lang_data['type']) # => 'programming'
32
+ print(py_lang_data['extensions']) # => ['.cgi', '.fcgi', '.gyp', ...]
33
+ ```
34
+
35
+ _Note: Most type checkers will falsely warn_ `computer_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`.
36
+
37
+ ## Examples
38
+
39
+ List all extensions for a language:
40
+
41
+ ```py
42
+ js_exts = computer_languages['JavaScript']['extensions']
43
+
44
+ print(js_exts) # => ['._js', '.bones', '.cjs', '.es', ...]
45
+ ```
46
+
47
+ Get language from an extension:
48
+
49
+ ```py
50
+ def get_lang(file_ext):
51
+ for lang, data in computer_languages.items():
52
+ if file_ext in data['extensions']:
53
+ return lang
54
+
55
+ print(get_lang('.rs')) # => 'Rust'
56
+ ```
57
+
58
+ Filter by language type:
59
+
60
+ ```py
61
+ markup_langs = [
62
+ lang for lang, data in computer_languages.items()
63
+ if data['type'] == 'markup'
64
+ ]
65
+
66
+ print(markup_langs) # => ['Antlers', 'API Blueprint', 'Astro', 'BibTeX', ...]
67
+ print(f'{len(markup_langs)} markup languages') # -> '69 markup languages'
68
+ ```
69
+
70
+ ## MIT License
71
+
72
+ Copyright © 2026 [Adam Lui](https://github.com/adamlui).
73
+
74
+ ## Related
75
+
76
+ </> [markup-languages](https://github.com/adamlui/python-utils/tree/main/markup-languages/#readme) - File extensions for markup languages.
77
+ <br>## [prose-languages](https://github.com/adamlui/python-utils/tree/main/prose-languages/#readme) - File extensions for prose languages.
78
+ <br>{ } [data-languages](https://github.com/adamlui/python-utils/tree/main/data-languages/#readme) - File extensions for data languages.
79
+ <br>#! [programming-languages](https://github.com/adamlui/python-utils/tree/main/programming-languages/#readme) - File extensions for programming languages.
80
+
81
+ #
82
+
83
+ <a href="#top">Back to top ↑</a>
@@ -0,0 +1,128 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools~=82.0.0",
4
+ "wheel",
5
+ ]
6
+ build-backend = "setuptools.build_meta"
7
+
8
+ [project]
9
+ name = "computer-languages"
10
+ version = "1.0.0"
11
+ description = "File extensions for computer 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
+ "asciidoc",
23
+ "bash",
24
+ "c",
25
+ "c#",
26
+ "c++",
27
+ "code-languages",
28
+ "computer-languages",
29
+ "csv",
30
+ "dart",
31
+ "data-languages",
32
+ "extensions",
33
+ "file‑type-detection",
34
+ "file-extensions",
35
+ "filenames",
36
+ "github",
37
+ "go",
38
+ "html",
39
+ "java",
40
+ "javascript",
41
+ "json",
42
+ "kotlin",
43
+ "language-detection",
44
+ "languages",
45
+ "linguist",
46
+ "markdown",
47
+ "markup-languages",
48
+ "php",
49
+ "powershell",
50
+ "programming-languages",
51
+ "prose-languages",
52
+ "python",
53
+ "ruby",
54
+ "rust",
55
+ "shell",
56
+ "sql",
57
+ "swift",
58
+ "syntax-highlighting",
59
+ "toml",
60
+ "typescript",
61
+ "xml",
62
+ "yaml",
63
+ ]
64
+ classifiers = [
65
+ "Development Status :: 5 - Production/Stable",
66
+ "Intended Audience :: Developers",
67
+ "Intended Audience :: Education",
68
+ "Intended Audience :: Information Technology",
69
+ "Intended Audience :: Science/Research",
70
+ "Intended Audience :: System Administrators",
71
+ "Natural Language :: English",
72
+ "Operating System :: OS Independent",
73
+ "Programming Language :: Python",
74
+ "Programming Language :: Python :: 2",
75
+ "Programming Language :: Python :: 2.6",
76
+ "Programming Language :: Python :: 2.7",
77
+ "Programming Language :: Python :: 3",
78
+ "Programming Language :: Python :: 3.8",
79
+ "Programming Language :: Python :: 3.9",
80
+ "Programming Language :: Python :: 3.10",
81
+ "Programming Language :: Python :: 3.11",
82
+ "Programming Language :: Python :: 3.12",
83
+ "Programming Language :: Python :: 3.13",
84
+ "Programming Language :: Python :: 3.14",
85
+ "Programming Language :: Python :: 3.15",
86
+ "Topic :: Database",
87
+ "Topic :: Documentation",
88
+ "Topic :: Education",
89
+ "Topic :: Internet",
90
+ "Topic :: Internet :: WWW/HTTP",
91
+ "Topic :: Scientific/Engineering",
92
+ "Topic :: Scientific/Engineering :: Information Analysis",
93
+ "Topic :: Software Development",
94
+ "Topic :: Software Development :: Libraries",
95
+ "Topic :: Software Development :: Libraries :: Python Modules",
96
+ "Topic :: Text Processing",
97
+ "Topic :: Text Processing :: General",
98
+ "Topic :: Text Processing :: Linguistic",
99
+ "Topic :: Text Processing :: Markup",
100
+ "Topic :: Utilities",
101
+ ]
102
+
103
+ [project.urls]
104
+ Changelog = "https://github.com/adamlui/python-utils/releases/tag/computer-languages-1.0.0"
105
+ Documentation = "https://github.com/adamlui/python-utils/tree/main/computer-languages/docs"
106
+ Funding = "https://github.com/sponsors/adamlui"
107
+ Homepage = "https://github.com/adamlui/python-utils/tree/main/computer-languages/#readme"
108
+ Issues = "https://github.com/adamlui/python-utils/issues"
109
+ "PyPI Stats" = "https://pepy.tech/projects/computer-languages"
110
+ Releases = "https://github.com/adamlui/python-utils/releases"
111
+ Repository = "https://github.com/adamlui/python-utils"
112
+
113
+ [project.optional-dependencies]
114
+ dev = [
115
+ "nox>=2026.2.9",
116
+ "tomli~=2.4.0",
117
+ "tomli-w~=1.2.0",
118
+ ]
119
+
120
+ [tool.setuptools.packages.find]
121
+ where = [
122
+ "src",
123
+ ]
124
+
125
+ [tool.setuptools.package-data]
126
+ computer_languages = [
127
+ "computer_languages.json",
128
+ ]
@@ -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__), 'computer_languages.json')) as file:
4
+ computer_languages = json.load(file)
5
+
6
+ sys.modules[__name__] = computer_languages