typecode


Nametypecode JSON
Version 30.0.2 PyPI version JSON
download
home_pagehttps://github.com/nexB/typecode
SummaryComprehensive filetype and mimetype detection using libmagic and Pygments.
upload_time2024-08-07 02:23:34
maintainerNone
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": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "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/d6/ca/c93584110e501e579e8901c9ad0c5db60dc69e84dfaf2224d5f95fca067b/typecode-30.0.2.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.2",
    "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": "a13c6d135ccbbf42230d3bef43bc052fd6993171a71ce1ec868c2581d8f930ab",
                "md5": "ab90ad6c726f6bef0c09eada541b3152",
                "sha256": "06b1bffa93525acf4b6a52393fd0ee20916f62ddd40c0f2d27ca75a08231a46c"
            },
            "downloads": -1,
            "filename": "typecode-30.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ab90ad6c726f6bef0c09eada541b3152",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 1027426,
            "upload_time": "2024-08-07T02:23:31",
            "upload_time_iso_8601": "2024-08-07T02:23:31.849138Z",
            "url": "https://files.pythonhosted.org/packages/a1/3c/6d135ccbbf42230d3bef43bc052fd6993171a71ce1ec868c2581d8f930ab/typecode-30.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d6cac93584110e501e579e8901c9ad0c5db60dc69e84dfaf2224d5f95fca067b",
                "md5": "e1c9b01c020cdeabc625575ba804d250",
                "sha256": "17689d20af0ae6116e797ef2c5de65f0ce809128cf0e68479b34bd6ba4bc3898"
            },
            "downloads": -1,
            "filename": "typecode-30.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e1c9b01c020cdeabc625575ba804d250",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 3863273,
            "upload_time": "2024-08-07T02:23:34",
            "upload_time_iso_8601": "2024-08-07T02:23:34.069774Z",
            "url": "https://files.pythonhosted.org/packages/d6/ca/c93584110e501e579e8901c9ad0c5db60dc69e84dfaf2224d5f95fca067b/typecode-30.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-07 02:23:34",
    "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.34152s