Saravanan666/pypi-org huggingface dataset:
Package: urllib_kerberos
# urllib_kerberos## Usage### Python 2```import urllib2import urllib_kerberoshandlers.append(urllib_kerberos.HTTPKerberosAuthHandler())opener = urllib2.build_opener(*handlers)urllib2.install_opener(opener)request = urllib2.Request(url, data)```### Python 3```import urllib.requestimport urllib_kerberoshandlers.append(urllib_kerberos.HTTPKerberosAuthHandler())opener = urllib.request.build_opener(*handlers)urllib.request.install_opener(opener)request = urllib.request.Request(url, data)```## CreditsTim Olsen was the original author of `urllib2_kerberos`[library](https://bitbucket.org/tolsen/urllib2_kerberos)which is the bulk of the content of the `urllib_kerberos`module.
Package: urllib-s3
# urllib_s3urllib_s3 is a urllib handler for s3 protocol## Usageinstall library```bashpip install urllib_s3``````pythonfrom six.moves.urllib.request import urlopenimport urllib_s3server_settings = {'server-url': {'access_key': 'xx','secret_key': 'xxx','secure': True}}urllib_s3.setup(server_settings)# now you use s3 protocolurlopen('s3://server-url/bucket/foo.png')```
Package: url-location
url_locationThis library can be used to retrieve the country a URL belongs to by processing its domain.Usagefromurl_locationimportURLLocationurl="https://www.exampleurl.com.ec/something-else"ul=URLLocation()country=ul.processUrl(url)print(country)OutputECUWhen a URL can´t be processed the result will be  like bellow:url="https://www.exampleurl.com/something-else"ul=URLLocation()country=ul.processUrl(url)print(country)OutputNone
Package: urlman
A nicer way to do URLs for Django models.Replaces things likeget_absolute_urlwith a.urlsattribute that
can reference other URLs and build sensible trees of things, and can
then be accessed usinginstance.urls.name.This is so you can have URLs on your model instances directly (rather than reversing
through the url lookup functions, which is not only slow but often hard to supply
arguments to). You can just throw{{ instance.urls.view }}into a template to get
a link.It also lets you use Python string formatting syntax to place arguments into URLs from
the model instance itself or from other URLs in the same set.Example:importurlmanclassGroup(models.Model):...classurls(urlman.Urls):view="/{self.slug}/"users="{view}users/"admin="{view}admin/"defmy_view(request):group=...returnredirect(group.urls.view)It’s suggested that you use “view” as the equivalent name forget_absolute_url, and have a function like this on your model:defget_absolute_url(self):returnself.urls.viewTo build a full URL use thefullmethod like this:defmy_view(request):group=...returnredirect(group.urls.admin.full(scheme='https'))You can implement theget_scheme(url)andget_hostname(url)methods on yourUrlclass to change your default theme and hostname from the urlman defaults
of‘http’and‘localhost’, respectively.If you use Django REST Framework, you can useurlman.UrlManFieldto provide
an object with a set of URLs. It is used like this (only theurlsparameter
is required):fromurlman.serializersimportUrlManFieldclassMySerializer(ModelSerializer):urls=UrlManField(urls=['view','edit'],attribute='urls',full=True)
Package: urlmap
Yet another library to map URLs to Python objects and get parameters.
This is designed to be as lightweight as possible. Please fork, but merge requests that add new “features” are likely to be rejected.LicenseCopyright (c) 2012 Benjamin SherrattPermission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Package: url-marshall
URL MarshallOverviewTheURL Marshallscript takes a list of URLs as input, parses them, and generates a list of unique endpoint URLs by progressively removing path components from each original URL.PrerequisitesMake sure you have Python installed on your system.InstallationNo specific installation is required.How to RunInstall Pip Packagepipinstallurl_marshallRun the script with the required arguments:urlmarshal-lpath/to/input.txt-opath/to/output.txt-lor--list: Path to the input file containing a list of URLs.-oor--output: Path to the output file where the unique endpoint URLs will be stored.Using in programsfromurl_marshallimporturl_marshallinput_file="path/to/input.txt"output_file="path/to/output.txt"url_marshall(input_file,output_file)
Package: urlmatch
Useurlmatchto verify that URLs conform to certain patterns. The
library and match patterns are based heavily on theGoogle Chrome
Extension match
patterns.Usagefromurlmatchimporturlmatchmatch_pattern='http://*.example.com/*'urlmatch(match_pattern,'http://subdomain.example.com/')# Trueurlmatch(match_pattern,'http://sub.subdomain.example.com/')# Trueurlmatch(match_pattern,'https://example.com/')# Falseurlmatch(match_pattern,'http://bad.com/')# FalseOptionsThere are a few options that affect how the match patterns work.path_required(default is True) - aboolwhich dictates
whether the match pattern must have pathfuzzy_scheme(default is False) - aboolwhich dictates
whether the scheme should be matched “fuzzily.” if this is true, then
any valid scheme (*,http,https) will match bothhttpandhttpshttp_auth_allowed(default is True) -boolwhich dictates
whether URLs with HTTP Authentication in the URL should be allowed or
notMatch pattern syntaxThe basic match pattern syntax is simple:<url-pattern> := <scheme>://<host><path>
<scheme> := '*' | 'http' | 'https'
<host> := '*' | '*.' <any char except '/' and '*'>+
<path> := '/' <any chars>Exampleshttp://*/*- matches any URL that uses the http schemehttps://*/*- matches any URL that uses the https schemehttp://*/test*- matches any URL that uses the http scheme and
has a path that starts withtest*://test.com/*- matches any url with the domaintest.comhttp://*.test.com- matchestest.comand any subdomain oftest.comhttp://test.com/foo/bar.html- matches the exact URLBugsIf you find an issue, let me know in the issues section!ContributingFrom theRubiniuscontribution page:Writing code and participating should be fun, not an exercise in
perseverance. Stringent commit polices, for whatever their other
qualities may bring, also mean longer turnaround times.Submit a patch and once it’s accepted, you’ll get commit access to the
repository. Feel free to fork the repository and send a pull request,
once it’s merged in you’ll get added. If not, feel free to bugjessepollakabout it.How To ContributeClone:git@github.com:jessepollak/urlmatch.gitCreate a topic branch:git checkout-bawesome_featureCommit away (and add unit tests for any code your write).Keep up to date:git fetch && git rebase origin/master.Run the tests:python setup.py testOnce you’re ready:Fork the project on GitHubAdd your repository as a remote:git remote add your_remote your_repoPush up your branch:git push your_remote awesome_featureCreate a Pull Request for the topic branch, asking for review.Once it’s accepted:If you want access to the core repository feel free to ask! Then you
can change origin to point to the Read+Write URL:git remote set-url origin git@github.com:jessepollak/urlmatch.gitOtherwise, you can continue to hack away in your own fork.
Package: url-matcher
URL matching library that relates URLs with resources. Rules are defined using
simple pattern definitions. It is simpler and faster than using regular expressions
if the rules involves many domains.To illustrate it with an example, imagine that you have several proxy servers and
you want to route requests to the right one. You could define the following rules:site1.com→︎us_proxysite2.com/uk→︎uk_proxysite2.com/ie→︎ie_proxyAll URLs fromsite1.comshould use the US proxy. The situation forsite2.comURLs are
different: if the path starts with/uk, then use the UK proxy, otherwise use the IE proxy.
This library allows to create a matcher that can be used to match URLs with the right proxy
using these rules.Have a look tohttps://github.com/zytedata/url-matcher/blob/main/url_matcher/example.pyfor an example of usage.The following files are useful to understand the pattern, the set of patterns and
how they behave:https://github.com/zytedata/url-matcher/blob/main/tests/fixtures/single_patterns.jsonhttps://github.com/zytedata/url-matcher/blob/main/tests/fixtures/patterns.jsonThe full documentation can be found athttps://url-matcher.readthedocs.io/License is BSD 3-clause.Documentation:https://url-matcher.readthedocs.io/Source code:https://github.com/zytedata/url-matcherIssue tracker:https://github.com/zytedata/url-matcher/issuesDevelopingSetup your local Python environment via:pip install-rrequirements-dev.txtpre-commitinstallNow everytime you perform agit commit, these tools will run against the staged files:blackisortflake8mypyYou can also directly invokepre-commitrun--all-filesto run them without performing a commit.Using sphinx-autobuildWhen working on documentation, it is convenient to use sphinx-autobuild.
First, runpip install-rdocs/requirements.txtsphinx-autobuild. Then runsphinx-autobuild docs docs/_build/htmland then openhttp://127.0.0.1:8000/in a browser, to see the current version
of docs. A process would be running in a background, watching for docs changes;
when docs are changed, a build is started, and the web page
is refreshed automatically when the build is finished.
Package: urlmon
urlmonWork in progress.Python script to monitor a webpage component for
changes.Free software: MITDocumentation: [STRIKEOUT:https://urlmon.readthedocs.org]FeaturesChecks for changes in a website (or list of websites) since last runSends a Pushover notification if there have been changesInstallationGet aPushover API token(and
youruserinfo) ```bash git clonehttps://github.com/n8henrie/urlmon.gitcd urlmon python3 -m venv venv
source venv/bin/activate pip install -r requirements.txt pip install
-e .Enter your Pushover API token:keyring set pushover api_tokenEnter your Pushover user:keyring set pushover user ```UsageTake single URL from stdin:echo'http://n8henrie.com'| python3 urlmon -Take multiple URLs from file:urlmon urls.txtHistory0.1.1 20151229First release on PyPI.
Package: urlnorm
urlnorm.pyNormalize a URL to a standard unicode representationurlnorm normalizes a URL by:lowercasing the scheme and hostnameconverting the hostname to IDN formattaking out default port if present (e.g.,http://www.foo.com:80/)collapsing the path (./, ../, etc)removing the last character in the hostname if it is ‘.’unquoting any % escaped characters (where possible)Installationpip install urlnormExample>>> import urlnorm
>>> urlnorm.norm("http://xn--q-bga.com./u/u/../%72/l/")
u'http://q\xe9.com/u/r/l/'
Package: url-normalize
url-normalizeURI Normalization function:Take care of IDN domains.Always provide the URI scheme in lowercase characters.Always provide the host, if any, in lowercase characters.Only perform percent-encoding where it is essential.Always use uppercase A-through-F characters when percent-encoding.Prevent dot-segments appearing in non-relative URI paths.For schemes that define a default authority, use an empty authority if the default is desired.For schemes that define an empty path to be equivalent to a path of "/", use "/".For schemes that define a port, use an empty port if the default is desiredAll portions of the URI must be utf-8 encoded NFC from Unicode stringsInspired by Sam Ruby'surlnorm.pyExample:$pipinstallurl-normalize
Collectingurl-normalize
...
Successfullyinstalledfuture-0.16.0url-normalize-1.3.3
$python
Python3.6.1(default,Jul82017,05:00:20)[GCC4.9.2]onlinux
Type"help","copyright","credits"or"license"formoreinformation.
>fromurl_normalizeimporturl_normalize
>print(url_normalize('www.foo.com:80/foo'))>https://www.foo.com/fooHistory:1.4.3: Added LICENSE file1.4.2: Added an optional param sort_query_params (True by default)1.4.1: Added an optional param default_scheme to the url_normalize ('https' by default)1.4.0: A bit of code refactoring and cleanup1.3.3: Support empty string and double slash urls (//domain.tld)1.3.2: Same code support both Python 3 and Python 2.1.3.1: Python 3 compatibility1.2.1: PEP8, setup.py1.1.2: support for shebang (#!) urls1.1.1: using 'http' schema by default when appropriate1.1.0: added handling of IDN domains1.0.0: code pep80.1.0: forked from Sam Ruby's urlnorm.pyLicense: MIT License
Package: url-obfuscate
# url_ofbuscateThis is a Django application that provides methods to obfuscate/deobfuscate URLs.## Quick startInstall using pip or easy_install$ pip install url-obfuscate$ easy_install url-obfuscateAdd "url_obfuscate" to your INSTALLED_APPS setting like this:INSTALLED_APPS = (...'url_obfuscate',)## UsageTo obfuscate Django's URLs, modify the URL declaration in the urls.py file by replacing the regex definition with the funcion generate_url_pattern, as follows:from url_obfuscate.helpers import generate_url_pattern...urlpatterns = patterns('views',url(generate_url_pattern('/'), 'home', name='home'),url(generate_url_pattern('obfuscated_link', params=['(?P<name>[^/]+)']), 'obfuscated_link', name='obfuscated_link'),)For the home URL, use / path. To include params in the URL, declare them in the desired order inside the params attribute. When obfuscating a URL with parameters, it is necessary to use the deobfuscate decorator to recover the original value of the parameter.from url_obfuscate.decorators import deobfuscate...@deobfuscatedef obfuscated_link(request, name):return render(request, 'obfuscate_result.html', { 'name': name })When declaring URLs with parameters inside templates, use the obfuscate template tag, as follows:{% load obfuscate %}...<p><a href="{% url 'obfuscated_link' 'Laura Manzur'|obfuscate %}">Obfuscated link: {% url 'obfuscated_link' 'Laura'|obfuscate %}</a></p>...If you need to obfuscate any value from inside a view, use the obfuscate function, as follows:from url_obfuscate.helpers import obfuscate...def home(request):links = list()for i in range(10):links.append(obfuscate('Name %d' % (i+1)))return render(request, 'index.html', { 'links': links })
Package: url-obfuscated
url_obfuscatedEasy and Simple method to obfuscate and deobfuscate your Django URLs.
Works with both normal urls as well as those with paramsQuick startInstall using pip or easy_install$ pip install url-obfuscated

$ easy_install url-obfuscatedAdd "url_obfuscate" to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'url-obfuscated',
)UsageTo obfuscate Django's URLs, modify the URL declaration in the urls.py file by replacing the regex definition with the funcion generate_url_pattern, as follows:from url_obfuscated.helpers import generate_url_pattern
.....

urlpatterns = [
    url(generate_url_pattern('/'), home, name='home'),
    url(generate_url_pattern('obfuscated_link', params=['(?P<name>[^/]+)']), obfuscated_link, name='obfuscated_link'),
    url(generate_url_pattern('optional_param', params=['(?:(?P<param>[^/]+)/)?']), optional_param, name='optional_param'),
]For the home URL, use / path. To include params in the URL, declare them in the desired order inside the params attribute. When obfuscating a URL with parameters, it is necessary to use the deobfuscate decorator to recover the original value of the parameter.from url_obfuscated.decorators import deobfuscate
...

@deobfuscate
def obfuscated_link(request, name):
    return render(request, 'obfuscate_result.html', { 'name': name })When declaring URLs with parameters inside templates, use the obfuscate template tag, as follows:{% load obfuscate_tags %}
...
<p><a href="{% url 'obfuscated_link' 'Dan Brown'|obfuscate %}">Obfuscated link: {% url 'obfuscated_link' 'Dan'|obfuscate %}</a></p>
...You can also obfuscate any value from inside a view, use the obfuscate function, as follows:from url_obfuscate.helpers import obfuscate
...

def home(request):
    links = list()
    for i in range(10):
        links.append(obfuscate('Name %d' % (i+1)))
    return render(request, 'index.html', { 'links': links })
Package: urlock
Urlock-pyUrlock-py is a python library for connecting to a running urbit ship.It consists of a single classUrlock. Methods are below.__init__(url, code)Constructor

`url` - url to the http interface of the running ship

`code` - the `+code` of the ship, should never be publishedconnect()Connect to the running shippoke(ship, app, mark, j)`ship` - ship to send the poke

`app` - gall application to send the poke to

`mark` - mark of data sent to the gall application

`j` - json poke dataack(eventId)Send an acknowledgment of receipt of a message so it's cleared from the ship's queue 

`eventId` - id of the event to acknowledgesse_pipe()returns the sseclient objectsubscribe(ship, app, path)`ship` - ship on which the gall application lives

`app` - gall application to subscribe to

`path` - path to subscribe onFollows is a simple script to send a message and subscribe to a chat channel. The specifics require an understanding of thechat-storeandchat-hookinterfaces.#!/usr/bin/python3

import urlock
import baseconvert
import time
import random
import dumper

zod = urlock.Urlock("http://localhost:8080", "lidlut-tabwed-pillex-ridrup")
r = zod.connect()
s = zod.subscribe("zod", "chat-store", "/mailbox/~/~zod/mc")

pipe = zod.sse_pipe()

s = baseconvert.base(random.getrandbits(128), 10, 32, string=True).lower()
uid = '0v' + '.'.join(s[i:i+5] for i in range(0, len(s), 5))[::-1]

p = zod.poke("zod", "chat-hook", "json", {"message": {"path": "/~/~zod/mc",
                                                      "envelope": {"uid": uid,
                                                                   "number": 1,
                                                                   "author": "~zod",
                                                                   "when": int(time.time() * 1000),
                                                                   "letter": {"text": "hello world!"}}}})


for m in pipe.events():
   dumper.dump(m)
   dumper.dump(zod.ack(int(m.id)))
Package: urlopen2
urlopen2DescriptionImprovement for theurllib.request.urlopenfunction.Installpipinstallurlopen2UsingSynchronousfromurlopen2importURLFileurl="https://example.com/file.bin"withURLFile.open(url)asurlfile:urlfile.read(128)# In this case, 128 bytes of the file will be loaded.urlfile.seek(0)# Move the caret to the beginning of the filedata=urlfile.read(128)# Since we are taking the same 128 bytes that have already been loaded, they will be received from the buffer.print(data)Asynchronousimportasyncioimportaiofilesfromurlopen2importAsyncURLFileurl="https://example.com/file.bin"asyncdefmain():asyncwithaiofiles.open(*AsyncURLFile.gbuf())asabuffer:asyncwithAsyncURLFile.open(url,abuffer)asaurlfile:awaitaurlfile.read(128)# In this case, 128 bytes of the file will be loaded.awaitaurlfile.seek(0)# Move the caret to the beginning of the filedata=awaitaurlfile.read(128)# Since we are taking the same 128 bytes that have already been loaded, they will be received from the buffer.print(data)if__name__=="__main__":asyncio.run(main())
Package: urlp
urlpA simple command-line utility for parsing URLs, written in Python. Inspired byurlp.$urlp--host"http://www.cnn.com/service/alert.jsp?s=cnn&v=a"www.cnn.com
$urlp--registered_domain"http://www.cnn.com/service/alert.jsp?s=cnn&v=a"cnn.com
$urlp--path"http://www.cnn.com/service/alert.jsp?s=cnn&v=a"/service/alert.jsp
$urlp--path-i0"http://www.cnn.com/service/alert.jsp?s=cnn&v=a"service
$urlp--query"http://www.cnn.com/service/alert.jsp?s=cnn&v=a"s=cnn&v=a
$urlp--query--query_field=s"http://www.cnn.com/service/alert.jsp?s=cnn&v=a"cnnurlp often works together with other unix command-line tools. For example:Find all hosts in urls, sorted by count.caturlfile|urlp--host|sort|uniq-c|sort-nr-k1,1Find all url path words (separated by "/"), sorted by count.caturlfile|urlp--path|tr/\\n|awk'$1!=""'|sort|uniq-c|sort-nr-k1,1Installpip install urlpUsage$ urlp --help
usage: urlp [-h] [--host] [-p] [-i path_index] [-q] [-k query_field] [-r]
            [urls [urls ...]]

A command line url parser

positional arguments:
  urls                  URLs to parse

optional arguments:
  -h, --help            show this help message and exit
  --host                hostname
  -p, --path            Path
  -i path_index, --path_index path_index
                        filter parsed path by index
  -q, --query           query string
  -k query_field, --query_field query_field
                        value for the specified query field
  -r, --registered_domain
                        registered domain
Package: url-param-sorted
NAMEurl-param-sorted - предоставляет функцию для cортировки параметров url в порядке их возрастанияVERSION0.0.2SYNOPSISfromurl_param_sortedimporturl_param_sortedurl_param_sorted('y=1&z=&x=2&x=3&z&x=1')# -> 'x=1&x=2&x=3&y=1&z&z='url_param_sorted({'y':1,'z':["",None],'x':[2,3,1]})# -> 'x=1&x=2&x=3&y=1&z&z='try:url_param_sorted([])# -> raise TypeError("Аргумент может быть только str или dict")exceptTypeErrorase:passDESCRIPTIONФункцияurl_param_sortedсортирует параметры url в порядке их возрастания.С библиотекой поставляется утилитаurl-param-sorted.$url-param-sorted'y=1&z=&x=2&x=3&z&x=1'x=1&x=2&x=3&y=1&z&z=INSTALL$pip3installurl-param-sortedREQUIREMENTSНетAUTHORKosmina O. Yaroslavdarviarush@mail.ruLICENSEMIT LicenseCopyright (c) 2020 Kosmina O. Yaroslav
Package: urlparse3
urlparse3Urlparse3 is simple and powerful url parsing tool.
Example:import urlparse3


url = 'http://admin:secret@local-domain.com:8000/path?q=123#anchor'
parsed_url = urlparse3.parse_url(url)
print parsed_url.scheme  # http
print parsed_url.username  # admin
print parsed_url.password  # secret
print parsed_url.domain  # domain.com
print parsed_url.port    # 8000
print parsed_url.path    # path
# query is converted into dictionary
print parsed_url.query  # {'q': '123'}
print parsed_url.fragment # anchor

# now add new GET parameter
parsed_url.query['name'] = 'alex'
# and get url back to string representation
print parsed_url.geturl()  #
http://admin:secret@local-domain.com:8000/path?q=123&name=alex#anchorChanges:Version 1.0.4. Fix parsing url path with slashesVersion 1.0.5. Fix parsing url query with slashesVersion 1.0.6. Fix urls with port. Add port property to ParsedUrl. Add test for check url with ports.Version 1.0.7. Fix urls with dashes. Add test.Version 1.0.8. Fix queries with dashes.Version 1.0.9. Fix queries with “@” and “+” symbols.Version 1.0.10. Fix url fragment regexp.Version 1.1. Query parameters retain the order in which they were added.
Package: urlparser
This is a simple command line tool for extracting pieces (such as the
scheme, port, or hostname) of a standard URL.Usage$urlparserhostnamehttp://google.comgoogle.com$urlparserhostnamegoogle.comgoogle.com$urlparserporthttp://google.com80$urlparserporthttps://google.com443$urlparserporthttps://example.com:94439443$urlparserschemehttps://google.comhttpsHelpUsage: urlparser [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  fragment  Get fragment from URL
  hostname  Get hostname from URL
  netloc    Get netloc from URL
  params    Get params from URL
  password  Get password from URL
  path      Get path from URL
  port      Get port from URL
  query     Get query from URL
  scheme    Get scheme from URL
  username  Get username from URL