{"id":47793799,"url":"https://github.com/pennocktech/mutable_url.py","last_synced_at":"2026-04-03T16:01:27.199Z","repository":{"id":346393975,"uuid":"1189683460","full_name":"PennockTech/mutable_url.py","owner":"PennockTech","description":"Python package mutable_url","archived":false,"fork":false,"pushed_at":"2026-03-23T16:50:20.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-24T14:29:39.277Z","etag":null,"topics":["mutable","python","url"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PennockTech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-23T15:08:04.000Z","updated_at":"2026-03-23T16:49:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/PennockTech/mutable_url.py","commit_stats":null,"previous_names":["pennocktech/mutable_url.py"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/PennockTech/mutable_url.py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PennockTech%2Fmutable_url.py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PennockTech%2Fmutable_url.py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PennockTech%2Fmutable_url.py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PennockTech%2Fmutable_url.py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PennockTech","download_url":"https://codeload.github.com/PennockTech/mutable_url.py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PennockTech%2Fmutable_url.py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31362679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T15:19:21.178Z","status":"ssl_error","status_checked_at":"2026-04-03T15:19:20.670Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mutable","python","url"],"created_at":"2026-04-03T16:00:41.545Z","updated_at":"2026-04-03T16:01:26.859Z","avatar_url":"https://github.com/PennockTech.png","language":"Python","readme":"mutable_url.py\n==============\n\nThis repository holds the source for the `mutable_url` Python package.\n\nThis provides one utility class, `MutableURL`.\n\nIt also has one hook-point, `configure_idna`, to allow callers to opt into\nusing correct modern DNS internationalised hostnames; the default is to use\nonly the IDNA support in Python stdlib, which is out of date _but_ usually\ngood enough.\n\n```python\nfrom mutable_url import MutableURL\n\nu = MutableURL('http://www.example.org/hum')\nu.scheme = https\n\nprint(u)\ncall_func_wanting_url(u.url)\n\nu2 = MutableURL.from_parts(scheme='https', host='www.example.com',\n                           query_params={'foo': 'bar', 'baz': '3'})\n```\n\nThe `from_parts` class-method constructor requires keyword invocation.  You\ncan start with an empty URL.  There is no default scheme.  At present, the\nquery_params values must be strings.\n\nA `MutableURL` can be reconstructed into a string form via `str()` or by using\nthe `.url` property (which just does that for you). This is the most stable\ninterface for passing into other URL handling classes: I haven't found any\nother intermediate representation for cross-API compatibility worth the added\ncomplexity.\n\nThe Authority section is supported, including further virtualized accessors to\nallow individual access to `username` and `password` fields.  Either one can\nbe empty, to support auth schemes which only use one or the other (such as\nissued tokens provided as a password for an empty user).\n\nThe hostname part has two forms, which differ only when IDNA\ninternationalisation is in play:\n * `host`: the on-the-wire ASCII form (ACE), which is also what appears in the URL\n * `hostname`: the presentation-layer form, as UTF-8\n\nThere are multiple accessors for query parameters handling:\n * `query_params`: a simple `dict` view which assumes keys are not repeated\n * `query_params_multi`: a dict where the value is a list of strings, one for\n   each instance\n * `query_params_list`: a list of `(key,value)` tuples.\n\nFragments are supported.\n\n## AI Disclosures\n\nThe original implementation of `MutableURL` was written by a human and\ncommitted to a private repository on 2018-04-27.\nThat initial version depended upon `urllib3` (by way of `requests`).\n\nOn 2026-02-18, Anthropic's Claude was used to rewrite the implementation; the\ncode was subjected to thorough human code-review and there were many\niterations as aspects were refined.  The goal was to move to only depending\nupon the Python stdlib, to add more accessors (for compatibility with API\nexpectations of _both_ `urllib` _and_ `urllib3`), and to add tests.  Along the\nway, we also collected IDNA support, while keeping the default as stdlib-only.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpennocktech%2Fmutable_url.py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpennocktech%2Fmutable_url.py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpennocktech%2Fmutable_url.py/lists"}