namevalue
Module¶
Key-value pairs.
-
class
wpull.namevalue.
NameValueRecord
(normalize_overrides=None, encoding='utf-8', wrap_width=None)[source]¶ Bases:
collections.abc.MutableMapping
An ordered mapping of name-value pairs.
Duplicated names are accepted.
-
wpull.namevalue.
guess_line_ending
(string)[source]¶ Return the most likely line delimiter from the string.
-
wpull.namevalue.
normalize_name
(name, overrides=None)[source]¶ Normalize the key name to title case.
For example,
normalize_name('content-id')
will becomeContent-Id
Parameters: - name (str) – The name to normalize.
- overrides (set, sequence) – A set or sequence containing keys that
should be cased to themselves. For example, passing
set('WARC-Type')
will normalize any key named “warc-type” toWARC-Type
instead of the defaultWarc-Type
.
Returns: str