A simple, immutable URL class with a clean API for interrogation and manipulation.

Overview

purl - A simple Python URL class

A simple, immutable URL class with a clean API for interrogation and manipulation. Supports Pythons 2.7, 3.3, 3.4, 3.5, 3.6 and pypy.

Also supports template URLs as per RFC 6570

Contents:

https://secure.travis-ci.org/codeinthehole/purl.png

Docs

http://purl.readthedocs.org/en/latest/

Install

From PyPI (stable):

$ pip install purl

From Github (unstable):

$ pip install git+git://github.com/codeinthehole/purl.git#egg=purl

Use

Construct:

>>> from purl import URL

# String constructor
>>> from_str = URL('https://www.google.com/search?q=testing')

# Keyword constructor
>>> from_kwargs = URL(scheme='https', host='www.google.com', path='/search', query='q=testing')

# Combine
>>> from_combo = URL('https://www.google.com').path('search').query_param('q', 'testing')

URL objects are immutable - all mutator methods return a new instance.

Interrogate:

>>> u = URL('https://www.google.com/search?q=testing')
>>> u.scheme()
'https'
>>> u.host()
'www.google.com'
>>> u.domain()
'www.google.com'
>>> u.username()
>>> u.password()
>>> u.netloc()
'www.google.com'
>>> u.port()
>>> u.path()
'/search'
>>> u.query()
'q=testing'
>>> u.fragment()
''
>>> u.path_segment(0)
'search'
>>> u.path_segments()
('search',)
>>> u.query_param('q')
'testing'
>>> u.query_param('q', as_list=True)
['testing']
>>> u.query_param('lang', default='GB')
'GB'
>>> u.query_params()
{'q': ['testing']}
>>> u.has_query_param('q')
True
>>> u.has_query_params(('q', 'r'))
False
>>> u.subdomains()
['www', 'google', 'com']
>>> u.subdomain(0)
'www'

Note that each accessor method is overloaded to be a mutator method too, similar to the jQuery API. Eg:

>>> u = URL.from_string('https://github.com/codeinthehole')

# Access
>>> u.path_segment(0)
'codeinthehole'

# Mutate (creates a new instance)
>>> new_url = u.path_segment(0, 'tangentlabs')
>>> new_url is u
False
>>> new_url.path_segment(0)
'tangentlabs'

Hence, you can build a URL up in steps:

>>> u = URL().scheme('http').domain('www.example.com').path('/some/path').query_param('q', 'search term')
>>> u.as_string()
'http://www.example.com/some/path?q=search+term'

Along with the above overloaded methods, there is also a add_path_segment method for adding a segment at the end of the current path:

>>> new_url = u.add_path_segment('here')
>>> new_url.as_string()
'http://www.example.com/some/path/here?q=search+term'

Couple of other things:

  • Since the URL class is immutable it can be used as a key in a dictionary
  • It can be pickled and restored
  • It supports equality operations
  • It supports equality operations

URL templates can be used either via a Template class:

>>> from purl import Template
>>> tpl = Template("http://example.com{/list*}")
>>> url = tpl.expand({'list': ['red', 'green', 'blue']})
>>> url.as_string()
'http://example.com/red/green/blue'

or the expand function:

>>> from purl import expand
>>> expand(u"{/list*}", {'list': ['red', 'green', 'blue']})
'/red/green/blue'

A wide variety of expansions are possible - refer to the RFC for more details.

Changelog

v1.5 - 2019-03-10

  • Allow @ in passwords.

v1.4 - 2018-03-11

  • Allow usernames and passwords to be removed from URLs.

v1.3.1

  • Ensure paths always have a leading slash.

v1.3

  • Allow absolute URLs to be converted into relative.

v1.2

  • Support password-less URLs.
  • Allow slashes to be passed as path segments.

v1.1

  • Support setting username and password via mutator methods

v1.0.3

  • Handle some unicode compatibility edge-cases

v1.0.2

  • Fix template expansion bug with no matching variables being passed in. This ensures purl.Template works correctly with the URLs returned from the Github API.

v1.0.1

  • Fix bug with special characters in paths not being escaped.

v1.0

  • Slight tidy up. Document support for PyPy and Python 3.4.

v0.8

  • Support for RFC 6570 URI templates

v0.7

  • All internal strings are unicode.
  • Support for unicode chars in path, fragment, query, auth added.

v0.6

  • Added append_query_param method
  • Added remove_query_param method

v0.5

  • Added support for Python 3.2/3.3 (thanks @pmcnr and @mitchellrj)

v0.4.1

  • Added API docs
  • Added to readthedocs.org

v0.4

  • Modified constructor to accept full URL string as first arg
  • Added add_path_segment method

v0.3.2

  • Fixed bug port number in string when using from_string constructor

v0.3.1

  • Fixed bug with passing lists to query param setter methods

v0.3

  • Added support for comparison and equality
  • Added support for pickling
  • Added __slots__ so instances can be used as keys within dictionaries

Contribute

Clone, create a virtualenv then install purl and the packages required for testing:

$ git clone [email protected]:codeinthehole/purl.git
$ cd purl
$ mkvirtualenv purl  # requires virtualenvwrapper
(purl) $ make

Ensure tests pass using:

(purl) $ ./runtests.sh

or:

$ tox
Comments
  • Added support for username/password setting

    Added support for username/password setting

    Those lines of code could actually help with elegant build of full URL, like this:

    ELASTICSEARCH_URL = URL.from_string("FOUNDELASTICSEARCH_URL"))\
                               .scheme('https')\
                               .username(myuser)\
                               .password(os.environ['password'])\
                               .port('9243')
    
    opened by mieciu 4
  • Cannot be installed using buildout

    Cannot be installed using buildout

    When I try to install purl 1.2 using buildout I get the following error:

    Traceback (most recent call last):
      File "/Users/denis/.buildout/eggs/setuptools-19.4-py3.5.egg/setuptools/sandbox.py", line 154, in save_modules
      File "/Users/denis/.buildout/eggs/setuptools-19.4-py3.5.egg/setuptools/sandbox.py", line 195, in setup_context
      File "/Users/denis/.buildout/eggs/setuptools-19.4-py3.5.egg/setuptools/sandbox.py", line 239, in run_setup
      File "/Users/denis/.buildout/eggs/setuptools-19.4-py3.5.egg/setuptools/sandbox.py", line 269, in run
      File "/Users/denis/.buildout/eggs/setuptools-19.4-py3.5.egg/setuptools/sandbox.py", line 238, in runner
      File "/Users/denis/.buildout/eggs/setuptools-19.4-py3.5.egg/setuptools/sandbox.py", line 46, in _execfile
      File "/var/folders/mm/5rlp4h9906n3npgjt96lm0fw0000gn/T/easy_install-4zdguc7q/purl-1.2/setup.py", line 5, in <module>
      File "/var/folders/mm/5rlp4h9906n3npgjt96lm0fw0000gn/T/easy_install-4zdguc7q/purl-1.2/purl/__init__.py", line 1, in <module>
      File "/var/folders/mm/5rlp4h9906n3npgjt96lm0fw0000gn/T/easy_install-4zdguc7q/purl-1.2/purl/url.py", line 10, in <module>
    ImportError: No module named 'six'
    

    The problem seems to be that you try to import the package in setup.py, when it's not yet installed. This works if six is installed, or indeed if pip is used (because pip has a workaround for this). What you should be doing is either define the version twice in the __init__.py as well as setup.py. Or you open __init__.py as text and parse the version statically.

    opened by href 3
  • passwordless URL support in string representation

    passwordless URL support in string representation

    Hi,

    Today I've discovered quite weird behaviour - please have a look at snippet below:

    >>> from purl import URL
    >>> url = URL(scheme='postgres', username='user', host='127.0.0.1', port='5432', path='/db_name')
    >>> url.as_string()
    u'postgres://127.0.0.1:5432/db_name'        # Username disappeared 
    >>> url = URL(scheme='postgres', username='user', password='pass', host='127.0.0.1', port='5432', path='/db_name')
    >>> url.as_string()
    u'postgres://user:[email protected]:5432/db_name'        # In combination w/ passord it works
    

    Of course its being stored properly:

    >>> url = URL(scheme='postgres', username='user', host='127.0.0.1', port='5432', path='/db_name')
    >>> url
    _URLTuple(host='127.0.0.1', username='user', password=None, scheme='postgres', port='5432', path='/db_name', query=None, fragment=N
    one)
    >>> url.username
    <bound method URL.username of _URLTuple(host='127.0.0.1', username='user', password=None, scheme='postgres', port='5432', path='/db
    _name', query=None, fragment=None)>
    >>> url.username()
    u'user'
    

    I think that passwordless URLs should be supported, as - for instance - following postgres URL is fully proper: psql "postgres://[email protected]:5432/template1"

    It should be relatively easy to fix, I'll try to submit a patch this week, but what do you think about this?

    opened by mieciu 2
  • decode all urls to ascii

    decode all urls to ascii

    urlparse.parse_qs will return bad value, when input url is a unicode instance and contains encoded non-ascii data. Problem described in details here: http://www.lexev.org/en/2013/parse-url-which-chontains-unicode-query-using-urlp/

    For some reason, django's request.get_full_path() returns url as unicode instance. Faced that problem during developing a faceted search in django-oscar

    Tests are attached.

    In short:

    >>> import urlparse, urllib
    >>> value = urllib.quote(u'значение'.encode('utf8'))
    >>> query = u"key=%s" % value
    >>> query
    u'key=%D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%B8%D0%B5'
    >>> query_dict = urlparse.parse_qs(query)
    >>> query_dict
    {u'key': [u'\xd0\xb7\xd0\xbd\xd0\xb0\xd1\x87\xd0\xb5\xd0\xbd\xd0\xb8\xd0\xb5']}
    >>> urllib.urlencode(query_dict, doseq=True)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "../urllib.py", line 1337, in urlencode
        l.append(k + '=' + quote_plus(str(elt)))
    UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-15: ordinal not in range(128)
    

    But, when construct query without u, it works fine:

    >>> query = "key=%s" % value
    >>> query_dict = urlparse.parse_qs(query)
    >>> query_dict
    {'key': ['\xd0\xb7\xd0\xbd\xd0\xb0\xd1\x87\xd0\xb5\xd0\xbd\xd0\xb8\xd0\xb5']}
    >>> urllib.urlencode(query_dict, doseq=True)
    'key=%D0%B7%D0%BD%D0%B0%D1%87%D0%B5%D0%BD%D0%B8%D0%B5'
    
    opened by st4lk 2
  • Add RFC6570 (Uri template) support

    Add RFC6570 (Uri template) support

    Right now, there's a python package https://github.com/uri-templates/uritemplate-py that implements RFC6570 url template expanding, but it will be fantastic to get that code merged into purl .

    opened by inean 2
  • 1.5: pytest is failing

    1.5: pytest is failing

    I'm trying to package your module as rpm packag. So I'm using typical in such case build, install and test cycle used on building package from non-root account:

    • "setup.py build"
    • "setup.py install --root </install/prefix>"
    • "pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

    May I ask for help because few units are failing:

    + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-purl-1.5-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-purl-1.5-3.fc35.x86_64/usr/lib/python3.8/site-packages
    + /usr/bin/pytest -ra --import-mode=importlib
    =========================================================================== test session starts ============================================================================
    platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
    cachedir: .pytest_cache
    benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
    hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/tkloczko/rpmbuild/BUILD/purl-1.5/.hypothesis/examples')
    rootdir: /home/tkloczko/rpmbuild/BUILD/purl-1.5, configfile: pytest.ini
    plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, xprocess-0.18.1, black-0.3.12, checkdocs-2.7.1, anyio-3.3.0, Faker-8.11.0, asyncio-0.15.1, trio-0.7.0, httpbin-1.0.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0
    collected 171 items / 2 errors / 169 selected
    
    ================================================================================== ERRORS ==================================================================================
    ____________________________________________________________________ ERROR collecting purl/template.py _____________________________________________________________________
    /usr/lib/python3.8/site-packages/_pytest/runner.py:311: in from_call
        result: Optional[TResult] = func()
    /usr/lib/python3.8/site-packages/_pytest/runner.py:341: in <lambda>
        call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
    /usr/lib/python3.8/site-packages/_pytest/doctest.py:532: in collect
        module = import_path(self.fspath)
    /usr/lib/python3.8/site-packages/_pytest/pathlib.py:544: in import_path
        raise ImportPathMismatchError(module_name, module_file, path)
    E   _pytest.pathlib.ImportPathMismatchError: ('purl.template', '/home/tkloczko/rpmbuild/BUILDROOT/python-purl-1.5-3.fc35.x86_64/usr/lib/python3.8/site-packages/purl/template.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/purl-1.5/purl/template.py'))
    _______________________________________________________________________ ERROR collecting purl/url.py _______________________________________________________________________
    /usr/lib/python3.8/site-packages/_pytest/runner.py:311: in from_call
        result: Optional[TResult] = func()
    /usr/lib/python3.8/site-packages/_pytest/runner.py:341: in <lambda>
        call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
    /usr/lib/python3.8/site-packages/_pytest/doctest.py:532: in collect
        module = import_path(self.fspath)
    /usr/lib/python3.8/site-packages/_pytest/pathlib.py:544: in import_path
        raise ImportPathMismatchError(module_name, module_file, path)
    E   _pytest.pathlib.ImportPathMismatchError: ('purl.url', '/home/tkloczko/rpmbuild/BUILDROOT/python-purl-1.5-3.fc35.x86_64/usr/lib/python3.8/site-packages/purl/url.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/purl-1.5/purl/url.py'))
    ========================================================================= short test summary info ==========================================================================
    ERROR purl/template.py - _pytest.pathlib.ImportPathMismatchError: ('purl.template', '/home/tkloczko/rpmbuild/BUILDROOT/python-purl-1.5-3.fc35.x86_64/usr/lib/python3.8/si...
    ERROR purl/url.py - _pytest.pathlib.ImportPathMismatchError: ('purl.url', '/home/tkloczko/rpmbuild/BUILDROOT/python-purl-1.5-3.fc35.x86_64/usr/lib/python3.8/site-package...
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    ============================================================================ 2 errors in 0.59s =============================================================================
    pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.
    
    opened by kloczek 1
  • Bump pip from 19.0.3 to 19.2

    Bump pip from 19.0.3 to 19.2

    Bumps pip from 19.0.3 to 19.2.

    Changelog

    Sourced from pip's changelog.

    19.2 (2019-07-22)

    Deprecations and Removals

    • Drop support for EOL Python 3.4. ([#6685](https://github.com/pypa/pip/issues/6685) <https://github.com/pypa/pip/issues/6685>_)
    • Improve deprecation messages to include the version in which the functionality will be removed. ([#6549](https://github.com/pypa/pip/issues/6549) <https://github.com/pypa/pip/issues/6549>_)

    Features

    • Credentials will now be loaded using keyring when installed. ([#5948](https://github.com/pypa/pip/issues/5948) <https://github.com/pypa/pip/issues/5948>_)
    • Fully support using --trusted-host inside requirements files. ([#3799](https://github.com/pypa/pip/issues/3799) <https://github.com/pypa/pip/issues/3799>_)
    • Update timestamps in pip's --log file to include milliseconds. ([#6587](https://github.com/pypa/pip/issues/6587) <https://github.com/pypa/pip/issues/6587>_)
    • Respect whether a file has been marked as "yanked" from a simple repository (see PEP 592 <https://www.python.org/dev/peps/pep-0592/>__ for details). ([#6633](https://github.com/pypa/pip/issues/6633) <https://github.com/pypa/pip/issues/6633>_)
    • When choosing candidates to install, prefer candidates with a hash matching one of the user-provided hashes. ([#5874](https://github.com/pypa/pip/issues/5874) <https://github.com/pypa/pip/issues/5874>_)
    • Improve the error message when METADATA or PKG-INFO is None when accessing metadata. ([#5082](https://github.com/pypa/pip/issues/5082) <https://github.com/pypa/pip/issues/5082>_)
    • Add a new command pip debug that can display e.g. the list of compatible tags for the current Python. ([#6638](https://github.com/pypa/pip/issues/6638) <https://github.com/pypa/pip/issues/6638>_)
    • Display hint on installing with --pre when search results include pre-release versions. ([#5169](https://github.com/pypa/pip/issues/5169) <https://github.com/pypa/pip/issues/5169>_)
    • Report to Warehouse that pip is running under CI if the PIP_IS_CI environment variable is set. ([#5499](https://github.com/pypa/pip/issues/5499) <https://github.com/pypa/pip/issues/5499>_)
    • Allow --python-version to be passed as a dotted version string (e.g. 3.7 or 3.7.3). ([#6585](https://github.com/pypa/pip/issues/6585) <https://github.com/pypa/pip/issues/6585>_)
    • Log the final filename and SHA256 of a .whl file when done building a wheel. ([#5908](https://github.com/pypa/pip/issues/5908) <https://github.com/pypa/pip/issues/5908>_)
    • Include the wheel's tags in the log message explanation when a candidate wheel link is found incompatible. ([#6121](https://github.com/pypa/pip/issues/6121) <https://github.com/pypa/pip/issues/6121>_)
    • Add a --path argument to pip freeze to support --target installations. ([#6404](https://github.com/pypa/pip/issues/6404) <https://github.com/pypa/pip/issues/6404>_)
    • Add a --path argument to pip list to support --target installations. ([#6551](https://github.com/pypa/pip/issues/6551) <https://github.com/pypa/pip/issues/6551>_)

    Bug Fixes

    • Set sys.argv[0] to the underlying setup.py when invoking setup.py via the setuptools shim so setuptools doesn't think the path is -c. ([#1890](https://github.com/pypa/pip/issues/1890) <https://github.com/pypa/pip/issues/1890>_)
    • Update pip download to respect the given --python-version when checking "Requires-Python". ([#5369](https://github.com/pypa/pip/issues/5369) <https://github.com/pypa/pip/issues/5369>_)
    • Respect --global-option and --install-option when installing from a version control url (e.g. git). ([#5518](https://github.com/pypa/pip/issues/5518) <https://github.com/pypa/pip/issues/5518>_)
    • Make the "ascii" progress bar really be "ascii" and not Unicode. ([#5671](https://github.com/pypa/pip/issues/5671) <https://github.com/pypa/pip/issues/5671>_)
    • Fail elegantly when trying to set an incorrectly formatted key in config. ([#5963](https://github.com/pypa/pip/issues/5963) <https://github.com/pypa/pip/issues/5963>_)
    • Prevent DistutilsOptionError when prefix is indicated in the global environment and --target is used. ([#6008](https://github.com/pypa/pip/issues/6008) <https://github.com/pypa/pip/issues/6008>_)
    • Fix pip install to respect --ignore-requires-python when evaluating links. ([#6371](https://github.com/pypa/pip/issues/6371) <https://github.com/pypa/pip/issues/6371>_)

    ... (truncated)

    Commits
    • 0e64295 Generate NEWS
    • 0df416d Bump version for release
    • 5f0aa2a Generate AUTHORS.txt
    • 8582f7e Reduce dependency on ctypes when discovering glibc version. (#6678)
    • e308497 Merge pull request #6743 from chrahunt/maint/remove-path-copytree
    • 9281a7a Remove copytree from tests.lib.path.Path.
    • 0d28601 Remove copy from tests.lib.path.Path. (#6746)
    • c275e9d Drop a useless import in favor of explicitness
    • 3732e79 Remove normpath from tests.lib.path.Path.
    • 358e690 Remove move from tests.lib.path.Path.
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
  • Split from the right when extracting credentials

    Split from the right when extracting credentials

    It's important to split on the first '@' character from the right to ensure that special characters in the password aren't interpretted as part of the hostname.

    Fix issue #35

    opened by dylanfw 1
  • Cannot create URL with '@' symbol in password

    Cannot create URL with '@' symbol in password

    It isn't currently possible to create a URL when there is an @ character in the password.

    Using the '@' character directly: >>> purl.URL("mysql://foo:b@r@localhost") _URLTuple(host='r', username='foo', password='b', scheme='mysql', port=None, path='', query='', fragment='')

    URL encoding it first: >>> purl.URL("mysql://foo:b%40r@localhost") _URLTuple(host='localhost', username='foo', password='b%2540r', scheme='mysql', port=None, path='', query='', fragment='')

    A potential solution would be to split on '@' from the right when extracting credentials from the URL.

    opened by dylanfw 1
  • Add an ability to clear any part of URL

    Add an ability to clear any part of URL

    Currently I can't clear port, query and fragment:

    >>> url = URL('http://google.com:80/path/to/doc.html?q=query#frag')
    
    >>> url.port('')
    80               # NOT a new URL!
    
    >>> url.query('')
    'q=query'        # NOT a new URL!
    
    >>> url.fragment('')
    'frag'           # NOT a new URL!
    
    opened by pix666 1
  • Allow to remove username and password from URL

    Allow to remove username and password from URL

    For now, it is impossible to strip username or password from URL by calling .username("") or .password(""). This small change fixes the problem.


    This change is Reviewable

    opened by rmihael 1
  • Bump setuptools from 40.8.0 to 65.5.1

    Bump setuptools from 40.8.0 to 65.5.1

    Bumps setuptools from 40.8.0 to 65.5.1.

    Release notes

    Sourced from setuptools's releases.

    v65.5.1

    No release notes provided.

    v65.5.0

    No release notes provided.

    v65.4.1

    No release notes provided.

    v65.4.0

    No release notes provided.

    v65.3.0

    No release notes provided.

    v65.2.0

    No release notes provided.

    v65.1.1

    No release notes provided.

    v65.1.0

    No release notes provided.

    v65.0.2

    No release notes provided.

    v65.0.1

    No release notes provided.

    v65.0.0

    No release notes provided.

    v64.0.3

    No release notes provided.

    v64.0.2

    No release notes provided.

    v64.0.1

    No release notes provided.

    v64.0.0

    No release notes provided.

    v63.4.3

    No release notes provided.

    v63.4.2

    No release notes provided.

    ... (truncated)

    Changelog

    Sourced from setuptools's changelog.

    v65.5.1

    Misc ^^^^

    • #3638: Drop a test dependency on the mock package, always use :external+python:py:mod:unittest.mock -- by :user:hroncok
    • #3659: Fixed REDoS vector in package_index.

    v65.5.0

    Changes ^^^^^^^

    • #3624: Fixed editable install for multi-module/no-package src-layout projects.
    • #3626: Minor refactorings to support distutils using stdlib logging module.

    Documentation changes ^^^^^^^^^^^^^^^^^^^^^

    • #3419: Updated the example version numbers to be compliant with PEP-440 on the "Specifying Your Project’s Version" page of the user guide.

    Misc ^^^^

    • #3569: Improved information about conflicting entries in the current working directory and editable install (in documentation and as an informational warning).
    • #3576: Updated version of validate_pyproject.

    v65.4.1

    Misc ^^^^

    • #3613: Fixed encoding errors in expand.StaticModule when system default encoding doesn't match expectations for source files.
    • #3617: Merge with pypa/distutils@6852b20 including fix for pypa/distutils#181.

    v65.4.0

    Changes ^^^^^^^

    v65.3.0

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump wheel from 0.33.1 to 0.38.1

    Bump wheel from 0.33.1 to 0.38.1

    Bumps wheel from 0.33.1 to 0.38.1.

    Changelog

    Sourced from wheel's changelog.

    Release Notes

    UNRELEASED

    • Updated vendored packaging to 22.0

    0.38.4 (2022-11-09)

    • Fixed PKG-INFO conversion in bdist_wheel mangling UTF-8 header values in METADATA (PR by Anderson Bravalheri)

    0.38.3 (2022-11-08)

    • Fixed install failure when used with --no-binary, reported on Ubuntu 20.04, by removing setup_requires from setup.cfg

    0.38.2 (2022-11-05)

    • Fixed regression introduced in v0.38.1 which broke parsing of wheel file names with multiple platform tags

    0.38.1 (2022-11-04)

    • Removed install dependency on setuptools
    • The future-proof fix in 0.36.0 for converting PyPy's SOABI into a abi tag was faulty. Fixed so that future changes in the SOABI will not change the tag.

    0.38.0 (2022-10-21)

    • Dropped support for Python < 3.7
    • Updated vendored packaging to 21.3
    • Replaced all uses of distutils with setuptools
    • The handling of license_files (including glob patterns and default values) is now delegated to setuptools>=57.0.0 (#466). The package dependencies were updated to reflect this change.
    • Fixed potential DoS attack via the WHEEL_INFO_RE regular expression
    • Fixed ValueError: ZIP does not support timestamps before 1980 when using SOURCE_DATE_EPOCH=0 or when on-disk timestamps are earlier than 1980-01-01. Such timestamps are now changed to the minimum value before packaging.

    0.37.1 (2021-12-22)

    • Fixed wheel pack duplicating the WHEEL contents when the build number has changed (#415)
    • Fixed parsing of file names containing commas in RECORD (PR by Hood Chatham)

    0.37.0 (2021-08-09)

    • Added official Python 3.10 support
    • Updated vendored packaging library to v20.9

    ... (truncated)

    Commits
    • 6f1608d Created a new release
    • cf8f5ef Moved news item from PR #484 to its proper place
    • 9ec2016 Removed install dependency on setuptools (#483)
    • 747e1f6 Fixed PyPy SOABI parsing (#484)
    • 7627548 [pre-commit.ci] pre-commit autoupdate (#480)
    • 7b9e8e1 Test on Python 3.11 final
    • a04dfef Updated the pypi-publish action
    • 94bb62c Fixed docs not building due to code style changes
    • d635664 Updated the codecov action to the latest version
    • fcb94cd Updated version to match the release
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • docs: fix simple typo, insteed -> instead

    docs: fix simple typo, insteed -> instead

    There is a small typo in README.rst.

    Should read instead rather than insteed.

    Semi-automated pull request generated by https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

    opened by timgates42 0
  • Bump pip from 19.0.3 to 21.1

    Bump pip from 19.0.3 to 21.1

    Bumps pip from 19.0.3 to 21.1.

    Changelog

    Sourced from pip's changelog.

    21.1 (2021-04-24)

    Process

    • Start installation scheme migration from distutils to sysconfig. A warning is implemented to detect differences between the two implementations to encourage user reports, so we can avoid breakages before they happen.

    Features

    • Add the ability for the new resolver to process URL constraints. ([#8253](https://github.com/pypa/pip/issues/8253) <https://github.com/pypa/pip/issues/8253>_)
    • Add a feature --use-feature=in-tree-build to build local projects in-place when installing. This is expected to become the default behavior in pip 21.3; see Installing from local packages <https://pip.pypa.io/en/stable/user_guide/#installing-from-local-packages>_ for more information. ([#9091](https://github.com/pypa/pip/issues/9091) <https://github.com/pypa/pip/issues/9091>_)
    • Bring back the "(from versions: ...)" message, that was shown on resolution failures. ([#9139](https://github.com/pypa/pip/issues/9139) <https://github.com/pypa/pip/issues/9139>_)
    • Add support for editable installs for project with only setup.cfg files. ([#9547](https://github.com/pypa/pip/issues/9547) <https://github.com/pypa/pip/issues/9547>_)
    • Improve performance when picking the best file from indexes during pip install. ([#9748](https://github.com/pypa/pip/issues/9748) <https://github.com/pypa/pip/issues/9748>_)
    • Warn instead of erroring out when doing a PEP 517 build in presence of --build-option. Warn when doing a PEP 517 build in presence of --global-option. ([#9774](https://github.com/pypa/pip/issues/9774) <https://github.com/pypa/pip/issues/9774>_)

    Bug Fixes

    • Fixed --target to work with --editable installs. ([#4390](https://github.com/pypa/pip/issues/4390) <https://github.com/pypa/pip/issues/4390>_)
    • Add a warning, discouraging the usage of pip as root, outside a virtual environment. ([#6409](https://github.com/pypa/pip/issues/6409) <https://github.com/pypa/pip/issues/6409>_)
    • Ignore .dist-info directories if the stem is not a valid Python distribution name, so they don't show up in e.g. pip freeze. ([#7269](https://github.com/pypa/pip/issues/7269) <https://github.com/pypa/pip/issues/7269>_)
    • Only query the keyring for URLs that actually trigger error 401. This prevents an unnecessary keyring unlock prompt on every pip install invocation (even with default index URL which is not password protected). ([#8090](https://github.com/pypa/pip/issues/8090) <https://github.com/pypa/pip/issues/8090>_)
    • Prevent packages already-installed alongside with pip to be injected into an isolated build environment during build-time dependency population. ([#8214](https://github.com/pypa/pip/issues/8214) <https://github.com/pypa/pip/issues/8214>_)
    • Fix pip freeze permission denied error in order to display an understandable error message and offer solutions. ([#8418](https://github.com/pypa/pip/issues/8418) <https://github.com/pypa/pip/issues/8418>_)
    • Correctly uninstall script files (from setuptools' scripts argument), when installed with --user. ([#8733](https://github.com/pypa/pip/issues/8733) <https://github.com/pypa/pip/issues/8733>_)
    • New resolver: When a requirement is requested both via a direct URL (req @ URL) and via version specifier with extras (req[extra]), the resolver will now be able to use the URL to correctly resolve the requirement with extras. ([#8785](https://github.com/pypa/pip/issues/8785) <https://github.com/pypa/pip/issues/8785>_)
    • New resolver: Show relevant entries from user-supplied constraint files in the error message to improve debuggability. ([#9300](https://github.com/pypa/pip/issues/9300) <https://github.com/pypa/pip/issues/9300>_)
    • Avoid parsing version to make the version check more robust against lousily debundled downstream distributions. ([#9348](https://github.com/pypa/pip/issues/9348) <https://github.com/pypa/pip/issues/9348>_)
    • --user is no longer suggested incorrectly when pip fails with a permission error in a virtual environment. ([#9409](https://github.com/pypa/pip/issues/9409) <https://github.com/pypa/pip/issues/9409>_)
    • Fix incorrect reporting on Requires-Python conflicts. ([#9541](https://github.com/pypa/pip/issues/9541) <https://github.com/pypa/pip/issues/9541>_)

    ... (truncated)

    Commits
    • 2b2a268 Bump for release
    • ea761a6 Update AUTHORS.txt
    • 2edd3fd Postpone a deprecation to 21.2
    • 3cccfbf Rename mislabeled news fragment
    • 21cd124 Fix NEWS.rst placeholder position
    • e46bdda Merge pull request #9827 from pradyunsg/fix-git-improper-tag-handling
    • 0e4938d :newspaper:
    • ca832b2 Don't split git references on unicode separators
    • 1320bac Merge pull request #9814 from pradyunsg/revamp-ci-apr-2021-v2
    • e9cc23f Skip checks on PRs only
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Owner
David Winterbottom
Head of Software Engineering at Octopus Energy
David Winterbottom
ShortenURL-model - The model layer class for shorten url service

ShortenURL Model The model layer class for shorten URL service Usage Complete th

TwinIsland 1 Jan 7, 2022
Shorten-Link - Make shorten URL with Cuttly API

Shorten-Link This Script make shorten URL with custom slashtag The script take f

Ahmed Hossam 3 Feb 13, 2022
A simple URL shortener app using Python AWS Chalice, AWS Lambda and AWS Dynamodb.

url-shortener-chalice A simple URL shortener app using AWS Chalice. Please make sure you configure your AWS credentials using AWS CLI before starting

Ranadeep Ghosh 2 Dec 9, 2022
Ukiyo - A simple, minimalist and efficient discord vanity URL sniper

Ukiyo - a simple, minimalist and efficient discord vanity URL sniper. Ukiyo is easy to use, has a very visually pleasing interface, and has great spee

null 13 Apr 14, 2022
A simple URL shortener built with Flask

A simple URL shortener built with Flask and MongoDB.

Mike Lowe 2 Feb 5, 2022
This is a no-bullshit file hosting and URL shortening service that also runs 0x0.st. Use with uWSGI.

This is a no-bullshit file hosting and URL shortening service that also runs 0x0.st. Use with uWSGI.

mia 1.6k Dec 31, 2022
Customizable URL shortener written in Python3 for sniffing and spoofing

Customizable URL shortener written in Python3 for sniffing and spoofing

null 3 Nov 22, 2022
🔗 FusiShort is a URL shortener built with Python, Redis, Docker and Kubernetes

This is a playground application created with goal of applying full cycle software development using popular technologies like Python, Redis, Docker and Kubernetes.

Lucas Fusinato Zanis 7 Nov 10, 2022
Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL.

Have you ever wondered: Where does this link go? The REDLI Tool follows the path of the URL. It allows you to see the complete path a redirected URL goes through. It will show you the full redirection path of URLs, shortened links, or tiny URLs.

JAYAKUMAR 28 Sep 11, 2022
A URL builder for genius :D

genius-url A URL builder for genius :D Usage from gurl import genius_url

ꌗᖘ꒒ꀤ꓄꒒ꀤꈤꍟ 12 Aug 14, 2021
declutters url lists for crawling/pentesting

uro Using a URL list for security testing can be painful as there are a lot of URLs that have uninteresting/duplicate content; uro aims to solve that.

Somdev Sangwan 677 Jan 7, 2023
a url shortener project from semicolonworld

Url Shortener With Django Written by Semicolon World

null 3 Aug 24, 2021
find all the URL of a site with a specific Regex

href this program will find all the link with a spesfic Regex pattern from a site. what it will do in any site there are a lots of url that may you ne

Arya Shabane 12 Dec 5, 2022
python3 flask based python-url-shortener microservice.

python-url-shortener This repository is for managing all public/private entity specific api endpoints for an organisation. In this case we have entity

Asutosh Parida 1 Oct 18, 2021
A python code for url redirect check

A python code for url redirect check

Fayas Noushad 1 Oct 24, 2021
A url redirect status check module for python

A url redirect status check module for python

Fayas Noushad 2 Oct 24, 2021
URL Shortener in Flask - Web service using Flask framework for Shortener URLs

URL Shortener in Flask Web service using Flask framework for Shortener URLs Install Create Virtual env $ python3 -m venv env Install requirements.txt

Rafnix Guzman 1 Sep 21, 2021
Use this module to detect if a URL is on discord's phishing list.

PhishDetector This module was made so you can check a URL and see if it's in discord's official list of phishing and suspicious URLs. Installation pip

Elijah 4 Mar 25, 2022
A url shortner written in Flask.

url-shortener-elitmus This is a simple flask app which takes an URL and shortens it. This shortened verion of the URL redirects to the user to the lon

null 2 Nov 23, 2021