Metadata-Version: 2.1
Name: dephell-links
Version: 0.1.5
Summary: Parse dependency links
Project-URL: Repository, https://github.com/dephell/dephell_links
Author: Gram
Author-email: master_fess@mail.ru
License: MIT
Requires-Python: >=3.5
Keywords: dephell,packaging,links,pypi
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management :: Link Checking
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: Unix


DepHell Links
=============


.. image:: https://travis-ci.org/dephell/dephell_links.svg?branch=master
   :target: https://travis-ci.org/dephell/dephell_links
   :alt: travis


.. image:: https://ci.appveyor.com/api/projects/status/github/dephell/dephell_links?svg=true
   :target: https://ci.appveyor.com/project/orsinium/dephell-links
   :alt: appveyor


.. image:: https://img.shields.io/pypi/l/dephell-links.svg
   :target: https://github.com/dephell/dephell_links/blob/master/LICENSE
   :alt: MIT License


Parse dependency links.

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

Install from `PyPI <https://pypi.org/project/dephell-links/>`_\ :

.. code-block:: bash

   python3 -m pip install --user dephell_links

Usage
-----

.. code-block:: python

   from dephell_links import parse_link

   parse_link('https://github.com/r1chardj0n3s/parse.git')
   # VCSLink(server='github.com', author='r1chardj0n3s', project='parse', vcs='git', protocol='https', user=None, ext='.git', rev=None, name='parse')

   link = parse_link('https://github.com/divio/django-cms/archive/release/3.4.x.zip')
   link
   # URLLink(https://github.com/divio/django-cms/archive/release/3.4.x.zip)
   link.name
   # 'django-cms'

   link = parse_link('./tests/test_parsing.py')
   link
   # FileLink(./tests/test_parsing.py)
   link.name
   # 'test_parsing'
   link.hash
   # 'sha256:ad7927cf442156980659eee391da849e54f472b4bafe20c32cdb242c153528d5'

   link = parse_link('./tests/')
   link
   # DirLink(./tests/)
   link.name
   # 'tests'
