Brew Python

Posted on  by admin
Latest version

Released:

File type identification using libmagic

Project description

Graph-tool is an efficient Python module for manipulation and statistical analysis of graphs (a.k.a. Contrary to most other Python modules with similar functionality, the core data structures and algorithms are implemented in C, making extensive use of template metaprogramming, based heavily on the Boost Graph Library. The Missing Package Manager for macOS (or Linux). It’s all Git and Ruby underneath, so hack away with the knowledge that you can easily revert your modifications and merge upstream updates.

python-magic is a Python interface to the libmagic file typeidentification library. libmagic identifies file types by checkingtheir headers according to a predefined list of file types. Thisfunctionality is exposed to the command line by the Unix commandfile.

Usage

There is also a Magic class that provides more direct control,including overriding the magic database file and turning on characterencoding detection. This is not recommended for general use. Inparticular, it's not safe for sharing across multiple threads andwill fail throw if this is attempted.

You can also combine the flag options:

Installation

The current stable version of python-magic is available on PyPI andcan be installed by running pip install python-magic.

Other sources:

  • PyPI: http://pypi.python.org/pypi/python-magic/
  • GitHub: https://github.com/ahupp/python-magic

This module is a simple wrapper around the libmagic C library, andthat must be installed as well:

Debian/Ubuntu

Windows

You'll need DLLs for libmagic. @julian-r maintains a pypi package with the DLLs, you can fetch it with:

OSX

  • When using Homebrew: brew install libmagic
  • When using macports: port install file

Troubleshooting

  • 'MagicException: could not find any magic files!': someinstallations of libmagic do not correctly point to their magicdatabase file. Try specifying the path to the file explicitly in theconstructor: magic.Magic(magic_file='path_to_magic_file').

  • 'WindowsError: [Error 193] %1 is not a valid Win32 application':Attempting to run the 32-bit libmagic DLL in a 64-bit build ofpython will fail with this error. Here are 64-bit builds of libmagic for windows: https://github.com/pidydx/libmagicwin64.Newer version can be found here: https://github.com/nscaife/file-windows.

  • 'WindowsError: exception: access violation writing 0x00000000 ' This may indicate you are mixingWindows Python and Cygwin Python. Make sure your libmagic and python builds are consistent.

Bug Reports

Brew Install Pip

python-magic is a thin layer over the libmagic C library.Historically, most bugs that have been reported against python-magicare actually bugs in libmagic; libmagic bugs can be reported on theirtracker here: https://bugs.astron.com/my_view_page.php. If you're notsure where the bug lies feel free to file an issue on GitHub and I cantriage it.

Running the tests

To run the tests across a variety of linux distributions (depends on Docker):

To run tests locally across all available python versions:

To run against a specific python version:

libmagic and python-magic

See COMPAT.md for a guide to libmagic / python-magic compatability.

Versioning

Minor version bumps should be backwards compatible. Major bumps are not.

Author

Written by Adam Hupp in 2001 for a project that never got off theground. It originally used SWIG for the C library bindings, butswitched to ctypes once that was part of the python standard library.

You can contact me via my website orGitHub.

License

python-magic is distributed under the MIT license. See the includedLICENSE file for details.

I am providing code in the repository to you under an open source license. Because this is my personal repository, the license you receive to my code is from me and not my employer (Facebook).

Release historyRelease notifications RSS feed

0.4.22

0.4.21

0.4.20 yanked

0.4.19 yanked

Brew

0.4.18

0.4.17

0.4.15

0.4.13

0.4.12

0.4.11

0.4.10

0.4.9

0.4.8

0.4.7

0.4.6

Brew Upgrade Python

0.4.5

0.4.3

0.4.2

0.4.1

0.4.0

0.3.1

0.3

0.2

Download files

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

Files for python-magic, version 0.4.22
Filename, sizeFile typePython versionUpload dateHashes
Filename, size python_magic-0.4.22-py2.py3-none-any.whl (12.6 kB) File type Wheel Python version py2.py3 Upload dateHashes
Filename, size python-magic-0.4.22.tar.gz (17.0 kB) File type Source Python version None Upload dateHashes
Close

Hashes for python_magic-0.4.22-py2.py3-none-any.whl

Brew Python 3.8

Hashes for python_magic-0.4.22-py2.py3-none-any.whl
AlgorithmHash digest
SHA2568551e804c09a3398790bd9e392acb26554ae2609f29c72abb0b9dee9a5571eae
MD557091a64d5d85eb48dc31f9241d13750
BLAKE2-256ba7c1d1d4bdda29bfec662b9b50951dee2dddf7747d3cbf7777f3d1c63372bd0
Close

Hashes for python-magic-0.4.22.tar.gz

Hashes for python-magic-0.4.22.tar.gz
AlgorithmHash digest
SHA256ca884349f2c92ce830e3f498c5b7c7051fe2942c3ee4332f65213b8ebff15a62
MD587148b84168c0855b1c735952c96f9d4
BLAKE2-25626606d45e0e7043f5a7bf15238ca451256a78d3c5fe02cd372f0ed6d888a16d5

Brew Python 3.7

  • Install Homebrew


    Paste that in a macOS Terminal or Linux shell prompt.

    The script explains what it will do and then pauses before it does it. Read about other installation options.

  • What Does Homebrew Do?


    Homebrew installs the stuff you need that Apple (or your Linux system) didn’t.

  • Homebrew installs packages to their own directory and then symlinks their files into /usr/local.

  • Homebrew won’t install files outside its prefix and you can place a Homebrew installation wherever you like.

  • It’s all Git and Ruby underneath, so hack away with the knowledge that you can easily revert your modifications and merge upstream updates.

  • Homebrew complements macOS (or your Linux system). Install your RubyGems with gem and their dependencies with brew.

  • “To install, drag this icon…” no more. Homebrew Cask installs macOS apps, fonts and plugins and other non-open source software.

  • Donate to Homebrew

  • Homebrew Blog

  • Analytics Data

  • Homebrew was created by Max Howell. Website by Rémi Prévost, Mike McQuaid and Danielle Lalonde.