Metadata-Version: 2.0
Name: pigar
Version: 0.6.2
Summary: Python requirements tool -- pigar
Home-page: https://github.com/Damnever/pigar
Author: Damnever
Author-email: dxc.wolf@gmail.com
License: The BSD 3-Clause License
Keywords: requirements tool
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Utilities
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Requires-Dist: colorama
Requires-Dist: futures

Python project requirements tool -- pigar
=========================================

.. image:: https://img.shields.io/travis/Damnever/pigar.svg?style=flat-square
   :target: https://travis-ci.org/Damnever/pigar

.. image:: https://img.shields.io/pypi/v/pigar.svg?style=flat-square
   :target: https://pypi.python.org/pypi/pigar


.. image:: https://github.com/Damnever/pigar/blob/master/pigar-do.gif
(In GIF, Module ``urlparse`` has been removed in Python3, ``requests`` has been installed in ``pigar-2.7``, not in ``pigar-3.5``)


Futures
-------

- Generate requirements for project, ``pigar`` can consider all kinds of complicated situations. In this project, `py2_requirements.txt <https://github.com/Damnever/pigar/blob/master/py2_requirements.txt>`_ and `py3_requirements.txt <https://github.com/Damnever/pigar/blob/master/py3_requirements.txt>`_ for different python versions ::

    # Generate requirements.txt for current directory.
    $ pigar

    # Generate requirements for given directory in given file.
    $ pigar -p ../dev-requirements.txt -P ../

  ``pigar`` will list all files which referenced the package, for example: ::

    # project/foo.py: 2,3
    # project/bar/baz.py: 2,7,8,9
    foobar == 3.3.3

  If requirements file is overwritten over, ``pigar`` will show difference between old and new.

- If you do not know the import name belong to which package (more generally, are you crazy for ``Import Error: xxx``?), such as ``bs4`` may come from ``beautifulsoup4``, ``MySQLdb`` may come from ``MySQL_Python``, search it: ::

    $ pigar -s bs4 MySQLdb

- Check requirements latest version, just do: ::

    # Specific a requirements file.
    $ pigar -c ./requirements.txt

    # Or, you can leave pigar search *requirements.txt in current directory
    # level by itself, if not found, pigar will generate requirements.txt
    # for current project then check latest version.
    $ pigar -c

Installation
------------

Available in Python: 2.7.+, 3.2+ ::

    [sudo] pip install pigar

Get newest code from GitHub ::

  pip install git+https://github.com/Damnever/pigar.git@[master or other branch] --upgrade

Usage
-----

::

    usage: pigar [-h] [-v] [-u] [-s NAME [NAME ...]] [-c [PATH]] [-l LOG_LEVEL]
             [-i DIR [DIR ...]] [-p SAVE_PATH] [-P PROJECT_PATH]

    Python requirements tool -- pigar, it will do only one thing at each time.
    Default action is generate requirements.txt in current directory.

    optional arguments:
      -h, --help          show this help message and exit
      -v, --version       show pigar version information and exit
      -u, --update        update database, use it when pigar failed you, exit when
                          action done
      -s NAME [NAME ...]  search package name by import name, use it if you do not
                          know import name come from which package, exit when
                          action done
      -c [PATH]           check requirements latest version. If file path not
                          given, search *requirements.txt in current directory, if
                          not found, generate file requirements.txt, exit when
                          action done
      -l LOG_LEVEL        Show given level log messages, argument can be (ERROR,
                          WARNING, INFO, DEBUG), case-insensitive
      -i DIR [DIR ...]    Given a list of directory to ignore, relative directory,
                          *used for* -c and default action
      -p SAVE_PATH        save requirements in given file path, *used for* default
                          action
      -P PROJECT_PATH     project path, which is directory, *used for* default
                          action


More
----

``pigar`` do not use regular expression such a violence way, it use AST, that is a better method to extracting imported names from arguments of ``exec``/``eval``, doctest of docstring, etc.

Also, ``pigar`` can consider difference between differen Python versions. For example, you can find ``concurrent.futures`` from Python 3.2 standart library, but you will need install ``futures`` before 3.2 version in Python to get ``concurrent.futures``.

Finally, you already saw ``Futures``. You can learn more from source code.

Anyway, if you have issue or suggestion, come `here <https://github.com/Damnever/pigar/issues>`_. 

LISENSE
-------

`The BSD 3-Clause License <https://github.com/Damnever/pigar/blob/master/LICENSE>`_


Change Logs
-----------

Version 0.6.2 (2015.11.5)
^^^^^^^^^^^^^^^^^^^^^^^^^

- If requirements file is overwritten over, show difference between old and new.
- Adjust the structure of the code.

Version 0.6.1 (2015.11.3)
^^^^^^^^^^^^^^^^^^^^^^^^^

- Fixed typo.
- Follow symlinks.

Version 0.6.0 (2015.10.30)
^^^^^^^^^^^^^^^^^^^^^^^^^^

- Enhancement: issue `#7 <https://github.com/Damnever/pigar/issues/7>`_, show imported module come from which files.
- Consider package installed via Git.
- Add command "-i", used to ignore a list of directory.

Version 0.5.5 (2015.10.21)
^^^^^^^^^^^^^^^^^^^^^^^^^^

- Fixed issue `#2 <https://github.com/Damnever/pigar/issues/2>`_ , `#3 <https://github.com/Damnever/pigar/issues/3>`_ , `#4 <https://github.com/Damnever/pigar/issues/4>`_ , `#5 <https://github.com/Damnever/pigar/issues/5>`_.

Version 0.5.2-0.5.4 (2015.10.6)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Fixed issue `#1 <https://github.com/Damnever/pigar/issues/1>`_.
- Make version compare more effective.
- Remove useless code.

Version 0.5.1 (2015.10.1)
^^^^^^^^^^^^^^^^^^^^^^^^^

- Available in PYPI(https://pypi.python.org/pypi/pigar).
- Generate requirements for Python project.
- Can consider different for different Python versions.
- Search package names by imported names.


