<commit_before>.. _installation:

Installation
============

One of the main goals of textract is to make it as easy as possible to
start using textract (meaning that installation should be as quick and
painless as possible). This package is built on top of several python
packages and other source libraries. Assuming you are using ``pip`` or
``easy_install`` to install textract, the `python packages
<https://github.com/deanmalmgren/textract/blob/master/requirements/python>`_
are all installed by default with textract. The source libraries are a
separate matter though and largely depend on your operating system.

Ubuntu / Debian
---------------

There are two steps required to run this package on
Ubuntu/Debian. First you must install some system packages using the
`apt-get <https://help.ubuntu.com/14.04/serverguide/apt-get.html>`_
package manager before installing textract from pypi.

.. code-block:: bash

    apt-get install python-dev libxml2-dev libxslt1-dev antiword unrtf poppler-utils pstotext tesseract-ocr \
    flac ffmpeg lame libmad0 libsox-fmt-mp3 sox libjpeg-dev
    pip install textract

.. note::

    It may also be necessary to install ``zlib1g-dev`` on Docker
    instances of Ubuntu. See `issue #19
    <https://github.com/deanmalmgren/textract/pull/19>`_ for details

OSX
---

These steps rely on you having `homebrew <http://brew.sh/>`_ installed
as well as the `cask <http://caskroom.io/>`_ plugin (``brew install
caskroom/cask/brew-cask``). The basic idea is to first install
`XQuartz <https://xquartz.macosforge.org/landing/>`_ before
installing a bunch of system packages before installing textract from
pypi.

.. code-block:: bash

    brew cask install xquartz
    brew install poppler antiword unrtf tesseract
    pip install textract

..     brew install libxml2 libxslt antiword poppler tesseract
..     brew link libxml2 libxslt

.. note::

    `pstotext <http://pages.cs.wisc.edu/~ghost/doc/pstotext.htm>`_ is
    not currently a part of homebrew so ``.ps`` extraction must be
    enabled by manually installing from source.

.. note::

    Depending on how you have python configured on your system with
    homebrew, you may also need to install the python
    development header files for textract to properly install.


Don't see your operating system installation instructions here?<commit_msg>added swig to installation docs<commit_after>.. _installation:

Installation
============

One of the main goals of textract is to make it as easy as possible to
start using textract (meaning that installation should be as quick and
painless as possible). This package is built on top of several python
packages and other source libraries. Assuming you are using ``pip`` or
``easy_install`` to install textract, the `python packages
<https://github.com/deanmalmgren/textract/blob/master/requirements/python>`_
are all installed by default with textract. The source libraries are a
separate matter though and largely depend on your operating system.

Ubuntu / Debian
---------------

There are two steps required to run this package on
Ubuntu/Debian. First you must install some system packages using the
`apt-get <https://help.ubuntu.com/14.04/serverguide/apt-get.html>`_
package manager before installing textract from pypi.

.. code-block:: bash

    apt-get install python-dev libxml2-dev libxslt1-dev antiword unrtf poppler-utils pstotext tesseract-ocr \
    flac ffmpeg lame libmad0 libsox-fmt-mp3 sox libjpeg-dev swig
    pip install textract

.. note::

    It may also be necessary to install ``zlib1g-dev`` on Docker
    instances of Ubuntu. See `issue #19
    <https://github.com/deanmalmgren/textract/pull/19>`_ for details

OSX
---

These steps rely on you having `homebrew <http://brew.sh/>`_ installed
as well as the `cask <http://caskroom.io/>`_ plugin (``brew install
caskroom/cask/brew-cask``). The basic idea is to first install
`XQuartz <https://xquartz.macosforge.org/landing/>`_ before
installing a bunch of system packages before installing textract from
pypi.

.. code-block:: bash

    brew cask install xquartz
    brew install poppler antiword unrtf tesseract swig
    pip install textract

..     brew install libxml2 libxslt antiword poppler tesseract
..     brew link libxml2 libxslt

.. note::

    `pstotext <http://pages.cs.wisc.edu/~ghost/doc/pstotext.htm>`_ is
    not currently a part of homebrew so ``.ps`` extraction must be
    enabled by manually installing from source.

.. note::

    Depending on how you have python configured on your system with
    homebrew, you may also need to install the python
    development header files for textract to properly install.


Don't see your operating system installation instructions here?
{'fraction_non_alphanumeric': 0.08693808312128923, 'fraction_numerical': 0.006361323155216285, 'mean_word_length': 3.7502517623363545, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6847980', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1345, 'n_words': 567}