[230] | 1 | ==========================
|
---|
| 2 | Miscellaneous Submodules
|
---|
| 3 | ==========================
|
---|
| 4 |
|
---|
| 5 | There are several submodules in |rfc3986| that are not meant to be exposed to
|
---|
| 6 | users directly but which are valuable to document, regardless.
|
---|
| 7 |
|
---|
| 8 | .. data:: rfc3986.misc.UseExisting
|
---|
| 9 |
|
---|
| 10 | A sentinel object to make certain APIs simpler for users.
|
---|
| 11 |
|
---|
| 12 | .. module:: rfc3986.abnf_regexp
|
---|
| 13 |
|
---|
| 14 | The :mod:`rfc3986.abnf_regexp` module contains the regular expressions written
|
---|
| 15 | from the RFC's ABNF. The :mod:`rfc3986.misc` module contains compiled regular
|
---|
| 16 | expressions from :mod:`rfc3986.abnf_regexp` and previously contained those
|
---|
| 17 | regular expressions.
|
---|
| 18 |
|
---|
| 19 | .. data:: rfc3986.abnf_regexp.GEN_DELIMS
|
---|
| 20 | .. data:: rfc3986.abnf_regexp.GENERIC_DELIMITERS
|
---|
| 21 |
|
---|
| 22 | The string containing all of the generic delimiters as defined on
|
---|
| 23 | `page 13 <https://tools.ietf.org/html/rfc3986#page-13>`__.
|
---|
| 24 |
|
---|
| 25 | .. data:: rfc3986.abnf_regexp.GENERIC_DELIMITERS_SET
|
---|
| 26 |
|
---|
| 27 | :data:`rfc3986.abnf_regexp.GEN_DELIMS` represented as a :class:`set`.
|
---|
| 28 |
|
---|
| 29 | .. data:: rfc3986.abnf_regexp.SUB_DELIMS
|
---|
| 30 | .. data:: rfc3986.abnf_regexp.SUB_DELIMITERS
|
---|
| 31 |
|
---|
| 32 | The string containing all of the 'sub' delimiters as defined on
|
---|
| 33 | `page 13 <https://tools.ietf.org/html/rfc3986#page-13>`__.
|
---|
| 34 |
|
---|
| 35 | .. data:: rfc3986.abnf_regexp.SUB_DELIMITERS_SET
|
---|
| 36 |
|
---|
| 37 | :data:`rfc3986.abnf_regexp.SUB_DELIMS` represented as a :class:`set`.
|
---|
| 38 |
|
---|
| 39 | .. data:: rfc3986.abnf_regexp.SUB_DELIMITERS_RE
|
---|
| 40 |
|
---|
| 41 | :data:`rfc3986.abnf_regexp.SUB_DELIMS` with the ``*`` escaped for use in
|
---|
| 42 | regular expressions.
|
---|
| 43 |
|
---|
| 44 | .. data:: rfc3986.abnf_regexp.RESERVED_CHARS_SET
|
---|
| 45 |
|
---|
| 46 | A :class:`set` constructed of :data:`GEN_DELIMS` and :data:`SUB_DELIMS`.
|
---|
| 47 | This union is defined on `page 13
|
---|
| 48 | <https://tools.ietf.org/html/rfc3986#page-13>`__.
|
---|
| 49 |
|
---|
| 50 | .. data:: rfc3986.abnf_regexp.ALPHA
|
---|
| 51 |
|
---|
| 52 | The string of upper- and lower-case letters in USASCII.
|
---|
| 53 |
|
---|
| 54 | .. data:: rfc3986.abnf_regexp.DIGIT
|
---|
| 55 |
|
---|
| 56 | The string of digits 0 through 9.
|
---|
| 57 |
|
---|
| 58 | .. data:: rfc3986.abnf_regexp.UNRESERVED
|
---|
| 59 | .. data:: rfc3986.abnf_regexp.UNRESERVED_CHARS
|
---|
| 60 |
|
---|
| 61 | The string of unreserved characters defined in :rfc:`3986#section-2.3`.
|
---|
| 62 |
|
---|
| 63 | .. data:: rfc3986.abnf_regexp.UNRESERVED_CHARS_SET
|
---|
| 64 |
|
---|
| 65 | :data:`rfc3986.abnf_regexp.UNRESERVED_CHARS` represented as a
|
---|
| 66 | :class:`set`.
|
---|
| 67 |
|
---|
| 68 | .. data:: rfc3986.abnf_regexp.NON_PCT_ENCODED_SET
|
---|
| 69 |
|
---|
| 70 | The non-percent encoded characters represented as a :class:`set`.
|
---|
| 71 |
|
---|
| 72 | .. data:: rfc3986.abnf_regexp.UNRESERVED_RE
|
---|
| 73 |
|
---|
| 74 | Optimized regular expression for unreserved characters.
|
---|
| 75 |
|
---|
| 76 | .. data:: rfc3986.abnf_regexp.SCHEME_RE
|
---|
| 77 |
|
---|
| 78 | Stricter regular expression to match and validate the scheme part
|
---|
| 79 | of a URI.
|
---|
| 80 |
|
---|
| 81 | .. data:: rfc3986.abnf_regexp.COMPONENT_PATTERN_DICT
|
---|
| 82 |
|
---|
| 83 | Dictionary with regular expressions to match various components in
|
---|
| 84 | a URI. Except for :data:`rfc3986.abnf_regexp.SCHEME_RE`, all patterns
|
---|
| 85 | are from :rfc:`3986#appendix-B`.
|
---|
| 86 |
|
---|
| 87 | .. data:: rfc3986.abnf_regexp.URL_PARSING_RE
|
---|
| 88 |
|
---|
| 89 | Regular expression compposed from the components in
|
---|
| 90 | :data:`rfc3986.abnf_regexp.COMPONENT_PATTERN_DICT`.
|
---|
| 91 |
|
---|
| 92 | .. data:: rfc3986.abnf_regexp.HEXDIG_RE
|
---|
| 93 |
|
---|
| 94 | Hexadecimal characters used in each piece of an IPv6 address.
|
---|
| 95 | See :rfc:`3986#section-3.2.2`.
|
---|
| 96 |
|
---|
| 97 | .. data:: rfc3986.abnf_regexp.LS32_RE
|
---|
| 98 |
|
---|
| 99 | Lease significant 32 bits of an IPv6 address.
|
---|
| 100 | See :rfc:`3986#section-3.2.2`.
|
---|
| 101 |
|
---|
| 102 | .. data:: rfc3986.abnf_regexp.REG_NAME
|
---|
| 103 | .. data:: rfc3986.abnf_regexp.REGULAR_NAME_RE
|
---|
| 104 |
|
---|
| 105 | The pattern for a regular name, e.g., ``www.google.com``,
|
---|
| 106 | ``api.github.com``.
|
---|
| 107 | See :rfc:`3986#section-3.2.2`.
|
---|
| 108 |
|
---|
| 109 | .. data:: rfc3986.abnf_regexp.IPv4_RE
|
---|
| 110 |
|
---|
| 111 | The pattern for an IPv4 address, e.g., ``192.168.255.255``.
|
---|
| 112 | See :rfc:`3986#section-3.2.2`.
|
---|
| 113 |
|
---|
| 114 | .. data:: rfc3986.abnf_regexp.IPv6_RE
|
---|
| 115 |
|
---|
| 116 | The pattern for an IPv6 address, e.g., ``::1``.
|
---|
| 117 | See :rfc:`3986#section-3.2.2`.
|
---|
| 118 |
|
---|
| 119 | .. data:: rfc3986.abnf_regexp.IPv_FUTURE_RE
|
---|
| 120 |
|
---|
| 121 | A regular expression to parse out IPv Futures.
|
---|
| 122 | See :rfc:`3986#section-3.2.2`.
|
---|
| 123 |
|
---|
| 124 | .. data:: rfc3986.abnf_regexp.IP_LITERAL_RE
|
---|
| 125 |
|
---|
| 126 | Pattern to match IPv6 addresses and IPv Future addresses.
|
---|
| 127 | See :rfc:`3986#section-3.2.2`.
|
---|
| 128 |
|
---|
| 129 | .. data:: rfc3986.abnf_regexp.HOST_RE
|
---|
| 130 | .. data:: rfc3986.abnf_regexp.HOST_PATTERN
|
---|
| 131 |
|
---|
| 132 | Pattern to match and validate the host piece of an authority.
|
---|
| 133 | This is composed of
|
---|
| 134 |
|
---|
| 135 | - :data:`rfc3986.abnf_regexp.REG_NAME`
|
---|
| 136 | - :data:`rfc3986.abnf_regexp.IPv4_RE`
|
---|
| 137 | - :data:`rfc3986.abnf_regexp.IP_LITERAL_RE`
|
---|
| 138 |
|
---|
| 139 | See :rfc:`3986#section-3.2.2`.
|
---|
| 140 |
|
---|
| 141 | .. data:: rfc3986.abnf_regexp.USERINFO_RE
|
---|
| 142 |
|
---|
| 143 | Pattern to match and validate the user information portion of
|
---|
| 144 | an authority component.
|
---|
| 145 |
|
---|
| 146 | See :rfc:`3986#section-3.2.2`.
|
---|
| 147 |
|
---|
| 148 | .. data:: rfc3986.abnf_regexp.PORT_RE
|
---|
| 149 |
|
---|
| 150 | Pattern to match and validate the port portion of an authority
|
---|
| 151 | component.
|
---|
| 152 |
|
---|
| 153 | See :rfc:`3986#section-3.2.2`.
|
---|
| 154 |
|
---|
| 155 | .. data:: rfc3986.abnf_regexp.PCT_ENCODED
|
---|
| 156 | .. data:: rfc3986.abnf_regexp.PERCENT_ENCODED
|
---|
| 157 |
|
---|
| 158 | Regular expression to match percent encoded character values.
|
---|
| 159 |
|
---|
| 160 | .. data:: rfc3986.abnf_regexp.PCHAR
|
---|
| 161 |
|
---|
| 162 | Regular expression to match printable characters.
|
---|
| 163 |
|
---|
| 164 | .. data:: rfc3986.abnf_regexp.PATH_RE
|
---|
| 165 |
|
---|
| 166 | Regular expression to match and validate the path component of a URI.
|
---|
| 167 |
|
---|
| 168 | See :rfc:`3986#section-3.3`.
|
---|
| 169 |
|
---|
| 170 | .. data:: rfc3986.abnf_regexp.PATH_EMPTY
|
---|
| 171 | .. data:: rfc3986.abnf_regexp.PATH_ROOTLESS
|
---|
| 172 | .. data:: rfc3986.abnf_regexp.PATH_NOSCHEME
|
---|
| 173 | .. data:: rfc3986.abnf_regexp.PATH_ABSOLUTE
|
---|
| 174 | .. data:: rfc3986.abnf_regexp.PATH_ABEMPTY
|
---|
| 175 |
|
---|
| 176 | Components of the :data:`rfc3986.abnf_regexp.PATH_RE`.
|
---|
| 177 |
|
---|
| 178 | See :rfc:`3986#section-3.3`.
|
---|
| 179 |
|
---|
| 180 | .. data:: rfc3986.abnf_regexp.QUERY_RE
|
---|
| 181 |
|
---|
| 182 | Regular expression to parse and validate the query component of a URI.
|
---|
| 183 |
|
---|
| 184 | .. data:: rfc3986.abnf_regexp.FRAGMENT_RE
|
---|
| 185 |
|
---|
| 186 | Regular expression to parse and validate the fragment component of a URI.
|
---|
| 187 |
|
---|
| 188 | .. data:: rfc3986.abnf_regexp.RELATIVE_PART_RE
|
---|
| 189 |
|
---|
| 190 | Regular expression to parse the relative URI when resolving URIs.
|
---|
| 191 |
|
---|
| 192 | .. data:: rfc3986.abnf_regexp.HIER_PART_RE
|
---|
| 193 |
|
---|
| 194 | The hierarchical part of a URI. This regular expression is used when
|
---|
| 195 | resolving relative URIs.
|
---|
| 196 |
|
---|
| 197 | See :rfc:`3986#section-3`.
|
---|
| 198 |
|
---|
| 199 | .. module:: rfc3986.misc
|
---|
| 200 |
|
---|
| 201 | .. data:: rfc3986.misc.URI_MATCHER
|
---|
| 202 |
|
---|
| 203 | Compiled version of :data:`rfc3986.abnf_regexp.URL_PARSING_RE`.
|
---|
| 204 |
|
---|
| 205 | .. data:: rfc3986.misc.SUBAUTHORITY_MATCHER
|
---|
| 206 |
|
---|
| 207 | Compiled compilation of :data:`rfc3986.abnf_regexp.USERINFO_RE`,
|
---|
| 208 | :data:`rfc3986.abnf_regexp.HOST_PATTERN`,
|
---|
| 209 | :data:`rfc3986.abnf_regexp.PORT_RE`.
|
---|
| 210 |
|
---|
| 211 | .. data:: rfc3986.misc.SCHEME_MATCHER
|
---|
| 212 |
|
---|
| 213 | Compiled version of :data:`rfc3986.abnf_regexp.SCHEME_RE`.
|
---|
| 214 |
|
---|
| 215 | .. data:: rfc3986.misc.IPv4_MATCHER
|
---|
| 216 |
|
---|
| 217 | Compiled version of :data:`rfc3986.abnf_regexp.IPv4_RE`.
|
---|
| 218 |
|
---|
| 219 | .. data:: rfc3986.misc.PATH_MATCHER
|
---|
| 220 |
|
---|
| 221 | Compiled version of :data:`rfc3986.abnf_regexp.PATH_RE`.
|
---|
| 222 |
|
---|
| 223 | .. data:: rfc3986.misc.QUERY_MATCHER
|
---|
| 224 |
|
---|
| 225 | Compiled version of :data:`rfc3986.abnf_regexp.QUERY_RE`.
|
---|
| 226 |
|
---|
| 227 | .. data:: rfc3986.misc.RELATIVE_REF_MATCHER
|
---|
| 228 |
|
---|
| 229 | Compiled compilation of :data:`rfc3986.abnf_regexp.SCHEME_RE`,
|
---|
| 230 | :data:`rfc3986.abnf_regexp.HIER_PART_RE`,
|
---|
| 231 | :data:`rfc3986.abnf_regexp.QUERY_RE`.
|
---|