Release History¶
Unreleased¶
Breaking Changes¶
- removed support for Python versions before 3.10
datastructures.LinkHeaderis now immutable- converted positional Boolean parameters to keyword-only parameters
| Function | Parameter |
|---|---|
| parse_accept | strict |
| parse_content_type | normalize_parameter_values |
| parse_forwarded | only_standard_parameters |
| parse_link | strict |
Added¶
ietfparse.constantsmodule -- this contains constant ContentType instances- pre-commit utility usage
datastructures.LinkHeader.relproperty- indexed parameter lookup in
datastructures.LinkHeader datastructures.ImmutableSequencehelper classerrors.MalformedContentTypeexception explicitly identifies Content-Type parsing failures. It is a subclass ofValueErrorfor the sake of compatability.defaultparameter toalgorithms.select_content_type
Changed¶
headers.parse_linkchanged to honor the allow multiplemediaandtypeparameters as described in RFC-8288.datastructures.LinkHeaderchanged to combine multiple relationship type (rel) parameters into a single space-separated parameter as described in RFC-8288. Note that this is only relevant if you disable strict mode parsing.headers.parse_content_typechanged to raiseMalformedContentTypeerror instead ofValueError.datastructures.ContentTypeinstances can now be compared to stringsalgorithms.select_content_typechanged to accept strings as well asContentTypeinstances
Removed¶
- previously deprecated functions:
parse_http_accept_header,parse_link_header,parse_list_header,remove_url_auth,rewrite_url
Development environment changes¶
- replaced setuptools with uv
- introduced just
- switched from sphinx to zensical
- switch to the src layout
1.9.0 -- 2022-07-08¶
Deprecated¶
- using
len()on the return value fromalgorithms.remove_url_auth rewrite_urlandremove_url_auth. Use yarl instead. It is an awesome library and a more general solution.
Changed¶
algorithms.RemoveUrlAuthResultfrom a named tuple to a proper class.- Replace type hints with annotations.
Removed¶
ietfparse.compatmodule.- universal wheels
1.8.0 -- 2021-08-11¶
Removed¶
- support for Python versions before 3.7
1.7.0 -- 2020-11-04¶
Behavioural Change¶
headers.parse_accept used to fail with a ValueError when it encountered
an invalid content type value in the header. Now it skips the invalid value
instead. If you want the previous behaviour, then pass strict=True.
Added¶
- support for Python 3.7-3.9
Removed¶
- support for 3.4 and 3.5
Changed¶
- clarified that
headers.parse_content_typeraises aValueErrorwhen it encounters an invalid content type header headers.parse_acceptskips unparseable content types unless the newstrictkeyword parameter is truthy
1.6.1 -- 2020-01-26¶
Fixed¶
- corrected packaging metadata
1.6.0 -- 2020-01-25¶
Added¶
- typestubs
Changed¶
- switched from travis-ci to circle-ci
- allow "bad whitespace" around
=in link header parameter lists as indicated in RFC-8288 - replaced nosetests with python -m unittest
1.5.1 -- 2018-03-04¶
Added¶
- RFC-6839 content suffix support in
datastructures.ContentTypeandheaders.parse_content_type()
1.5.0 -- 2017-12-24¶
Deprecated¶
- the
normalized_parameter_valueskeyword parameter to theheaders._parse_parameter_listfunction
Added¶
normalize_parameter_nameskeyword parameter to theheaders._parse_parameter_listfunction. This replaces thenormalized_parameter_valueskeyword parameter.- support for parsing Forwarded headers with
headers.parse_forwarded algorithms.remove_url_authfunction
Removed¶
- support for Python 2.6 and 3.3
Changed¶
headers.parse_accept()now prefers explicit highest quality preferences over the inferred highest quality preferences
1.4.3 -- (2017-10-30)¶
Changed¶
The parsing of qualified lists now retains the initial ordering whenever
possible. The algoritm prefers explicit highest quality preferences (1.0)
over inferred highest quality preferences. It also retains the initial
ordering in the presense of multiple highest quality matches. This affects
the headers.parse_accept_charset, headers.parse_accept_encoding and
headers.parse_accept_language functions.
1.4.2 -- (2017-07-04)¶
Added¶
- formatting of Link headers using
str(header)
1.4.1 -- (2017-04-03)¶
Added¶
- error handling documentation for header parsing functions
1.4.0 -- (2016-10-18)¶
Added¶
headers.parse_accept_encodingwhich parse the Accept-Encoding headerheaders.parse_accept_languagewhich parses the Accept-Language header
Fixed¶
- parsing of parameter lists values ending in a quote character. For example,
max-age=5, x-foo="prune"was parsed as['max-age=5', 'x-foo="prune']
1.3.0 -- (2016-08-11)¶
Added¶
- Cache-Control header parsing with
headers.parse_cache_control
Deprecated¶
headers.parse_http_accept_headerrenamed toheaders.parse_acceptheaders.parse_link_headerrenamed toheaders.parse_linkheaders.parse_list_headerrenamed toheaders.parse_list
1.2.2 -- (2015-05-27)¶
Added¶
headers.parse_list_headerwhich parses generic comma-separated list headers with support for quoted partsheaders.parse_accept_charsetwhich parses the Accept-Charset header into a sorted list
1.2.1 -- (2015-05-25)¶
Fixed¶
algorithms.select_content_type only worked with the augmented
datastructures.ContentType values returned from the
algorithms.parse_http_accept_header. IOW, the algorithm required
that the quality attribute existed on instances. RFC-9110
requires that missing quality values are treated as 1
1.2.0 -- (2015-04-19)¶
Added¶
headers.parse_link_headerwhich parses Link headers.datastructures.LinkHeaderclass
1.1.1 -- (2015-02-10)¶
Removed¶
- the
setupextmodule since it was causing problems with source distributions
1.1.0 -- (2014-10-26)¶
Added¶
algorithms.rewrite_urlfunction
1.0.0 -- (2014-09-21)¶
Initial implementation containing the following functionality:
- algorithms.select_content_type function
- datastructures.ContentType class
- errors.NoMatch class
- errors.RootException class
- headers.parse_content_type function
- headers.parse_http_accept_header function