Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

urlparse3

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

urlparse3

urlparse3 is simple and powerful url parsing tool

  • 1.1
  • PyPI
  • Socket score

Maintainers
1

urlparse3

Urlparse3 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#anchor

Changes:

  • Version 1.0.4. Fix parsing url path with slashes
  • Version 1.0.5. Fix parsing url query with slashes
  • Version 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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc