{"id":24477,"library":"pyuri","title":"pyuri","description":"pyuri is a Python library for proper URI parsing and manipulation. It fully conforms to RFC 3986 and provides a clean API for working with URIs. Current version 0.3.1 is stable but in maintenance mode; releases are infrequent.","status":"active","version":"0.3.1","language":"python","source_language":"en","source_url":"https://github.com/nick-allen/pyuri","tags":["URI","RFC 3986","parsing","manipulation"],"install":[{"cmd":"pip install pyuri","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Standard import path; no common mistakes.","wrong":null,"symbol":"URI","correct":"from pyuri import URI"}],"quickstart":{"code":"from pyuri import URI\n\nuri = URI('http://example.com/path?q=test')\nprint(uri.scheme)  # http\nprint(uri.host)    # example.com\nprint(uri.path)    # /path\nprint(uri.query)   # q=test\nprint(uri.authority)  # example.com","lang":"python","description":"Parse and access components of a URI."},"warnings":[{"fix":"Upgrade to Python 3.6+ and pyuri 0.3.1.","message":"Python 2 support was deprecated in 0.3.0. Use Python 3.6+.","severity":"deprecated","affected_versions":"<=0.2.1"},{"fix":"Use `new_uri = uri.replace(scheme='https')` to get a modified copy.","message":"URI objects are immutable; you cannot modify components in-place. Use `replace()` to create a new URI.","severity":"gotcha","affected_versions":"all"},{"fix":"Normalize manually if needed, e.g., using Python's `urllib.parse.urldefrag()` or external tools.","message":"The library does not normalize URI paths automatically. Trailing slash or relative paths are kept as-is.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `from pyuri import URI` instead of `from pyuri.uri import URI`.","message":"In 0.3.0, the `URI` class replaced the old `URI` from `pyuri.uri`. Old imports from `pyuri.uri` will fail.","severity":"breaking","affected_versions":">=0.3.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install version 0.3.1 and use `from pyuri import URI`.","cause":"Trying to import URI from a submodule that doesn't exist in older versions (pyuri <0.2.0 had different structure).","error":"ImportError: cannot import name 'URI' from 'pyuri'"},{"fix":"Upgrade to pyuri 0.3.1.","cause":"Using an older version (<0.2.0) that did not expose `authority`.","error":"AttributeError: 'URI' object has no attribute 'authority'"},{"fix":"Use the `replace()` method to create a modified copy.","cause":"Attempting to assign to a URI component directly (e.g., `uri.scheme = 'https'`).","error":"TypeError: 'URI' object does not support item assignment"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}