{"id":16827101,"url":"https://github.com/jdkato/codetype","last_synced_at":"2025-08-22T22:09:19.535Z","repository":{"id":57417379,"uuid":"58241678","full_name":"jdkato/codetype","owner":"jdkato","description":":mag: A source code identification tool.","archived":false,"fork":false,"pushed_at":"2021-10-24T22:57:17.000Z","size":990,"stargazers_count":9,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-02T06:04:20.764Z","etag":null,"topics":["classification","code","identification","language"],"latest_commit_sha":null,"homepage":"https://jdkato.github.io/codetype/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdkato.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-07T00:18:57.000Z","updated_at":"2024-01-11T06:46:18.000Z","dependencies_parsed_at":"2022-08-30T04:11:19.052Z","dependency_job_id":null,"html_url":"https://github.com/jdkato/codetype","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkato%2Fcodetype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkato%2Fcodetype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkato%2Fcodetype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdkato%2Fcodetype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdkato","download_url":"https://codeload.github.com/jdkato/codetype/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339288,"owners_count":21087213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classification","code","identification","language"],"created_at":"2024-10-13T11:19:40.463Z","updated_at":"2025-04-11T03:43:22.028Z","avatar_url":"https://github.com/jdkato.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# codetype [![Build Status](https://travis-ci.org/jdkato/codetype.svg?branch=master)](https://travis-ci.org/jdkato/codetype) ![Python Support](https://img.shields.io/badge/python-2.7,3.4,3.5-blue.svg)\n\n`codetype` is a Python library and command-line tool for identifying the language of source code snippets and files. It's fast, simple and accurate. [You can test it out here](http://jdkato.github.io/codetype/).\n\nSee my [blog post](https://the57thpick.com/posts/codetype/) for more information.\n\n## Installation\n\n###### Using pip\n\n```\npip install codetype\n```\n\n###### From source\n\n```\n$ git clone https://github.com/jdkato/codetype.git\n$ cd codetype\n$ python setup.py install\n```\n\n## Usage\n\n###### Python\n\n```python\n\u003e\u003e\u003e from codetype import identify\n\u003e\u003e\u003e identify('fibs = 0 : 1 : zipWith (+) fibs (tail fibs)')\n'Haskell'\n\u003e\u003e\u003e identify('from math import fabs')\n'Python'\n\u003e\u003e\u003e src = \"\"\"\nclass HelloWorldApp {\n    public static void main(String[] args) {\n        System.out.println(\"Hello World!\");\n    }\n}\"\"\"\n\u003e\u003e\u003e identify(src)\n'Java'\n\u003e\u003e\u003e identify('/path/to/ruby/file.txt')\n'Ruby'\n```\n\n###### CLI\n\n```\nusage: codetype [-h] [--version] [-v] [-m MAX] [-o ONLY [ONLY ...]] file\n\nA source code identification tool.\n\npositional arguments:\n  file                  path to unknown source code\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n  -v, --verbose         use verbose output\n  -m MAX, --max MAX     max number of languages to return\n  -o ONLY [ONLY ...], --only ONLY [ONLY ...]\n                        test only the specified formats\n```\n\n## Language Support\n\nAppleScript, C#, C++, C, D, Go, Haskell, Java, JavaScript, Julia, Lua, OCaml, Objective-C, Perl, \nPHP, Python, R, Ruby, Rust, Scala \u0026 Swift\n\n## Testing\n\n```\n$ python run.py dev -t\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdkato%2Fcodetype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdkato%2Fcodetype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdkato%2Fcodetype/lists"}