Saravanan666/pypi-org huggingface dataset:
Package: url-strip
Url Strip 0.2.1A library for stripping urls of tracking and bloatNon PythonicUsage was designed around typesafety and zero runtime surprises, so instead of raising exceptions, url_strip will return exceptions instead of results, this library works best with a typechecker because of thisUsageSome basic usage. These examples are all runnable and meet typing standards.Using is_instance and unwrap"""Uses is_instance and unwrap to parse a url"""fromurl_stripimportOk,strip_url# Ok and Err provide the same 3 methods with fully typed outcomes for a Result[T, E]:#  is_instance will TypeGuard the result to the variant#  get will return an Optional[T] of the variant#    (and is not suitable for cases where T or E are None)#  unwrap with return the requested variant or raise an exceptionifOk.is_instance(v:=strip_url("https://youtube.com/watch?v=dQw4w9WgXcQ""&trackerinfo=youraddresshere&mldata=whattimeyouwokeupthismorning")):# using unwrap is runtime safe here as we just typeguarded it is an Ok varianturl=Ok.unwrap(v)# strip_url returns a Result[HttpUrl, UrlError], and HttpUrl provides a into_str method#  to get what most people expect as a final outputvalue=url.into_str()print(value)# -> https://youtu.be/dQw4w9WgXcQelse:...# Insert error handling hereUsing get"""Uses get and a None check to parse an invalid url"""fromurl_stripimportstrip_url,Ok,Errif(v:=Ok.get(result:=strip_url("foo")))isnotNone:v.into_str()else:raiseErr.unwrap(result)Writing extra domain rules"""Uses register to add foo.com as a checked domain"""fromurl_stripimportUrlError,Ok,Err,StripFuncResult,HttpUrl,register@register(domain="foo.com")deffoo_com_strip(# pyright: ignore[reportUnusedFunction]url:HttpUrl)->StripFuncResult:# ('ok', HttpUrl) | ('err', UrlError)ifurl.path=="/failure":returnErr(UrlError("This is an awful failure state"))returnOk(url)# dont change url at all, its perfect as isPopular Websites SupportedSome popular websites have pre-register'd rules, while any non registered websites will go to a default query stripperThe pre registered domains are as follows:SiteDomainsamazonwww.amazon.com,www.amazon.co.ukebayebay.com,www.ebay.com,www.ebay.co.uk,www.ebay.it,www.ebay.deredditwww.reddit.comtiktokwww.tiktok.com,vm.tiktok.comtwittertwitter.comyoutubeyoutube.com,www.youtube.com
Package: url-summary
Show summary of a large number of URLs in a Jupyter Notebook: analyze domains, paths, query keys and values.
This is useful if you want to have a quick glance at URLs obtained by crawling.InstallationInstall from PyPI:pip install url-summaryUsageimport url_summary

url_summary.get_summary(urls)Will show as a summary for a given list (or iterable) of urls.top_items(20 by default) controls how many top-level items to show,
andtop_urls(3 by default) sets the number of random urls to show
for each top-level item.Returned objecturl_summary.UrlSummaryResultis a list subclass with a nice Jupyter Notebook display.LicenseLicense is MIT.
Package: urltest
#!/usr/bin/env pythonfrom example_app import applicationfrom urltest import verify_urlsif __name__ == "__main__":urls = ({'url':"/", 'code':200},{'url':"/bob", 'code':200},{'url':"/jim", 'code':404},{'url':"/jim", 'method': "POST", 'code':405},)verify_urls(urls, application)
Package: url-test
url-testThis library scan a directory for all urls and test if any of them is invalidLocal Installmentpip install -e ''
pip install -e ~/Documents/Johan/url-testLinkshttps://python-packaging.readthedocs.io/en/latest/command-line-scripts.htmlTODOAdd ability to whitelist filesAdd ability to whitelist urlsParallelize the job to speed it upAdd ability to pick if it should throw a error os simply log outClean up the history of the branch so it start from empty!RenameBroken test linkhttps://github.com/FortAwesome/Font-Awesome-Pro/issues
Package: urltesting
urltestingURLs testing tool.UsageC:\test\httptest>python urltesting.py simpleurls --help
Usage: urltesting.py simpleurls [OPTIONS]

  Test urls. Urls are fetched from an url.

Options:
  --listurl TEXT                  The url where to get all the urls.
                                  [required]

  --listurl-method TEXT           Request method. Default to GET.
  --listurl-param TEXT            Request parameter in format key=value. Can
                                  be applied mutiple times.

  --listurl-header TEXT           Request header in format
                                  header_name=header_value. Can be applied
                                  multiple times.

  --listurl-payload TEXT          Request payload.
  --list-format [list|jsonarray|json]
                                  The format of "--listurl" response content.
                                  "list" means every url per line. "jsonarray"
                                  means response content likes: ["/url1/",
                                  "url2"]. "json" means response likes:
                                  {"data": "urls": ["/url1", "url2"]}. Default
                                  to "list".

  --list-json-path TEXT           If "--list-format=json", use the path to get
                                  urls from the json data, e.g. "--list-json-
                                  path=data.urls" when the response content is
                                  {"data": {"urls": ["/url1/", "/url2/"]}}. If
                                  url string is NOT starts with http, the
                                  entry url "--listurl" will be used to make
                                  the final url with "urljoin" method.

  --loginurl TEXT                 Login url. [Optional]
  --loginurl-method TEXT          Request method. Default to GET.
  --loginurl-param TEXT           Request parameter in format key=value. Can
                                  be applied mutiple times.

  --loginurl-header TEXT          Request header in format
                                  header_name=header_value. Can be applied
                                  multiple times.

  --loginurl-payload TEXT         Request payload.
  --help                          Show this message and exit.Releasesv0.1.0 2021/01/05First release.
Package: urltk
UrltkDescription:urltkCommands:Install Poetry:python3 -m pip install poetryBuild Package:python3 -m poetry buildPublish Package:python3 -m poetry publish -u  -pInstall Locally:python3 -m pip install urltk==1.0.1Build And Publish Package:python3 -m poetry build;python3 -m poetry publish -u  -pBuild Package; Publish Package; Install Package:python3 -m poetry build;python3 -m poetry publish -u  -p ;python3 -m pip install urltk==1.0.1
Package: url-to-desktop
url-to-desktopIt is a command line software through which you can convert .url files, used in Windows, into .desktop files used in linux.Installationurl-to-desktop is available on PyPI. You can install url-to-desktop by pip command:pip3installurl-to-desktopUsageExample -To convert in the current directoryurl-to-desktopTo convert in a specific directoryurl-to-desktop/path/ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.LicenseIf you like the project, support us by star
Package: urlToHTML
urlToHTMLSave your favorite site, blog, html in just two lines of code.This is an example project that is used to demonstrate how to publish Python packages on PyPI. To take a look at the step by step guide on how to do so, make sure you read my article on my personal blog.Installingpip install urlToHTMLUsageurl = 'https://blog.octachart.com/how-to-deploy-a-docz-site-on-render'

from urltohtml import Blog 
new = Blog().save(url, "file")You don't have to add file extension to the second parameter.So running the script automatically createsfile.htmlðŸŒŸ â™¥ Hope You Found This Useful ðŸŒŸ â™¥
Package: urltree
This package provides a tree-oriented URL router.  Most URL routers
operate by matching a URL against a list of regular expressions until
they find one that matches, but this has obvious performance penalties
if there are many routes.URLTreeis different; routes are stored
as a tree, and matching a URL against the set of routes is equivalent
to traversing the tree.TheURLTreerouter supports parameters, and even allows parameter
values to be matched against regular expressions or converted by
functions.  Moreover, as long as these “restrictions” and the variable
names are different, several of these parameters can be declared at
the same level of a URL tree; this allows a URL with, say, an integer
in one location to be mapped to one destination, while a second URL
with non-integer values in that same location may be mapped to another
destination.To useURLTree, allocate aURLTreeobject and use theURLTree.route()method to map a URL pattern to a destination, like
so:mapper = URLTree()
mapper.route("/article", list_articles, "get")
mapper.route("/article", create_article, "post")
mapper.route("/article/{id}", get_article, "get", id=int)
mapper.route("/article/{id}", update_article, "put", id=int)
mapper.route("/article/{id}", delete_article, "delete", id=int)Upon receiving a request, the destination and the parameters can be
retrieved using theURLTree.resolve()method, like so:# "req.method" is the HTTP method, and "req.url" is the requested
# URL
dest, params = mapper.resolve(req.method, req.url)Note thatURLTreedoes not interpret the destination; the examples
above use callables, but anything can be used here.
Package: url-tricks
URL Tricks (Python Package)Tricks that can be done with urls of popular sites. Currently, under development.Examples of How To UseGoogleGoogle Drive Downloadable URL# Gives a downloadable url of a shared url in Google Drivefromurl_tricksimportGoogleUrlTricksgut=GoogleUrlTricks()gut.downloadable_drive_url("https://drive.google.com/file/d/<some_code_from_google_drive>/view?usp=sharing"Google Drive Web Viewer URL# Gives a web viewer url of a shared url in Google Drivefromurl_tricksimportGoogleUrlTricksgut=GoogleUrlTricks()gut.web_viewer_drive_url("https://drive.google.com/file/d/<some_code_from_google_drive>/view?usp=sharing"Google Docs Previewable URL# Gives a previewable url of a shared url in Google Docsfromurl_tricksimportGoogleUrlTricksgut=GoogleUrlTricks()gut.previewable_docs_url("https://docs.google.com/document/d/<some_code_from_google_docs>/edit")Google Docs Templatable URL# Gives a templatable url of a shared url in Google Docsfromurl_tricksimportGoogleUrlTricksgut=GoogleUrlTricks()gut.templatable_docs_url("https://docs.google.com/document/d/<some_code_from_google_docs>/edit")Google Docs Exportable URL# Gives a exportable url of a shared url in Google Docs / Google Sheetsfromurl_tricksimportGoogleUrlTricksgut=GoogleUrlTricks()# Some possible values for "export_type" is "pdf", "odt" and "docx"# exportable_sheets_url would do the same functionalitygut.exportable_docs_url("https://docs.google.com/document/d/<some_code_from_google_docs>/edit","odt")DeveloperName:Banura Randika PereraLinkedin:randika-banuraEmail:randika.banura@gamil.comBsc (Hons) Information Technology specialized in Software Engineering (SLIIT)
Package: urlunshort
IntroductionUrlunshort un-shortens URLs that have been created using a URL shortening
services, like tinurl.com, bit.ly etc.ExamplesResolve a short URL to a target URL>>> from urlunshort import resolve
>>> resolve("http://bit.ly/qlKaI")
'http://bitbucket.org/runeh/urlunshort/'Check if URLs are shortened>>> from urlunshort import is_shortened
>>> is_shortened("http://bit.ly/qlKaI")
True
>>> is_shortened("http://www.opera.com")
FalseContactAuthor: Rune Halvorsen <runefh@gmail.com>
Web site and issue tracker:http://bitbucket.org/runeh/urlunshort/Bug reports and patches appreciated.ChangelogSee CHANGELOG fileHome page and bug tracker:http://bitbucket.org/runeh/urlunshortLicense:
BSD license. See the LICENSE file in the top level of the distribution
Package: urlunshort3
I found this pacakage which did exactly what I needed but in Python2https://pypi.org/project/urlunshort/. I updated the code and moved the web logic to requests to simplify some things.Some URLs for shortening came fromhttps://gist.github.com/ninetyfivenorth/9322bfc20523ba2eb7521d57cf25f265.This should handle many services reasonably, but I found a few that don’t respond normally to a HEAD requests and the tricks=True argument might help with some of those cases.
Package: urlwait
I needed a way to block my app from starting until the database service was running and
accepting connections. This was particularly a problem when using Docker and docker-compose.
You can run this utility as part of arun-dev.shorrun-tests.shscript and it will
block for 15 seconds (configurable) until it can connect to the hostname and port as specified
in your connection URL (gleaned from DATABASE_URL environment variable by default).Installation$ pip install urlwaitUsage$ urlwait --help

Usage:

    $ urlwait [SERVICE URL] [TIMEOUT]

    SERVICE URL is a connection url, e.g. a typical value for $DATABASE_URL. TIMEOUT is
    a number of seconds to try to connect to the host and port specified in the SERVICE
    URL. These values may also be specified in environment variables, but command line
    args take precedence:

        URLWAIT_VARNAME: the env var name containing the URL to check. Default DATABASE_URL.
        URLWAIT_TIMEOUT: the number of seconds to wait. Default 15.

    Returns a 0 status if the connection completed successfully before the timeout, or 1 if not.
    It is designed for use with Docker or other dev or testing environments where the connected
    services and the app are started simultaneously, but one should wait for the other.

Examples:

    The following are equivalent:

    $ urlwait redis://localhost:6379/0 20
    $ urlwait $CACHE_URL 20
    $ URLWAIT_VARNAME=CACHE_URL URLWAIT_TIMEOUT=20 urlwaitThe module is also usable in your python code:import os

from urlwait import wait_for_url


if wait_for_url(os.getenv('REDIS_URL')):
    # do things with the service
else:
    # service likely did not startIf you don’t have the service URL but do have the host and port, you can use thewait_for_service(host, port, timeout)function instead.Python SupportSince version 1.0 urlwait is Python 3 only. If you need Python 2.7 support you can use a pre 1.0 release.Changelog1.0 - 2020-02-28
* Close the socket to keep Python from complaining. Thanks @callahad!
* Update tests to only test on Python 3.6+
* Drop support for Python 2.x0.4 - 2017-03-02 - Always return true if protocol is sqlite
Package: url-widget
url_widgetA custom jupyter widget that provides thecurrent url of the notebookInstallationYou can install usingpip:python-mpipinstallurl_widgetIf you are using Jupyter Notebook 5.2 or earlier, you may also need to enable
the nbextension:jupyternbextensionenable--py[--sys-prefix|--user|--system]url_widgetDevelopment InstallationCreate a dev environment:condacreate-nurl_widget-dev-cconda-forgenodejsyarnpythonjupyterlab
condaactivateurl_widget-devInstall the python. This will also build the TS package.python-mpipinstall-e".[test, examples]"When developing your extensions, you need to manually enable your extensions with the
notebook / lab frontend. For lab, this is done by the command:jupyter labextension develop --overwrite .
yarn run buildFor classic notebook, you need to run:jupyter nbextension install --sys-prefix --symlink --overwrite --py url_widget
jupyter nbextension enable --sys-prefix --py url_widgetNote that the--symlinkflag doesn't work on Windows, so you will here have to run
theinstallcommand every time that you rebuild your extension. For certain installations
you might also need another flag instead of--sys-prefix, but we won't cover the meaning
of those flags here.How to see your changesTypescript:If you use JupyterLab to develop then you can watch the source directory and run JupyterLab at the same time in different
terminals to watch for changes in the extension's source and automatically rebuild the widget.# Watch the source directory in one terminal, automatically rebuilding when neededyarnrunwatch# Run JupyterLab in another terminaljupyterlabAfter a change wait for the build to finish and then refresh your browser and the changes should take effect.Python:If you make a change to the python code then you will need to restart the notebook kernel to have it take effect.
Package: urlx
UrlXurlx- provide new data type -Url.
The purpose of this package is to standardize URL declaration in the codebase.
This approach should reduce the number of errors and speed up code writing.ExamplefrompathlibimportPathfromurlximportUrl,Protocol,Porturl=Url(protocol=Protocol.HTTPS,host='localhost',port=Port.HTTPS_443,path=Path('api/user-list'),query={'limit':'100','skip':'20',},)print(url)Output:https://localhost:443/api/user-list?limit=100&skip=20LinksSource code:github.com/VolodymyrBor/urlxDocumentation:urlxChangelog:changelog
Package: urly
Sometimes it feels like working with URLs is harder than it should be. Urly is a little wrapper around the werkzeug URL class to make things easy and pleasant. One module to pip install, one import, and then everything is easy. For instance:>>>fromurlyimportURL>>>url=URL('http://example.com/old/path?a=b')>>>url.path='/new/path'>>>url.add_param('a','c')>>>print(url)http://example.com/new/path?a=b&a=c>>>print(url.relative_url)/new/path?a=b&a=cCommon tasks like changing a path, adding a parameter, and getting the relative URL, are all simple.Urly also lets you parse URLs the way a browser would. For instance:>>>url=URL('example.com',parse_like_browser=True)>>>print(url)http://example.comDocumentationFull documentation is athttps://urly.readthedocs.org.InstallSimply install withpip:$ pip install urly
Package: urlz
urlzurlz is a simple URL parsing library that provides Pathlib-like usage to URLs in Python:>>>>fromurlzimportURL>>>>url=URL("https://wordbrew.io")>>>>str(url/"about"/"index.html")'https://wordbrew.io/about/index.html'It also provides a special URL-building functionurlify:>>>>fromurlzimporturlify>>>>urlify("https://wordbrew.io","about","index.html")'https://wordbrew.io/about/index.html'# with querystring params:>>>>urlify("https://wordbrew.io","search",params={"q":"hello world"})'https://wordbrew.io/search?q=hello+world'Installationpip install urlzTODOQS param helpersPath replacements (e.g.url.replace(path="/new/stuff/"))Validation helpersAlternativesFor more URL-parsing fun, check out these libraries:furlpurlimurl
Package: urmarketscraper
Urban Rivals Market ScraperCollects market offers for Urban Rivals.Install fromhttps://pypi.org/project/urmarketscraper/This is a screen scraper utility forUrban Rivals.To use, callmarket.get_market_offersThe first parameter is therequests.Session()object which contains a logged-in
user. The second parameter is the list ofidsfor the characters in question.
The third parameter is an optional override for what what the base market address
is. Default ishttps://www.urban-rivals.com/market/?. Any url given here must end
with a?so that the URL encoding can complete correctly.Basic Usage ExampleFull DocumentationExample>>>fromurmarketscraperimportmarket>>>market.get_market_offers(session,["1462","1463"])Returns:{"1462":{"_Offer__id":1462,"_Offer__level_price_dict":{"1":"799","4":"799"}},"1463":{"_Offer__id":1463,"_Offer__level_price_dict":{"2":"27887"}}}
Package: urm-validatetoken
Method validate_token() takes four required parameters and returns two values.syntax: <TOKEN_VALIDATION_STATUS>, <TOKEN_STATUS> = urm_validatetoken.validate_token(<REQUEST_METHOD>,<VALIDATE_TOKEN_URL>,<ACCESS_TOKEN>,<CONTENT_TYPE>).<REQUEST_METHOD>: POST, PUT, GET, PATCH, etc.
<VALIDATE_TOKEN_URL>: url of validate_token api.
<ACCESS_TOKEN>: unique access token for authorization.
<CONTENT_TYPE>: for ex. application/json.
<TOKEN_VALIDATION_STATUS>: validation status description.
<TOKEN_STATUS>: it may contain value True or False or status_code(403 or 401).
Package: urnai
URNAI Tools is a modular Deep Reinforcement Learning library that supports multiple environments, such as PySC2, OpenAI Gym, and PyGame Learning Environment. The main goal of URNAI Tools is to provide an easy way to develop DRL agents in a way that allows the developer to reuse as much code as possible when developing different agents, and that also allows him to reuse previously implemented models in different environments and to integrate new environments easily when necessary. The main advantage of using URNAI Tools is that the models you make for one environment will also work in other environments, so you can prototype new agents for different environments very easily.
Package: urnc
URNCUni Regensburg Notebook ConverterInstallationpipinstallurncOr update from an older version:pipinstallurnc--upgradeUsage# Clone example course and change into course directorygitclonehttps://github.com/spang-lab/urnc-example-coursecdurnc-example-course# Convert a single notebook to student versionurncconvertassignments/sheet1.ipynbstudent/sheet1.ipynb# Convert all assignment notebooks to student versionsurncconvertassignments# Convert all assignment notebooks to student version, pull student repo and# copy over converted notebooksurncstudentYou can find a more detailed introduction to URNC at pageUsageof URNC'sDocumentation Website.DocumentationYou can find the full documentation for URNC atspang-lab.github.io/urnc. Amongst others, it includes chapters about:InstallationUsageModulesContributingTestingDocumentationChangelog
Package: urnparse
urnparsePython library for generating and parsingRFC 8141compliant uniform
resource names (URN).InstallationTo use this library in your project, install it with pippipinstallurnparseUsageCreate URN object from RFC 8141 formatted stringTo validate a given URN string against the RFC 8141 specification and construct
an URN object from it, use theURN8141.from_string()method:fromurnparseimportURN8141urn_string='urn:example:example.org:resources:'+\'example%20resource?+res1=a'+\'?=param1=test&param2=test2#example.org'urn=URN8141.from_string(urn_string)You can then access the specific URN components:print(urn.namespace_id)# exampleprint(urn.specific_string.decoded)# example.org:resources:example resourceprint(urn.specific_string.parts)# ['example.org', 'resources', 'example resource']print(urn.rqf_component.resolution)# {'res1': 'a'}print(urn.rqf_component.query)# {'param1': 'test', 'param2': 'test2'}print(urn.rqf_component.fragment)# example.orgCreate URN string from component objectsTo create an RFC 8141 formatted URN string for a certain resource, construct the URN
object from the following components:fromurnparseimportURN8141,NSIdentifier,NSSString,RQFComponentnid=NSIdentifier('example')nss=NSSString('example.org:resources:example%20resource',encoded=True)rqf=RQFComponent(resolution_string='res1=a',query_string='param1=test&param2=test2',fragment='example.org')urn=URN8141(nid=nid,nss=nss,rqf=rqf)print(urn)# urn:example:example.org:resources:example%20resource?+res1=a?=param1=test&param2=test2#example.org