typecode


Nametypecode JSON
Version 30.0.1 PyPI version JSON
download
home_pagehttps://github.com/nexB/typecode
SummaryComprehensive filetype and mimetype detection using libmagic and Pygments.
upload_time2023-05-23 00:28:32
maintainer
docs_urlNone
authornexB. Inc. and others
requires_python>=3.7
licenseApache-2.0
keywords open source filetype mimetype libmagic scancode-toolkit typecode utilities
VCS
bugtrack_url
requirements attrs banal beautifulsoup4 binaryornot boolean.py certifi cffi chardet charset-normalizer click colorama commoncode construct container-inspector cryptography debian-inspector dockerfile-parse dparse2 extractcode extractcode-7z extractcode-libarchive fasteners fingerprints ftfy future gemfileparser html5lib idna importlib-metadata inflection intbitset isodate jaraco.functools javaproperties Jinja2 jsonstreams license-expression lxml MarkupSafe more-itertools normality packagedcode-msitools packageurl-python packaging parameter-expansion-patched patch pdfminer-six pefile pip-requirements-parser pkginfo2 pluggy plugincode ply publicsuffix2 pyahocorasick pycparser pygmars Pygments pymaven-patch pyparsing pytz PyYAML rdflib regipy requests rpm-inspector-rpm saneyaml six soupsieve spdx-tools text-unidecode toml typecode-libmagic urllib3 urlpy wcwidth webencodings xmltodict zipp
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ========
TypeCode
========

- license: Apache-2.0
- copyright: copyright (c) nexB. Inc. and others
- homepage_url: https://github.com/nexB/typecode
- keywords: filetype, mimetype, libmagic, scancode-toolkit, typecode

TypeCode provides comprehensive filetype and mimetype detection using multiple
detectors including libmagic (included as a dependency for Linux, Windows and
macOS) and Pygments. It started as library in scancode-toolkit.
Visit https://aboutcode.org and https://github.com/nexB/ for support and download.


We run CI tests on:

 - Travis https://travis-ci.org/github/nexB/typecode
 - Azure pipelines https://dev.azure.com/nexB/typecode/_build

To install this package with its full capability (where the binaries for
libmagic are installed), use the `full` option::

    pip install typecode[full]

If you want to use the version of libmagic (possibly) provided by your operating
system, use the `minimal` option::

    pip install typecode

In this case, you will need to provide a working libmagic and its database
available in one of these ways:

- **a typecode-libmagic plugin**: See the standard ones at 
  https://github.com/nexB/scancode-plugins/tree/main/builtins
  These can either bundle a libmagic library and its magic database or expose a
  system-installed libmagic.
  They do so by providing a plugin entry point as a ``scancode_location_provider``
  for ``typecode_libmagic`` which points to a callable that must return a mapping
  with these two keys:

    - 'typecode.libmagic.dll': the absolute path to a libmagic DLL
    - 'typecode.libmagic.db': the absolute path to a libmagic 'magic.mgc' database

  See for example:

    - https://github.com/nexB/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/typecode_libmagic-linux/setup.py#L42
    - https://github.com/nexB/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/typecode_libmagic-linux/src/typecode_libmagic/__init__.py#L32

- **environment variables**:

  - TYPECODE_LIBMAGIC_PATH: the absolute path to a libmagic DLL
  - TYPECODE_LIBMAGIC_DB_PATH: the absolute path to a libmagic 'magic.mgc' database

- **a system-installed libmagic and its database availale in the system PATH**:


The supported libmagic version is 5.39.


To set up the development environment::

    source configure --dev

To run unit tests::

    pytest -vvs -n 2

To clean up development environment::

    ./configure --clean


To update Pygment to a newer vendored version use vendy:

  - Update the version of pygments in ``pyproject.toml``
  - Run ``vendy``
  - Update the src/typecpde/pygments_lexers_mapping.py
    and src/typecode/pygments_lexers.py scripts accordingly, including their
    ABOUT files


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nexB/typecode",
    "name": "typecode",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "open source,filetype,mimetype,libmagic,scancode-toolkit,typecode,utilities",
    "author": "nexB. Inc. and others",
    "author_email": "info@aboutcode.org",
    "download_url": "https://files.pythonhosted.org/packages/82/05/b0c0c8248dc90d9f700ba9608e7be7860e6789515ca509a52abb7590a942/typecode-30.0.1.tar.gz",
    "platform": null,
    "description": "========\nTypeCode\n========\n\n- license: Apache-2.0\n- copyright: copyright (c) nexB. Inc. and others\n- homepage_url: https://github.com/nexB/typecode\n- keywords: filetype, mimetype, libmagic, scancode-toolkit, typecode\n\nTypeCode provides comprehensive filetype and mimetype detection using multiple\ndetectors including libmagic (included as a dependency for Linux, Windows and\nmacOS) and Pygments. It started as library in scancode-toolkit.\nVisit https://aboutcode.org and https://github.com/nexB/ for support and download.\n\n\nWe run CI tests on:\n\n - Travis https://travis-ci.org/github/nexB/typecode\n - Azure pipelines https://dev.azure.com/nexB/typecode/_build\n\nTo install this package with its full capability (where the binaries for\nlibmagic are installed), use the `full` option::\n\n    pip install typecode[full]\n\nIf you want to use the version of libmagic (possibly) provided by your operating\nsystem, use the `minimal` option::\n\n    pip install typecode\n\nIn this case, you will need to provide a working libmagic and its database\navailable in one of these ways:\n\n- **a typecode-libmagic plugin**: See the standard ones at \n  https://github.com/nexB/scancode-plugins/tree/main/builtins\n  These can either bundle a libmagic library and its magic database or expose a\n  system-installed libmagic.\n  They do so by providing a plugin entry point as a ``scancode_location_provider``\n  for ``typecode_libmagic`` which points to a callable that must return a mapping\n  with these two keys:\n\n    - 'typecode.libmagic.dll': the absolute path to a libmagic DLL\n    - 'typecode.libmagic.db': the absolute path to a libmagic 'magic.mgc' database\n\n  See for example:\n\n    - https://github.com/nexB/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/typecode_libmagic-linux/setup.py#L42\n    - https://github.com/nexB/scancode-plugins/blob/4da5fe8a5ab1c87b9b4af9e54d7ad60e289747f5/builtins/typecode_libmagic-linux/src/typecode_libmagic/__init__.py#L32\n\n- **environment variables**:\n\n  - TYPECODE_LIBMAGIC_PATH: the absolute path to a libmagic DLL\n  - TYPECODE_LIBMAGIC_DB_PATH: the absolute path to a libmagic 'magic.mgc' database\n\n- **a system-installed libmagic and its database availale in the system PATH**:\n\n\nThe supported libmagic version is 5.39.\n\n\nTo set up the development environment::\n\n    source configure --dev\n\nTo run unit tests::\n\n    pytest -vvs -n 2\n\nTo clean up development environment::\n\n    ./configure --clean\n\n\nTo update Pygment to a newer vendored version use vendy:\n\n  - Update the version of pygments in ``pyproject.toml``\n  - Run ``vendy``\n  - Update the src/typecpde/pygments_lexers_mapping.py\n    and src/typecode/pygments_lexers.py scripts accordingly, including their\n    ABOUT files\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Comprehensive filetype and mimetype detection using libmagic and Pygments.",
    "version": "30.0.1",
    "project_urls": {
        "Homepage": "https://github.com/nexB/typecode"
    },
    "split_keywords": [
        "open source",
        "filetype",
        "mimetype",
        "libmagic",
        "scancode-toolkit",
        "typecode",
        "utilities"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a99e37c3f06e97ea9a6eae9c68c3a1faa3c1a962b41098bb9df3797e79b5c66c",
                "md5": "dd51e095449a2a6cd0d6746ae905ef56",
                "sha256": "05ccbacf89a51ec0451a5b04ad2835c94a9a82c24b5d0b16670208d4eaabe0c1"
            },
            "downloads": -1,
            "filename": "typecode-30.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dd51e095449a2a6cd0d6746ae905ef56",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 1027386,
            "upload_time": "2023-05-23T00:28:30",
            "upload_time_iso_8601": "2023-05-23T00:28:30.932395Z",
            "url": "https://files.pythonhosted.org/packages/a9/9e/37c3f06e97ea9a6eae9c68c3a1faa3c1a962b41098bb9df3797e79b5c66c/typecode-30.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8205b0c0c8248dc90d9f700ba9608e7be7860e6789515ca509a52abb7590a942",
                "md5": "befb0c6baabc34b5d42ae7e61dacc562",
                "sha256": "1a57394224d5afffdebb299e353c4637e15568e11ae9c5311c6c86a3d6d0ac97"
            },
            "downloads": -1,
            "filename": "typecode-30.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "befb0c6baabc34b5d42ae7e61dacc562",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 3862751,
            "upload_time": "2023-05-23T00:28:32",
            "upload_time_iso_8601": "2023-05-23T00:28:32.682927Z",
            "url": "https://files.pythonhosted.org/packages/82/05/b0c0c8248dc90d9f700ba9608e7be7860e6789515ca509a52abb7590a942/typecode-30.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-23 00:28:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nexB",
    "github_project": "typecode",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "appveyor": true,
    "requirements": [
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "21.4.0"
                ]
            ]
        },
        {
            "name": "banal",
            "specs": [
                [
                    "==",
                    "1.0.6"
                ]
            ]
        },
        {
            "name": "beautifulsoup4",
            "specs": [
                [
                    "==",
                    "4.11.1"
                ]
            ]
        },
        {
            "name": "binaryornot",
            "specs": [
                [
                    "==",
                    "0.4.4"
                ]
            ]
        },
        {
            "name": "boolean.py",
            "specs": [
                [
                    "==",
                    "3.8"
                ]
            ]
        },
        {
            "name": "certifi",
            "specs": [
                [
                    "==",
                    "2021.10.8"
                ]
            ]
        },
        {
            "name": "cffi",
            "specs": [
                [
                    "==",
                    "1.15.0"
                ]
            ]
        },
        {
            "name": "chardet",
            "specs": [
                [
                    "==",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "charset-normalizer",
            "specs": [
                [
                    "==",
                    "2.0.12"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    "==",
                    "8.0.4"
                ]
            ]
        },
        {
            "name": "colorama",
            "specs": [
                [
                    "==",
                    "0.4.4"
                ]
            ]
        },
        {
            "name": "commoncode",
            "specs": [
                [
                    "==",
                    "30.2.0"
                ]
            ]
        },
        {
            "name": "construct",
            "specs": [
                [
                    "==",
                    "2.10.68"
                ]
            ]
        },
        {
            "name": "container-inspector",
            "specs": [
                [
                    "==",
                    "31.0.0"
                ]
            ]
        },
        {
            "name": "cryptography",
            "specs": [
                [
                    "==",
                    "36.0.2"
                ]
            ]
        },
        {
            "name": "debian-inspector",
            "specs": [
                [
                    "==",
                    "30.0.0"
                ]
            ]
        },
        {
            "name": "dockerfile-parse",
            "specs": [
                [
                    "==",
                    "1.2.0"
                ]
            ]
        },
        {
            "name": "dparse2",
            "specs": [
                [
                    "==",
                    "0.6.1"
                ]
            ]
        },
        {
            "name": "extractcode",
            "specs": [
                [
                    "==",
                    "31.0.0"
                ]
            ]
        },
        {
            "name": "extractcode-7z",
            "specs": [
                [
                    "==",
                    "16.5.210531"
                ]
            ]
        },
        {
            "name": "extractcode-libarchive",
            "specs": [
                [
                    "==",
                    "3.5.1.210531"
                ]
            ]
        },
        {
            "name": "fasteners",
            "specs": [
                [
                    "==",
                    "0.17.3"
                ]
            ]
        },
        {
            "name": "fingerprints",
            "specs": [
                [
                    "==",
                    "1.0.3"
                ]
            ]
        },
        {
            "name": "ftfy",
            "specs": [
                [
                    "==",
                    "6.0.3"
                ]
            ]
        },
        {
            "name": "future",
            "specs": [
                [
                    "==",
                    "0.18.2"
                ]
            ]
        },
        {
            "name": "gemfileparser",
            "specs": [
                [
                    "==",
                    "0.8.0"
                ]
            ]
        },
        {
            "name": "html5lib",
            "specs": [
                [
                    "==",
                    "1.1"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.3"
                ]
            ]
        },
        {
            "name": "importlib-metadata",
            "specs": [
                [
                    "==",
                    "4.8.3"
                ]
            ]
        },
        {
            "name": "inflection",
            "specs": [
                [
                    "==",
                    "0.5.1"
                ]
            ]
        },
        {
            "name": "intbitset",
            "specs": [
                [
                    "==",
                    "3.0.2"
                ]
            ]
        },
        {
            "name": "isodate",
            "specs": [
                [
                    "==",
                    "0.6.1"
                ]
            ]
        },
        {
            "name": "jaraco.functools",
            "specs": [
                [
                    "==",
                    "3.4.0"
                ]
            ]
        },
        {
            "name": "javaproperties",
            "specs": [
                [
                    "==",
                    "0.8.1"
                ]
            ]
        },
        {
            "name": "Jinja2",
            "specs": [
                [
                    "==",
                    "3.0.3"
                ]
            ]
        },
        {
            "name": "jsonstreams",
            "specs": [
                [
                    "==",
                    "0.6.0"
                ]
            ]
        },
        {
            "name": "license-expression",
            "specs": [
                [
                    "==",
                    "21.6.14"
                ]
            ]
        },
        {
            "name": "lxml",
            "specs": [
                [
                    "==",
                    "4.8.0"
                ]
            ]
        },
        {
            "name": "MarkupSafe",
            "specs": [
                [
                    "==",
                    "2.0.1"
                ]
            ]
        },
        {
            "name": "more-itertools",
            "specs": [
                [
                    "==",
                    "8.13.0"
                ]
            ]
        },
        {
            "name": "normality",
            "specs": [
                [
                    "==",
                    "2.3.3"
                ]
            ]
        },
        {
            "name": "packagedcode-msitools",
            "specs": [
                [
                    "==",
                    "0.101.210706"
                ]
            ]
        },
        {
            "name": "packageurl-python",
            "specs": [
                [
                    "==",
                    "0.9.9"
                ]
            ]
        },
        {
            "name": "packaging",
            "specs": [
                [
                    "==",
                    "21.3"
                ]
            ]
        },
        {
            "name": "parameter-expansion-patched",
            "specs": [
                [
                    "==",
                    "0.3.1"
                ]
            ]
        },
        {
            "name": "patch",
            "specs": [
                [
                    "==",
                    "1.16"
                ]
            ]
        },
        {
            "name": "pdfminer-six",
            "specs": [
                [
                    "==",
                    "20220506"
                ]
            ]
        },
        {
            "name": "pefile",
            "specs": [
                [
                    "==",
                    "2021.9.3"
                ]
            ]
        },
        {
            "name": "pip-requirements-parser",
            "specs": [
                [
                    "==",
                    "31.2.0"
                ]
            ]
        },
        {
            "name": "pkginfo2",
            "specs": [
                [
                    "==",
                    "30.0.0"
                ]
            ]
        },
        {
            "name": "pluggy",
            "specs": [
                [
                    "==",
                    "1.0.0"
                ]
            ]
        },
        {
            "name": "plugincode",
            "specs": [
                [
                    "==",
                    "30.0.0"
                ]
            ]
        },
        {
            "name": "ply",
            "specs": [
                [
                    "==",
                    "3.11"
                ]
            ]
        },
        {
            "name": "publicsuffix2",
            "specs": [
                [
                    "==",
                    "2.20191221"
                ]
            ]
        },
        {
            "name": "pyahocorasick",
            "specs": [
                [
                    "==",
                    "2.0.0b1"
                ]
            ]
        },
        {
            "name": "pycparser",
            "specs": [
                [
                    "==",
                    "2.21"
                ]
            ]
        },
        {
            "name": "pygmars",
            "specs": [
                [
                    "==",
                    "0.7.0"
                ]
            ]
        },
        {
            "name": "Pygments",
            "specs": [
                [
                    "==",
                    "2.12.0"
                ]
            ]
        },
        {
            "name": "pymaven-patch",
            "specs": [
                [
                    "==",
                    "0.3.0"
                ]
            ]
        },
        {
            "name": "pyparsing",
            "specs": [
                [
                    "==",
                    "3.0.8"
                ]
            ]
        },
        {
            "name": "pytz",
            "specs": [
                [
                    "==",
                    "2022.1"
                ]
            ]
        },
        {
            "name": "PyYAML",
            "specs": [
                [
                    "==",
                    "6.0"
                ]
            ]
        },
        {
            "name": "rdflib",
            "specs": [
                [
                    "==",
                    "5.0.0"
                ]
            ]
        },
        {
            "name": "regipy",
            "specs": [
                [
                    "==",
                    "2.3.1"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    "==",
                    "2.27.1"
                ]
            ]
        },
        {
            "name": "rpm-inspector-rpm",
            "specs": [
                [
                    "==",
                    "4.16.1.3.210404"
                ]
            ]
        },
        {
            "name": "saneyaml",
            "specs": [
                [
                    "==",
                    "0.5.2"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "soupsieve",
            "specs": [
                [
                    "==",
                    "2.3.1"
                ]
            ]
        },
        {
            "name": "spdx-tools",
            "specs": [
                [
                    "==",
                    "0.7.0a3"
                ]
            ]
        },
        {
            "name": "text-unidecode",
            "specs": [
                [
                    "==",
                    "1.3"
                ]
            ]
        },
        {
            "name": "toml",
            "specs": [
                [
                    "==",
                    "0.10.2"
                ]
            ]
        },
        {
            "name": "typecode-libmagic",
            "specs": [
                [
                    "==",
                    "5.39.210531"
                ]
            ]
        },
        {
            "name": "urllib3",
            "specs": [
                [
                    "==",
                    "1.26.9"
                ]
            ]
        },
        {
            "name": "urlpy",
            "specs": [
                [
                    "==",
                    "0.5"
                ]
            ]
        },
        {
            "name": "wcwidth",
            "specs": [
                [
                    "==",
                    "0.2.5"
                ]
            ]
        },
        {
            "name": "webencodings",
            "specs": [
                [
                    "==",
                    "0.5.1"
                ]
            ]
        },
        {
            "name": "xmltodict",
            "specs": [
                [
                    "==",
                    "0.12.0"
                ]
            ]
        },
        {
            "name": "zipp",
            "specs": [
                [
                    "==",
                    "3.6.0"
                ]
            ]
        }
    ],
    "lcname": "typecode"
}
        
Elapsed time: 0.06979s