Skip to main content

Python wrapper for libmagic

Project description

Coveralls Github Actions Latest Version https://img.shields.io/pypi/wheel/cmagic.svg https://img.shields.io/pypi/pyversions/cmagic.svg https://img.shields.io/pypi/l/cmagic.svg

Python wrapper for libmagic.

Usage

# MacOS
$ export MAGIC=/usr/local/Cellar/libmagic/5.39/share/misc/magic.mgc

# Ubuntu
$ export MAGIC=/usr/lib/file/magic.mgc
import cmagic

m = cmagic.Magic()

if m.check(cmagic.MAGIC_DB):
   print("Database is ok")

m.load()

m.guess_file("/bin/sh")
# 'ASCII text'

Installation

Ubuntu/Debian

apt-get install -y libmagic1 libmagic-mgc   # when using manilinux wheel
apt-get install -y libmagic-dev             # for building from sources
python3 -m pip install cmagic

Centos

yum install -y file-libs            # when using manilinux wheel
yum install -y file-devel           # for building from sources
python3 -m pip install cmagic

MacOS

brew install libmagic
python3 -m pip install cmagic

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

cmagic-0.3.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distributions

cmagic-0.3.0-cp38-cp38-manylinux2014_x86_64.whl (137.0 kB view details)

Uploaded CPython 3.8

cmagic-0.3.0-cp38-cp38-macosx_10_9_x86_64.whl (362.1 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

cmagic-0.3.0-cp37-cp37m-manylinux2014_x86_64.whl (138.7 kB view details)

Uploaded CPython 3.7m

cmagic-0.3.0-cp37-cp37m-macosx_10_9_x86_64.whl (362.0 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

cmagic-0.3.0-cp36-cp36m-manylinux2014_x86_64.whl (137.7 kB view details)

Uploaded CPython 3.6m

cmagic-0.3.0-cp36-cp36m-macosx_10_9_x86_64.whl (362.0 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

cmagic-0.3.0-cp35-cp35m-manylinux2014_x86_64.whl (137.4 kB view details)

Uploaded CPython 3.5m

cmagic-0.3.0-cp35-cp35m-macosx_10_6_intel.whl (364.8 kB view details)

Uploaded CPython 3.5m macOS 10.6+ intel

File details

Details for the file cmagic-0.3.0.tar.gz.

File metadata

  • Download URL: cmagic-0.3.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for cmagic-0.3.0.tar.gz
Algorithm Hash digest
SHA256 cca80439b323a5a558895707b3dfbd862aa420de1c83f4780aabe368bd289fc2
MD5 7ad858bff59e70cdac938158ab0a3244
BLAKE2b-256 6324f24c806b0dc131364151ada67e81b4d576336752cd03ce12130d1957ae14

See more details on using hashes here.

File details

Details for the file cmagic-0.3.0-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: cmagic-0.3.0-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 137.0 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for cmagic-0.3.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 19fdaa4f21e480fb7935a9915cf21ad0f6e32dd70bd4af25951e3e7925eb3e8a
MD5 7189dfb9cac63e21d9eeb921987bad74
BLAKE2b-256 aa1640289a93ed659ed38134c08ed681a9b91ed6003887a9efe0bb73b5dd60e6

See more details on using hashes here.

File details

Details for the file cmagic-0.3.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: cmagic-0.3.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 362.1 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for cmagic-0.3.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0828eab2944974e4a0f2e46a596f81f68e88e1f2f0ddbcf437f06c8a8a2a76fc
MD5 7f29225bc0e00f8e381063bd97bebd0a
BLAKE2b-256 551013a6b96881e5f77736cf89010eac19bc5f60efdd5b19f10b45c595d64418

See more details on using hashes here.

File details

Details for the file cmagic-0.3.0-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: cmagic-0.3.0-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 138.7 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for cmagic-0.3.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 018e5e70aae6766ce7e533d1002985575748f6ff95b743a130b16283a5abf383
MD5 542095960842315d77a3d17803df1aa7
BLAKE2b-256 5d52afb900fc9806b5b54d732d4e7f6894e4fb4fa17f41d43514ecd1633f8ab6

See more details on using hashes here.

File details

Details for the file cmagic-0.3.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: cmagic-0.3.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 362.0 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for cmagic-0.3.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 323599bbda9ad19d049ef2f966a1c3cbfd9c9c25349659d582412fc914c023fd
MD5 6f5773272b5ef7ff15e2f8f522cf5fac
BLAKE2b-256 157d4e5564478b65000a60b5a141fc5aa4fce822a8354ee876fe89a322b900a8

See more details on using hashes here.

File details

Details for the file cmagic-0.3.0-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: cmagic-0.3.0-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 137.7 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for cmagic-0.3.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3f5cf0bd2d54e5a0a34d85219bb75ae19fe7b04a75a8d1a0c3e08e63f9c727a5
MD5 a38f3d21389011a9f001c8d317e10d96
BLAKE2b-256 fa24a41477ef7c88303aa3bea975d25e975d70f7346f46cfbfce26bd506bedda

See more details on using hashes here.

File details

Details for the file cmagic-0.3.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: cmagic-0.3.0-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 362.0 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for cmagic-0.3.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7e3fcfda238e58a962aa8b738227a360d9323e851fcb50d3be159af6050783e5
MD5 52e496ef8d5e55198322a6aec3061f67
BLAKE2b-256 3b63bb67e08b1fab953095e4a5ddf9bd15dbf0a1ee824320e8d12f7cef57c3b9

See more details on using hashes here.

File details

Details for the file cmagic-0.3.0-cp35-cp35m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: cmagic-0.3.0-cp35-cp35m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 137.4 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for cmagic-0.3.0-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee2e44a3529120ef48ae971f99a3ff8001b7819bd81ff56cd91c64bf168b6c76
MD5 edb6e2e8eea0c1de8f2e3c108c679811
BLAKE2b-256 7d6afa0cf8e6f4531780e0fdd59c01b06537090067d82b9610dada560868c873

See more details on using hashes here.

File details

Details for the file cmagic-0.3.0-cp35-cp35m-macosx_10_6_intel.whl.

File metadata

  • Download URL: cmagic-0.3.0-cp35-cp35m-macosx_10_6_intel.whl
  • Upload date:
  • Size: 364.8 kB
  • Tags: CPython 3.5m, macOS 10.6+ intel
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for cmagic-0.3.0-cp35-cp35m-macosx_10_6_intel.whl
Algorithm Hash digest
SHA256 101770be7352ca80ec9eb2399015a14be54a9260f6e83f61d2e6878bd6db0b0f
MD5 385670a5d2a8537620f71dca4ab70978
BLAKE2b-256 a4173a0f049960dfacd01968134a226dddb221c3217e6c8fc9bea3ffb2b58a84

See more details on using hashes here.

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