Skip to main content

Comprehensive filetype and mimetype detection using libmagic and Pygments.

Project description

  • 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:

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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

typecode-30.0.1.tar.gz (3.9 MB view details)

Uploaded Source

Built Distribution

typecode-30.0.1-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file typecode-30.0.1.tar.gz.

File metadata

  • Download URL: typecode-30.0.1.tar.gz
  • Upload date:
  • Size: 3.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for typecode-30.0.1.tar.gz
Algorithm Hash digest
SHA256 1a57394224d5afffdebb299e353c4637e15568e11ae9c5311c6c86a3d6d0ac97
MD5 befb0c6baabc34b5d42ae7e61dacc562
BLAKE2b-256 8205b0c0c8248dc90d9f700ba9608e7be7860e6789515ca509a52abb7590a942

See more details on using hashes here.

Provenance

File details

Details for the file typecode-30.0.1-py3-none-any.whl.

File metadata

  • Download URL: typecode-30.0.1-py3-none-any.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for typecode-30.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 05ccbacf89a51ec0451a5b04ad2835c94a9a82c24b5d0b16670208d4eaabe0c1
MD5 dd51e095449a2a6cd0d6746ae905ef56
BLAKE2b-256 a99e37c3f06e97ea9a6eae9c68c3a1faa3c1a962b41098bb9df3797e79b5c66c

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page