Skip to main content

💻 computer-languages

File extensions for computer languages.

It's just a JSON file, so you can use it in any environment. Sourced from GitHub's Linguist project (defines all 700+ languages known to GitHub). Data is updated via script and released via new package version.

Installation

pip install computer-languages

Usage

import computer_languages

py_lang_data = computer_languages['Python']

print(py_lang_data['type']) # => programming
print(py_lang_data['extensions']) # => ['.cgi', '.fcgi', '.gyp', ...]

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.


Examples

Get extension(s) for a language:

js_exts = computer_languages['JavaScript']['extensions']

print(js_exts) # => ['._js', '.bones', '.cjs', '.es', ...]

Get language(s) from an extension:

def get_lang(file_ext):
    lang_matches = [
        lang for lang, data in computer_languages.items()
            if file_ext in data['extensions']
    ]
    return lang_matches[0] if len(lang_matches) == 1 else lang_matches

print(get_lang('.rs')) # => ['RenderScript', 'Rust', 'XML']

Filter by language type:

markup_langs = [
    lang for lang, data in computer_languages.items()
        if data['type'] == 'markup'
]

print(markup_langs) # => ['Antlers', 'API Blueprint', 'Astro', 'BibTeX', ...]
print(f'{len(markup_langs)} markup languages') # -> 69 markup languages

MIT License

Copyright © 2026 Adam Lui


Related

</> markup-languages - File extensions for markup languages.
## prose-languages - File extensions for prose languages.
{ } data-languages - File extensions for data languages.
#! programming-languages - File extensions for programming languages.

More Python utilities / Discuss / Report bug / Report vulnerability / Back to top ↑

Metadata

Release files for computer-languages 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for computer-languages 1.1.0
File Size Uploaded
computer_languages-1.1.0.tar.gz 18.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for computer-languages 1.1.0
File Interpreter ABI Platform
computer_languages-1.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 33.9 kB

Release files / computer_languages-1.1.0.tar.gz

Download URL computer_languages-1.1.0.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
783bc643e91c085c069a9ddf7fef12f120d2e7f7d8832d14cf104a63ebf8de8a
BLAKE2b-256 checksum
How to use checksums
4b1759b1614cfcb007016e9d9c2218f2addb35b3387849071961ed292a0caf28
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 May 10, 2026.

Transparency log

Release files / computer_languages-1.1.0-py2.py3-none-any.whl

Download URL computer_languages-1.1.0-py2.py3-none-any.whl
Size 15.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
847a0212a08edcb3c4584562d297971fffff7581517668418f3307b1d8c6e32a
BLAKE2b-256 checksum
How to use checksums
1bf31a21b2aeaa45d70def6b8208c3cd263d6808a9a04e1db0594b38b98d3b93
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 May 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page