一图看懂 werkzeug 模块:是一个全面的WSGI web应用程序库,最先进的WSGI实用程序库之一,资料整理+笔记(大全)

本文由 大侠(AhcaoZhu)原创,转载请声明。
链接: https://blog.csdn.net/Ahcao2008

Alt

一图看懂 werkzeug 模块:是一个全面的WSGI web应用程序库,最先进的WSGI实用程序库之一,资料整理+笔记(大全)

  • 摘要
  • 模块图
  • 类关系图
  • 模块全展开
    • ☘️【werkzeug】
    • 统计
    • 模块
      • 1 werkzeug._internal
      • 2 werkzeug.exceptions
      • 3 werkzeug.urls
      • 4 werkzeug.serving
      • 5 werkzeug.sansio
      • 6 werkzeug.http
      • 7 werkzeug.datastructures
      • 8 werkzeug.security
      • 9 werkzeug.wsgi
      • 10 werkzeug.utils
      • 11 werkzeug.formparser
      • 12 werkzeug.user_agent
      • 13 werkzeug.wrappers
      • 14 werkzeug.test
    • 函数
      • 15 run_simple(hostname: str, port: int, application:`WSGIApplication', use_reloader: bool = False, use_debugger: bool = False, use_evalex: bool = True, extra_files: Union[Iterable[str], NoneType] = None, exclude_patterns: Union[Iterable[str], NoneType] = None, reloader_interval: int = 1, reloader_type: str =`auto', threaded: bool = False, processes: int = 1, request_handler: Union[Type[werkzeug.serving.WSGIRequestHandler], NoneType] = None, static_files: Union[Dict[str, Union[str, Tuple[str, str]]], NoneType] = None, passthrough_errors: bool = False, ssl_context: Union[ForwardRef('ssl.SSLContext'), Tuple[str, Union[str, NoneType]], ForwardRef("te.Literal['adhoc']"), NoneType] = None) -> None
      • 16 werkzeug.test.Client
        • method
        • 1 delete(self, *args: t.Any, **kw: t.Any) -> "TestResponse":
        • 2 delete_cookie(
        • 3 get(self, *args: t.Any, **kw: t.Any) -> "TestResponse":
        • 4 head(self, *args: t.Any, **kw: t.Any) -> "TestResponse":
        • 5 open()
        • 6 options(self, *args: t.Any, **kw: t.Any) -> "TestResponse":
        • 7 patch(self, *args: t.Any, **kw: t.Any) -> "TestResponse":
        • 8 post(self, *args: t.Any, **kw: t.Any) -> "TestResponse":
        • 9 put(self, *args: t.Any, **kw: t.Any) -> "TestResponse":
        • 10 resolve_redirect(
        • 11 run_wsgi_app()
        • 12 set_cookie(
        • 13 trace(self, *args: t.Any, **kw: t.Any) -> "TestResponse":
      • 17 werkzeug.wrappers.request.Request
        • data
        • property
        • method
        • 20 close(self) -> None:
        • 21 get_data(
        • 22 get_json(
        • 23 make_form_data_parser(self) -> FormDataParser:
        • 24 on_json_loading_failed(self, e: t.Optional[ValueError]) -> t.Any:
        • class method
        • 25 application(
        • 26 from_values(cls, *args: t.Any, **kwargs: t.Any) -> "Request":
      • 18 werkzeug.wrappers.response.Response
        • data
        • property
        • method
        • 10 add_etag(self, overwrite: bool = False, weak: bool = False) -> None:
        • 11 calculate_content_length(self) -> t.Optional[int]:
        • 12 call_on_close(self, func: t.Callable[[], t.Any]) -> t.Callable[[], t.Any]:
        • 13 close(self) -> None:
        • 14 freeze(self) -> None:
        • 15 get_app_iter(self, environ: "WSGIEnvironment") -> t.Iterable[bytes]:
        • 16 get_data(self, as_text: "te.Literal[False]" = False) -> bytes:
        • 17 get_json(self, force: bool = ..., silent: "te.Literal[False]" = ...) -> t.Any:
        • 18 get_wsgi_headers(self, environ: "WSGIEnvironment") -> Headers:
        • 19 get_wsgi_response(
        • 20 iter_encoded(self) -> t.Iterator[bytes]:
        • 21 make_conditional(
        • 22 make_sequence(self) -> None:
        • 23 set_data(self, value: t.Union[bytes, str]) -> None:
        • class method
        • 24 force_type(
        • 25 from_app(
    • 私有或局部
    • 统计
    • 常量
      • int
    • 模块
      • 2 re
    • 函数
      • 3 dataclass(_cls=None, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False)
      • 4 cast(typ, val)
      • 5 _to_bytes(x: Union[str, bytes], charset: str =`utf-8', errors: str =`strict') -> bytes
      • 6 _to_str(x: Union[Any, NoneType], charset: Union[str, NoneType] =`utf-8', errors: str =`strict', allow_none_charset: bool = False) -> Union[str, bytes, NoneType]
      • 7 parse_options_header(value: Union[str, NoneType]) -> Tuple[str, Dict[str, str]]
      • 8 enum.auto
        • data
      • 9 Enum
        • data
      • 10 werkzeug.datastructures.Headers
        • method
        • 1 add(self, _key, _value, **kw)
        • 2 add_header(self, _key, _value, **_kw)
        • 3 clear(self)
        • 4 copy(self)
        • 5 extend(self, *args, **kwargs)
        • 6 get(self, key, default=None, type=None, as_bytes=False)
        • 7 get_all(self, name)
        • 8 getlist(self, key, type=None, as_bytes=False)
        • 9 items(self, lower=False)
        • 10 keys(self, lower=False)
        • 11 pop(self, key=None, default=_missing)
        • 12 popitem(self)
        • 13 remove(self, key)
        • 14 set(self, _key, _value, **kw)
        • 15 setdefault(self, key, default)
        • 16 setlist(self, key, values)
        • 17 setlistdefault(self, key, default)
        • 18 to_wsgi_list(self)
        • 19 update(self, *args, **kwargs)
        • 20 values(self)
      • 11 werkzeug.exceptions.RequestEntityTooLarge
        • data
      • 12 werkzeug.sansio.multipart.Event
      • 13 werkzeug.sansio.multipart.Preamble
      • 14 werkzeug.sansio.multipart.Field
      • 15 werkzeug.sansio.multipart.File
      • 16 werkzeug.sansio.multipart.Data
      • 17 werkzeug.sansio.multipart.Epilogue
      • 18 werkzeug.sansio.multipart.NeedData
      • 19 State
        • data
      • 20 werkzeug.sansio.multipart.MultipartDecoder
        • method
        • 1 last_newline(self) -> int:
        • 2 next_event(self) -> Event:
        • 3 receive_data(self, data: Optional[bytes]) -> None:
      • 21 werkzeug.sansio.multipart.MultipartEncoder
        • method
        • 1 send_event(self, event: Event) -> bytes:
    • 私有或局部
    • 剩余
    • ☘️【werkzeug.sansio.request】
    • 统计
    • 模块
      • 1 typing
    • 函数
      • 2 _to_str(x: Union[Any, NoneType], charset: Union[str, NoneType] =`utf-8', errors: str =`strict', allow_none_charset: bool = False) -> Union[str, bytes, NoneType]
      • 3 parse_accept_header(value: Union[str, NoneType], cls: Union[Type[~_TAnyAccept], NoneType] = None) -> ~_TAnyAccept
      • 4 parse_authorization_header(value: Union[str, NoneType]) -> Union[ForwardRef('ds.Authorization'), NoneType]
      • 5 parse_cache_control_header(value: Union[str, NoneType], on_update: Union[Callable[[~_TAnyCC], NoneType], NoneType] = None, cls: Union[Type[~_TAnyCC], NoneType] = None) -> ~_TAnyCC
      • 6 parse_date(value: Union[str, NoneType]) -> Union[datetime.datetime, NoneType]
      • 7 parse_etags(value: Union[str, NoneType]) ->`ds.ETags'
      • 8 parse_if_range_header(value: Union[str, NoneType]) ->`ds.IfRange'
      • 9 parse_list_header(value: str) -> List[str]
      • 10 parse_options_header(value: Union[str, NoneType]) -> Tuple[str, Dict[str, str]]
      • 11 parse_range_header(value: Union[str, NoneType], make_inclusive: bool = True) -> Union[ForwardRef('ds.Range'), NoneType]
      • 12 parse_set_header(value: Union[str, NoneType], on_update: Union[Callable[[ForwardRef('ds.HeaderSet')], NoneType], NoneType] = None) ->`ds.HeaderSet'
      • 13 url_decode(s: ~AnyStr, charset: str =`utf-8', include_empty: bool = True, errors: str =`replace', separator: str =`&', cls: Union[Type[ForwardRef('ds.MultiDict')], NoneType] = None) ->`ds.MultiDict[str, str]'
      • 14 parse_cookie(cookie: Union[bytes, str, NoneType] =`', charset: str =`utf-8', errors: str =`replace', cls: Union[Type[ForwardRef('ds.MultiDict')], NoneType] = None) ->`ds.MultiDict[str, str]'
      • 15 get_current_url(scheme: str, host: str, root_path: Union[str, NoneType] = None, path: Union[str, NoneType] = None, query_string: Union[bytes, NoneType] = None) -> str
      • 16 get_host(scheme: str, host_header: Union[str, NoneType], server: Union[Tuple[str, Union[int, NoneType]], NoneType] = None, trusted_hosts: Union[Iterable[str], NoneType] = None) -> str
      • 17 datetime.datetime
        • data
        • method
        • 10 astimezone(self, tz=None)
        • 11 ctime(self)
        • 12 date(self)
        • 13 dst(self)
        • 14 isoformat(self, sep='T', timespec='auto')
        • 15 replace(self, year=None, month=None, day=None, hour=None,
        • 16 time(self)
        • 17 timestamp(self)
        • 18 timetuple(self)
        • 19 timetz(self)
        • 20 tzname(self)
        • 21 utcoffset(self)
        • 22 utctimetuple(self)
        • class method
        • 23 combine(cls, date, time, tzinfo=True)
        • 24 fromisoformat(cls, date_string)
        • 25 fromtimestamp(cls, t, tz=None)
        • 26 now(cls, tz=None)
        • 27 strptime(cls, date_string, format)
        • 28 utcfromtimestamp(cls, t)
        • 29 utcnow(cls)
      • 18 werkzeug.datastructures.Accept
        • property
        • method
        • 2 best_match(self, matches, default=None)
        • 3 find(self, key)
        • 4 index(self, key)
        • 5 quality(self, key)
        • 6 to_header(self)
        • 7 values(self)
      • 19 werkzeug.datastructures.Authorization
        • property
        • method
        • 11 to_header(self)
      • 20 werkzeug.datastructures.CharsetAccept
      • 21 werkzeug.datastructures.ETags
        • method
        • 1 as_set(self, include_weak=False)
        • 2 contains(self, etag)
        • 3 contains_raw(self, etag)
        • 4 contains_weak(self, etag)
        • 5 is_strong(self, etag)
        • 6 is_weak(self, etag)
        • 7 to_header(self)
      • 22 werkzeug.datastructures.Headers
      • 22 werkzeug.datastructures.HeaderSet
        • method
        • 1 add(self, header)
        • 2 as_set(self, preserve_casing=False)
        • 3 clear(self)
        • 4 discard(self, header)
        • 5 find(self, header)
        • 6 index(self, header)
        • 7 remove(self, header)
        • 8 to_header(self)
        • 9 update(self, iterable)
      • 23 werkzeug.datastructures.IfRange
        • method
        • 1 to_header(self)
      • 24 werkzeug.datastructures.ImmutableList
      • 25 werkzeug.datastructures.ImmutableMultiDict
        • method
        • 1 copy(self)
      • 26 werkzeug.datastructures.LanguageAccept
        • method
        • 1 best_match(self, matches, default=None)
      • 27 werkzeug.datastructures.MIMEAccept
        • property
      • 28 werkzeug.datastructures.MultiDict
        • method
        • 1 add(self, key, value)
        • 2 copy(self)
        • 3 deepcopy(self, memo=None)
        • 4 getlist(self, key, type=None)
        • 5 items(self, multi=False)
        • 6 lists(self)
        • 7 listvalues(self)
        • 8 pop(self, key, default=_missing)
        • 9 popitem(self)
        • 10 popitemlist(self)
        • 11 poplist(self, key)
        • 12 setdefault(self, key, default=None)
        • 13 setlist(self, key, new_list)
        • 14 setlistdefault(self, key, default_list=None)
        • 15 to_dict(self, flat=True)
        • 16 update(self, mapping)
        • 17 values(self)
      • 29 werkzeug.datastructures.Range
        • method
        • 1 make_content_range(self, length)
        • 2 range_for_length(self, length)
        • 3 to_content_range_header(self, length)
        • 4 to_header(self)
      • 30 werkzeug.datastructures.RequestCacheControl
        • property
      • 31 werkzeug.user_agent.UserAgent
        • data
        • method
        • 5 to_header(self) -> str:
      • 32 werkzeug.utils.cached_property
      • 33 werkzeug.utils.header_property
        • method
        • 1 lookup(self, obj: t.Union["Request", "Response"]) -> Headers:
      • 34 werkzeug.sansio.request.Request
    • 私有或局部
    • ☘️【werkzeug.sansio.response】
    • 统计
    • 常量
      • dict
    • 模块
      • 2 typing
    • 函数
      • 3 _to_str(x: Union[Any, NoneType], charset: Union[str, NoneType] =`utf-8', errors: str =`strict', allow_none_charset: bool = False) -> Union[str, bytes, NoneType]
      • 4 dump_cookie(key: str, value: Union[bytes, str] =`', max_age: Union[datetime.timedelta, int, NoneType] = None, expires: Union[str, datetime.datetime, int, float, NoneType] = None, path: Union[str, NoneType] =`/', domain: Union[str, NoneType] = None, secure: bool = False, httponly: bool = False, charset: str =`utf-8', sync_expires: bool = True, max_size: int = 4093, samesite: Union[str, NoneType] = None) -> str
      • 5 get_content_type(mimetype: str, charset: str) -> str
      • 6 dump_age(age: Union[datetime.timedelta, int, NoneType] = None) -> Union[str, NoneType]
      • 7 dump_header(iterable: Union[Dict[str, Union[str, int]], Iterable[str]], allow_token: bool = True) -> str
      • 8 dump_options_header(header: Union[str, NoneType], options: Mapping[str, Union[str, int, NoneType]]) -> str
      • 9 http_date(timestamp: Union[datetime.datetime, datetime.date, int, float, time.struct_time, NoneType] = None) -> str
      • 10 parse_age(value: Union[str, NoneType] = None) -> Union[datetime.timedelta, NoneType]
      • 11 parse_cache_control_header(value: Union[str, NoneType], on_update: Union[Callable[[~_TAnyCC], NoneType], NoneType] = None, cls: Union[Type[~_TAnyCC], NoneType] = None) -> ~_TAnyCC
      • 12 parse_content_range_header(value: Union[str, NoneType], on_update: Union[Callable[[ForwardRef('ds.ContentRange')], NoneType], NoneType] = None) -> Union[ForwardRef('ds.ContentRange'), NoneType]
      • 13 parse_csp_header(value: Union[str, NoneType], on_update: Union[Callable[[~_TAnyCSP], NoneType], NoneType] = None, cls: Union[Type[~_TAnyCSP], NoneType] = None) -> ~_TAnyCSP
      • 14 parse_date(value: Union[str, NoneType]) -> Union[datetime.datetime, NoneType]
      • 15 parse_options_header(value: Union[str, NoneType]) -> Tuple[str, Dict[str, str]]
      • 16 parse_set_header(value: Union[str, NoneType], on_update: Union[Callable[[ForwardRef('ds.HeaderSet')], NoneType], NoneType] = None) ->`ds.HeaderSet'
      • 17 parse_www_authenticate_header(value: Union[str, NoneType], on_update: Union[Callable[[ForwardRef('ds.WWWAuthenticate')], NoneType], NoneType] = None) ->`ds.WWWAuthenticate'
      • 18 quote_etag(etag: str, weak: bool = False) -> str
      • 19 unquote_etag(etag: Union[str, NoneType]) -> Union[Tuple[str, bool], Tuple[NoneType, NoneType]]
      • 20 _set_property(name: str, doc: Union[str, NoneType] = None) -> property
      • 21 datetime.datetime
      • 21 datetime.timedelta
        • data
        • method
        • 7 total_seconds(self)
      • 22 datetime.timezone
        • data
        • method
        • 4 dst(self, dt)
        • 5 fromutc(self, dt)
        • 6 tzname(self, dt)
        • 7 utcoffset(self, dt)
      • 23 HTTPStatus
        • data
      • 24 werkzeug.datastructures.Headers
      • 24 werkzeug.datastructures.HeaderSet
      • 24 werkzeug.datastructures.CallbackDict
      • 25 werkzeug.datastructures.ContentRange
        • property
        • method
        • 5 set(self, start, stop, length=None, units="bytes")
        • 6 to_header(self)
        • 7 unset(self)
      • 26 werkzeug.datastructures.ContentSecurityPolicy
        • property
        • method
        • 26 to_header(self)
      • 27 werkzeug.datastructures.ResponseCacheControl
        • property
      • 28 werkzeug.datastructures.WWWAuthenticate
        • property
        • method
        • 9 set_basic(self, realm="authentication required")
        • 10 set_digest(
        • 11 to_header(self)
        • static method
        • 12 auth_property()
      • 29 COEP
        • data
      • 30 COOP
        • data
      • 31 werkzeug.utils.header_property
      • 31 werkzeug.sansio.response.Response
    • 私有或局部
    • ☘️【werkzeug.wrappers.request】
    • 统计
    • 常量
    • 模块
      • 1 functools
      • 2 json
      • 3 typing
      • 4 typing
    • 函数
      • 5 _wsgi_decoding_dance(s: str, charset: str =`utf-8', errors: str =`replace') -> str
      • 6 iter_multi_items(mapping)
      • 7 default_stream_factory(total_content_length: Union[int, NoneType], content_type: Union[str, NoneType], filename: Union[str, NoneType], content_length: Union[int, NoneType] = None) -> IO[bytes]
      • 8 _get_server(environ:`WSGIEnvironment') -> Union[Tuple[str, Union[int, NoneType]], NoneType]
      • 9 get_input_stream(environ:`WSGIEnvironment', safe_fallback: bool = True) -> IO[bytes]
      • 10 _io.BytesIO
        • data
        • method
        • 2 close()
        • 3 flush()
        • 4 getbuffer()
        • 5 getvalue()
        • 6 isatty()
        • 7 read()
        • 8 read1()
        • 9 readable()
        • 10 readinto()
        • 11 readline()
        • 12 readlines()
        • 13 seek()
        • 14 seekable()
        • 15 tell()
        • 16 truncate()
        • 17 writable()
        • 18 write()
        • 19 writelines()
      • 11 werkzeug.datastructures.CombinedMultiDict
        • method
        • 1 copy(self)
        • 2 get(self, key, default=None, type=None)
        • 3 getlist(self, key, type=None)
        • 4 items(self, multi=False)
        • 5 keys(self)
        • 6 lists(self)
        • 7 listvalues(self)
        • 8 to_dict(self, flat=True)
        • 9 values(self)
        • class method
        • 10 fromkeys(cls, keys, value=None)
      • 12 werkzeug.datastructures.EnvironHeaders
        • method
        • 1 copy(self)
      • 13 werkzeug.datastructures.FileStorage
        • property
        • method
        • 5 close(self)
        • 6 save(self, dst, buffer_size=16384)
      • 14 werkzeug.datastructures.ImmutableMultiDict
      • 14 werkzeug.datastructures.MultiDict
      • 14 werkzeug.formparser.FormDataParser
        • data
        • method
        • 2 get_parse_func(
        • 3 parse(
        • 4 parse_from_environ(self, environ: "WSGIEnvironment") -> "t_parse_result":
      • 15 werkzeug.sansio.request.Request
        • data
        • property
      • 16 werkzeug.utils.cached_property
      • 16 werkzeug.utils.environ_property
        • data
        • method
        • 2 lookup(self, obj: "Request") -> "WSGIEnvironment":
      • 17 werkzeug.exceptions.BadRequest
        • data
      • 18 werkzeug.wrappers.request.Request
    • 私有或局部
    • ☘️【werkzeug.wrappers.response】
    • 统计
    • 模块
      • 1 json
      • 2 typing
      • 3 typing
      • 4 warnings
    • 函数
      • 5 _to_bytes(x: Union[str, bytes], charset: str =`utf-8', errors: str =`strict') -> bytes
      • 6 remove_entity_headers(headers: Union[ForwardRef('ds.Headers'), List[Tuple[str, str]]], allowed: Iterable[str] = ('expires',`content-location')) -> None
      • 7 iri_to_uri(iri: Union[str, Tuple[str, str, str, str, str]], charset: str =`utf-8', errors: str =`strict', safe_conversion: bool = False) -> str
      • 8 url_join(base: Union[str, Tuple[str, str, str, str, str]], url: Union[str, Tuple[str, str, str, str, str]], allow_fragments: bool = True) -> str
      • 9 get_current_url(environ:`WSGIEnvironment', root_only: bool = False, strip_querystring: bool = False, host_only: bool = False, trusted_hosts: Union[Iterable[str], NoneType] = None) -> str
      • 10 _get_environ(obj: Union[ForwardRef('WSGIEnvironment'), ForwardRef('Request')]) ->`WSGIEnvironment'
      • 11 generate_etag(data: bytes) -> str
      • 12 http_date(timestamp: Union[datetime.datetime, datetime.date, int, float, time.struct_time, NoneType] = None) -> str
      • 13 is_resource_modified(environ:`WSGIEnvironment', etag: Union[str, NoneType] = None, data: Union[bytes, NoneType] = None, last_modified: Union[datetime.datetime, str, NoneType] = None, ignore_if_range: bool = True) -> bool
      • 14 parse_etags(value: Union[str, NoneType]) ->`ds.ETags'
      • 15 parse_range_header(value: Union[str, NoneType], make_inclusive: bool = True) -> Union[ForwardRef('ds.Range'), NoneType]
      • 16 _warn_if_string(iterable: Iterable) -> None
      • 17 _iter_encoded(iterable: Iterable[Union[str, bytes]], charset: str) -> Iterator[bytes]
      • 18 _clean_accept_ranges(accept_ranges: Union[bool, str]) -> str
      • 19 HTTPStatus
      • 19 werkzeug.datastructures.Headers
      • 19 werkzeug.sansio.response.Response
        • data
        • property
        • method
        • 38 delete_cookie(
        • 39 get_etag(self) -> t.Union[t.Tuple[str, bool], t.Tuple[None, None]]:
        • 40 set_cookie(
        • 41 set_etag(self, etag: str, weak: bool = False) -> None:
      • 20 werkzeug.utils.cached_property
      • 20 werkzeug.wsgi.ClosingIterator
        • method
        • 1 close(self) -> None:
      • 21 werkzeug.wsgi._RangeWrapper
        • method
        • 1 close(self) -> None:
      • 22 werkzeug.wrappers.response.Response
      • 22 werkzeug.wrappers.response.ResponseStream
        • data
        • property
        • method
        • 3 close(self) -> None:
        • 4 flush(self) -> None:
        • 5 isatty(self) -> bool:
        • 6 tell(self) -> int:
        • 7 write(self, value: bytes) -> int:
        • 8 writelines(self, seq: t.Iterable[bytes]) -> None:
    • 私有或局部
    • ☘️【werkzeug._internal】
    • ☘️【werkzeug.exceptions】
    • ☘️【werkzeug.urls】
    • ☘️【werkzeug.serving】
    • ☘️【werkzeug.sansio】
    • ☘️【werkzeug.http】
    • ☘️【werkzeug.datastructures】
    • ☘️【werkzeug.security】
    • ☘️【werkzeug.wsgi】
    • ☘️【werkzeug.utils】
    • ☘️【werkzeug.formparser】
    • ☘️【werkzeug.user_agent】
    • ☘️【werkzeug.wrappers】
    • ☘️【werkzeug.test】
    • ☘️【werkzeug.sansio.http】
    • ☘️【werkzeug.sansio.multipart】
    • ☘️【werkzeug.sansio.utils】
    • ☘️【logging】
    • ☘️【operator】
    • ☘️【re】
    • ☘️【string】
    • ☘️【sys】
    • ☘️【typing】
    • ☘️【codecs】
    • ☘️【os】
    • ☘️【errno】
    • ☘️【io】
    • ☘️【socket】
    • ☘️【socketserver】
    • ☘️【ssl】
    • ☘️【base64】
    • ☘️【email】
    • ☘️【warnings】
    • ☘️【mimetypes】
    • ☘️【hashlib】
    • ☘️【hmac】
    • ☘️【posixpath】
    • ☘️【secrets】
    • ☘️【pkgutil】
    • ☘️【unicodedata】
    • ☘️【functools】
    • ☘️【json】

摘要

  • 全文介绍python的 werkzeug 模块(是一个全面的WSGI web应用程序库,最先进的WSGI实用程序库之一)、函数、类及类的方法和属性。
  • 它通过代码抓取并经AI智能翻译和人工校对。
  • 是一部不可多得的权威字典类工具书。它是系列集的一部分。后续陆续发布、敬请关注。【原创:AhcaoZhu大侠】

模块图

一图看懂 werkzeug 模块:是一个全面的WSGI web应用程序库,最先进的WSGI实用程序库之一,资料整理+笔记(大全)_第1张图片

werkzeug
	werkzeug._internal
	werkzeug.exceptions
	werkzeug.urls
	werkzeug.serving
		◆socketserver
	werkzeug.sansio
		werkzeug.sansio.http
		werkzeug.sansio.multipart
		werkzeug.sansio.utils
		werkzeug.sansio.request
		werkzeug.sansio.response
	werkzeug.http
	werkzeug.datastructures
	werkzeug.security
		◆secrets
	werkzeug.wsgi
	werkzeug.utils
	werkzeug.formparser
	werkzeug.user_agent
	werkzeug.wrappers
		werkzeug.wrappers.request
		werkzeug.wrappers.response
	werkzeug.test

类关系图

一图看懂 werkzeug 模块:是一个全面的WSGI web应用程序库,最先进的WSGI实用程序库之一,资料整理+笔记(大全)_第2张图片

◆object
	◆BaseException
		◆Exception
			◆ImportError
				werkzeug.utils.ImportStringError
			◆LookupError
				◆KeyError
					werkzeug.exceptions.HTTPException
						werkzeug.exceptions.BadGateway
						werkzeug.exceptions.BadRequest
							werkzeug.exceptions.BadHost
							werkzeug.exceptions.BadRequestKeyError
							werkzeug.exceptions.ClientDisconnected
							werkzeug.exceptions.SecurityError
						werkzeug.exceptions.Conflict
						werkzeug.exceptions.ExpectationFailed
						werkzeug.exceptions.FailedDependency
						werkzeug.exceptions.Forbidden
						werkzeug.exceptions.GatewayTimeout
						werkzeug.exceptions.Gone
						werkzeug.exceptions.HTTPVersionNotSupported
						werkzeug.exceptions.ImATeapot
						werkzeug.exceptions.InternalServerError
						werkzeug.exceptions.LengthRequired
						werkzeug.exceptions.Locked
						werkzeug.exceptions.MethodNotAllowed
						werkzeug.exceptions.NotAcceptable
						werkzeug.exceptions.NotFound
						werkzeug.exceptions.NotImplemented
						werkzeug.exceptions.PreconditionFailed
						werkzeug.exceptions.PreconditionRequired
						werkzeug.exceptions.RequestEntityTooLarge
						werkzeug.exceptions.RequestHeaderFieldsTooLarge
						werkzeug.exceptions.RequestTimeout
						werkzeug.exceptions.RequestURITooLarge
						werkzeug.exceptions.RequestedRangeNotSatisfiable
						werkzeug.exceptions.Unauthorized
						werkzeug.exceptions.UnavailableForLegalReasons
						werkzeug.exceptions.UnprocessableEntity
						werkzeug.exceptions.UnsupportedMediaType
						werkzeug.exceptions._RetryAfter
							werkzeug.exceptions.ServiceUnavailable
							werkzeug.exceptions.TooManyRequests
			werkzeug.exceptions.HTTPException
			werkzeug.test.ClientRedirectError
	◆_io._IOBase
		◆_io._RawIOBase
			◆io.RawIOBase
				werkzeug.serving.DechunkedInput
		◆io.IOBase
			werkzeug.wsgi.LimitedStream
	◆collections.abc.Container
		◆collections.abc.Iterable
			◆collections.abc.Sized
				◆collections.abc.Collection
					◆collections.abc.Set
						◆collections.abc.MutableSet
							werkzeug.datastructures.HeaderSet
					werkzeug.datastructures.ETags
	◆dict
		werkzeug.datastructures.ImmutableDictMixin
			werkzeug.datastructures.Authorization
			werkzeug.datastructures.ImmutableDict
			werkzeug.datastructures.ImmutableMultiDictMixin
				werkzeug.datastructures.CombinedMultiDict
				werkzeug.datastructures.ImmutableMultiDict
				werkzeug.datastructures.ImmutableOrderedMultiDict
			werkzeug.datastructures.ImmutableTypeConversionDict
			werkzeug.datastructures.RequestCacheControl
		werkzeug.datastructures.TypeConversionDict
			werkzeug.datastructures.ImmutableDictMixin
			werkzeug.datastructures.MultiDict
				werkzeug.datastructures.FileMultiDict
				werkzeug.datastructures.ImmutableDictMixin
				werkzeug.datastructures.OrderedMultiDict
					werkzeug.datastructures.ImmutableDictMixin
		werkzeug.datastructures.UpdateDictMixin
			werkzeug.datastructures.CallbackDict
			werkzeug.datastructures.ContentSecurityPolicy
			werkzeug.datastructures.WWWAuthenticate
			werkzeug.datastructures._CacheControl
				werkzeug.datastructures.ImmutableDictMixin
				werkzeug.datastructures.ResponseCacheControl
	◆http.cookiejar.CookieJar
		werkzeug.test._TestCookieJar
	◆list
		werkzeug.datastructures.ImmutableListMixin
			werkzeug.datastructures.ImmutableList
				werkzeug.datastructures.Accept
					werkzeug.datastructures.CharsetAccept
					werkzeug.datastructures.LanguageAccept
					werkzeug.datastructures.MIMEAccept
	◆logging.Filterer
		◆logging.Handler
			◆logging.StreamHandler
				werkzeug._internal._ColorStreamHandler
	◆property
		werkzeug.utils.cached_property
	◆socketserver.BaseRequestHandler
		◆socketserver.StreamRequestHandler
			◆http.server.BaseHTTPRequestHandler
				werkzeug.serving.WSGIRequestHandler
	◆socketserver.BaseServer
		◆socketserver.TCPServer
			◆http.server.HTTPServer
				werkzeug.serving.BaseWSGIServer
					◆socketserver.ThreadingMixIn
						werkzeug.serving.ThreadedWSGIServer
					werkzeug.serving.ForkingMixIn
						werkzeug.serving.ForkingWSGIServer
	◆tuple
		werkzeug.urls._URLTuple
			werkzeug.urls.BaseURL
				werkzeug.urls.BytesURL
				werkzeug.urls.URL
	◆typing.Generic
		werkzeug._internal._DictAccessorProperty
			werkzeug.utils.environ_property
			werkzeug.utils.header_property
	werkzeug._internal._Missing
	werkzeug.datastructures.ContentRange
	werkzeug.datastructures.FileStorage
	werkzeug.datastructures.Headers
		werkzeug.datastructures.ImmutableHeadersMixin
			werkzeug.datastructures.EnvironHeaders
	werkzeug.datastructures.IfRange
	werkzeug.datastructures.ImmutableDictMixin
	werkzeug.datastructures.ImmutableHeadersMixin
	werkzeug.datastructures.ImmutableListMixin
	werkzeug.datastructures.Range
	werkzeug.datastructures._omd_bucket
	werkzeug.exceptions.Aborter
	werkzeug.formparser.FormDataParser
	werkzeug.formparser.MultiPartParser
	werkzeug.sansio.multipart.Event
		werkzeug.sansio.multipart.Data
		werkzeug.sansio.multipart.Epilogue
		werkzeug.sansio.multipart.Field
		werkzeug.sansio.multipart.File
		werkzeug.sansio.multipart.NeedData
		werkzeug.sansio.multipart.Preamble
	werkzeug.sansio.multipart.MultipartDecoder
	werkzeug.sansio.multipart.MultipartEncoder
	werkzeug.sansio.request.Request
		werkzeug.wrappers.request.Request
	werkzeug.sansio.response.Response
		werkzeug.wrappers.response.Response
			werkzeug.test.TestResponse
	werkzeug.serving.ForkingMixIn
	werkzeug.test.Client
	werkzeug.test.EnvironBuilder
	werkzeug.test._TestCookieHeaders
	werkzeug.test._TestCookieResponse
	werkzeug.user_agent.UserAgent
	werkzeug.wrappers.response.ResponseStream
	werkzeug.wsgi.ClosingIterator
	werkzeug.wsgi.FileWrapper
	werkzeug.wsgi._RangeWrapper
	◆Enum
		◆int
			◆IntEnum
				HTTPStatus
		COEP
		COOP
		State

模块全展开

☘️【werkzeug】

werkzeug, fullname=werkzeug, file=werkzeug_init_.py

统计

序号 类别 数量
4 str 5
6 list 1
8 dict 1
9 module 14
10 class 3
11 function 1
13 residual 3
14 system 10
15 private 1
16 all 28

模块

1 werkzeug._internal

_internal, fullname=werkzeug._internal, file=werkzeug_internal.py

2 werkzeug.exceptions

exceptions, fullname=werkzeug.exceptions, file=werkzeug\exceptions.py

实现了许多可以在视图中引发的Python异常,以触发标准的HTTP非200响应。
使用实例:
    from werkzeug.wrappers.request import Request
        from werkzeug.exceptions import HTTPException, NotFound

        def view(request):
            raise NotFound()

        @Request.application
        def application(request):
            try:
                return view(request)
            except HTTPException as e:
                return e
从这个例子中可以看到,这些异常是可调用的WSGI应用程序。然而,它们不是Werkzeug响应对象。
您可以通过在HTTP异常上调用``get response()``来获取响应对象。
请记住,您可能必须传递一个环境(WSGI)或范围(ASGI)来``get_response()``,因为一些错误会获取与请求相关的额外信息。
如果你想钩入一个不同的异常页面,比如404状态码,你可以为一个错误的特定子类添加第二个例外:
    @Request.application
    def application(request):
        try:
            return view(request)
        except NotFound as e:
            return not_found(request)
        except HTTPException as e:
            return e

3 werkzeug.urls

urls, fullname=werkzeug.urls, file=werkzeug\urls.py

处理url的函数。包含来自 :mod:`urllib.parse` 的函数实现,处理字节和字符串的函数。

4 werkzeug.serving

serving, fullname=werkzeug.serving, file=werkzeug\serving.py

仅在开发期间使用的WSGI和HTTP服务器。
这个服务器使用起来很方便,但并不是特别稳定、安全或高效。
在部署到生产环境时,使用专用的WSGI服务器和HTTP服务器。它提供了交互式调试和代码重载等特性。
使用``run_simple``启动服务器。将其放入run.py脚本中:
    from myapp import create_app
    from werkzeug import run_simple

5 werkzeug.sansio

sansio, fullname=werkzeug.sansio, file=werkzeug\sansio_init_.py

6 werkzeug.http

http, fullname=werkzeug.http, file=werkzeug\http.py

7 werkzeug.datastructures

datastructures, fullname=werkzeug.datastructures, file=werkzeug\datastructures.py

8 werkzeug.security

security, fullname=werkzeug.security, file=werkzeug\security.py

9 werkzeug.wsgi

wsgi, fullname=werkzeug.wsgi, file=werkzeug\wsgi.py

10 werkzeug.utils

utils, fullname=werkzeug.utils, file=werkzeug\utils.py

11 werkzeug.formparser

formparser, fullname=werkzeug.formparser, file=werkzeug\formparser.py

12 werkzeug.user_agent

user_agent, fullname=werkzeug.user_agent, file=werkzeug\user_agent.py

13 werkzeug.wrappers

wrappers, fullname=werkzeug.wrappers, file=werkzeug\wrappers_init_.py

14 werkzeug.test

test, fullname=werkzeug.test, file=werkzeug\test.py

函数

15 run_simple(hostname: str, port: int, application:WSGIApplication', use_reloader: bool = False, use_debugger: bool = False, use_evalex: bool = True, extra_files: Union[Iterable[str], NoneType] = None, exclude_patterns: Union[Iterable[str], NoneType] = None, reloader_interval: int = 1, reloader_type: str =auto’, threaded: bool = False, processes: int = 1, request_handler: Union[Type[werkzeug.serving.WSGIRequestHandler], NoneType] = None, static_files: Union[Dict[str, Union[str, Tuple[str, str]]], NoneType] = None, passthrough_errors: bool = False, ssl_context: Union[ForwardRef(‘ssl.SSLContext’), Tuple[str, Union[str, NoneType]], ForwardRef(“te.Literal[‘adhoc’]”), NoneType] = None) -> None

run_simple(hostname: str, port: int, application:WSGIApplication', use_reloader: bool = False, use_debugger: bool = False, use_evalex: bool = True, extra_files: Union[Iterable[str], NoneType] = None, exclude_patterns: Union[Iterable[str], NoneType] = None, reloader_interval: int = 1, reloader_type: str =auto’, threaded: bool = False, processes: int = 1, request_handler: Union[Type[werkzeug.serving.WSGIRequestHandler], NoneType] = None, static_files: Union[Dict[str, Union[str, Tuple[str, str]]], NoneType] = None, passthrough_errors: bool = False, ssl_context: Union[ForwardRef(‘ssl.SSLContext’), Tuple[str, Union[str, NoneType]], ForwardRef(“te.Literal[‘adhoc’]”), NoneType] = None) -> None, module=werkzeug.serving, line:907 at site-packages\werkzeug\serving.py

该函数启动一个WSGI应用程序的开发服务器。可以启用各种可选功能。
警告:
不要在部署到生产环境时使用开发服务器。它仅用于本地开发。它并不特别高效、稳定或安全。
参数:
- hostname:要绑定的主机,例如 "localhost"。可以是域名、IPv4或IPv6地址,或以 "unix://" 开头的文件路径,用于Unix套接字。
- port:要绑定的端口,例如 "8080"。使用 0 告诉操作系统选择一个随机空闲端口。
- application:要运行的WSGI应用程序。
- use_reloader:使用重新加载程序进程在文件更改时重新启动服务器进程。
- use_debugger:使用 Werkzeug 的调试器,在未处理的异常上显示格式化的回溯。
- use_evalex:使调试器交互式。可以为回溯中的任何帧打开Python终端。通过需要 PIN 来提供一些保护,但这永远不应在公开可见的服务器上启用。
- extra_files:重新加载程序将监视这些文件的更改,除了Python模块。例如,监视配置文件。
- exclude_patterns:重新加载程序将忽略与这些 fnmatch 模式匹配的任何文件的更改。例如,忽略缓存文件。
- reloader_interval:重新加载程序尝试检查更改的频率。
- reloader_type:要使用的重新加载程序。"stat" 重新加载程序内置,但可能需要大量的 CPU 来监视文件。"watchdog" 重新加载程序要高效得多,但需要首先安装 watchdog 包。
- threaded:使用线程处理并发请求。不能与 processes 一起使用。
- processes:使用最多这些进程处理并发请求。不能与 threaded 一起使用。
- request_handler:使用不同的 BaseHTTPServer.BaseHTTPRequestHandler 子类来处理请求。
- static_files:将 URL 前缀映射到使用 werkzeug.middleware.SharedDataMiddleware 从中提供静态文件的目录的字典。
- passthrough_errors:不要在服务器级别捕获未处理的异常,而是让服务器崩溃。如果启用了 use_debugger,则调试器仍将捕获此类错误。
- ssl_context:配置 TLS 以通过 HTTPS 提供服务。可以是 ssl.SSLContext 对象、"(cert_file, key_file)" 元组以创建典型上下文,或字符串 "adhoc" 以生成临时自签名证书。
版本更改:
- 版本更改:2.1 指出如何处理“地址已在使用”错误。
- 版本更改:2.1 在 0.0.0.0 或 :: 上运行还显示环回 IP 以及实际 IP。
- 版本更改:2.1 删除了命令行界面。
- 版本更改:2.0 在 0.0.0.0 或 :: 上运行显示绑定的真实 IP 地址以及不要在生产环境中运行开发服务器的警告。
- 版本更改:2.0 添加了 exclude_patterns 参数。
- 版本更改:0.15 通过传递以 unix:// 开头的 hostname 来绑定 Unix 套接字。
- 版本更改:0.10 改进了重新加载程序,并通过 reloader_type 参数添加了更改后端的支持。
- 版本更改:0.9 添加了命令行界面。
- 版本更改:0.8 ssl_context 可以是证书和私钥文件路径的元组。
- 版本更改:0.6 添加了 ssl_context 参数。
- 版本更改:0.5 添加了 static_files 和 passthrough_errors 参数。

16 werkzeug.test.Client

Client, werkzeug.test.Client, module=werkzeug.test, line:837 at site-packages\werkzeug\test.py

这个类允许你向一个包含的应用发送请求。
use_cookies参数指示是否应存储和发送cookie以供后续请求使用。默认情况下为True,但传递False将禁用此行为。
如果你想请求应用程序的某个子域,可以将allow_subdomain_redirects设置为True,否则不允许外部重定向。
版本更改:2.1    已删除将响应视为元组的弃用行为。在返回的响应对象上,所有数据都可用作属性。
版本更改:2.0    response_wrapper始终是TestResponse的子类。
版本更改:0.5    添加了use_cookies参数。

method

1 delete(self, *args: t.Any, **kw: t.Any) -> “TestResponse”:

kind=method class=Client objtype=function line:1153 at …\lib\site-packages\werkzeug\test.py

调用:meth:`open`并将`method``设置为`DELETE``。

2 delete_cookie(

kind=method class=Client objtype=function line:929 at …\lib\site-packages\werkzeug\test.py

删除测试客户端的cookie。

3 get(self, *args: t.Any, **kw: t.Any) -> “TestResponse”:

kind=method class=Client objtype=function line:1138 at …\lib\site-packages\werkzeug\test.py

调用:meth:`open`并将`method``设置为`GET``。

4 head(self, *args: t.Any, **kw: t.Any) -> “TestResponse”:

kind=method class=Client objtype=function line:1168 at …\lib\site-packages\werkzeug\test.py

调用:meth:`open`并将`method``设置为`HEAD``。

5 open()

kind=method class=Client objtype=function line:1032 at …\lib\site-packages\werkzeug\test.py

生成一个环境字典,用给定的参数向应用程序发出请求,并返回响应。
    参数:
    :param args:               传递给EnvironBuilder以创建请求的环境变量。如果只传递一个参数,则可以是现有的EnvironBuilder或环境字典。
    :param buffered:           将应用程序返回的迭代器转换为列表。如果迭代器有一个“close()”方法,则会自动调用它。
    :param follow_redirects:   发送额外的请求以跟随HTTP重定向,直到返回非重定向状态。TestResponse.history列出中间响应。
    版本变更:2.1    删除了“as_tuple”参数。
    版本变更:2.0    “as_tuple”已弃用,并将在Werkzeug 2.1中删除。使用TestResponse.request和request.environ替代。
    版本变更:2.0    调用“response.close()”时,请求输入流被关闭。重定向的输入流会自动关闭。
    版本变更:0.5    如果将字典作为数据参数的文件提供,那么内容类型必须称为“content_type”,而不是“mimetype”。这个改变是为了与werkzeug.FileWrapper的一致性。
    版本变更:0.5    添加了“follow_redirects”参数。

6 options(self, *args: t.Any, **kw: t.Any) -> “TestResponse”:

kind=method class=Client objtype=function line:1163 at …\lib\site-packages\werkzeug\test.py

调用:meth:`open`并将`method``设置为`OPTIONS``。

7 patch(self, *args: t.Any, **kw: t.Any) -> “TestResponse”:

kind=method class=Client objtype=function line:1158 at …\lib\site-packages\werkzeug\test.py

调用:meth:`open`并将`method``设置为`PATCH``。

8 post(self, *args: t.Any, **kw: t.Any) -> “TestResponse”:

kind=method class=Client objtype=function line:1143 at …\lib\site-packages\werkzeug\test.py

调用:meth:`open`并将`method``设置为`POST``。

9 put(self, *args: t.Any, **kw: t.Any) -> “TestResponse”:

kind=method class=Client objtype=function line:1148 at …\lib\site-packages\werkzeug\test.py

调用:meth:`open`并将`method``设置为`PUT``。

10 resolve_redirect(

kind=method class=Client objtype=function line:969 at …\lib\site-packages\werkzeug\test.py

对前一个请求的重定向响应所给出的位置执行新请求。	
:meta private:

11 run_wsgi_app()

kind=method class=Client objtype=function line:952 at …\lib\site-packages\werkzeug\test.py

在给定的环境下运行包装好的WSGI应用程序。	
:meta private:

12 set_cookie(

kind=method class=Client objtype=function line:894 at …\lib\site-packages\werkzeug\test.py

在客户端的cookie罐中设置一个cookie。服务器名是必需的,并且必须与传递给公开调用的服务器名相匹配。

13 trace(self, *args: t.Any, **kw: t.Any) -> “TestResponse”:

kind=method class=Client objtype=function line:1173 at …\lib\site-packages\werkzeug\test.py

调用:meth:`open`并将`method``设置为`TRACE``。

17 werkzeug.wrappers.request.Request

Request, werkzeug.wrappers.request.Request, module=werkzeug.wrappers.request, line:29 at site-packages\werkzeug\wrappers\request.py

表示一个传入的WSGI HTTP请求,其头和正文取自WSGI环境。
具有用于使用各种HTTP规范定义的功能的属性和方法。
请求对象中的数据是只读的。假定文本数据使用UTF-8编码,这对于绝大多数现代客户机来说应该是正确的。
使用客户端设置的编码在Python中是不安全的,因为它提供了额外的编码,例如``zip``。要更改假定的编码,请创建子类并替换 :attr:`charset`。
:param environ:     WSGI环境由WSGI服务器生成,包含有关服务器配置和客户端请求的信息。
:param populate_request:    将此请求对象以``environ[`werkzeug.request`]``的形式添加到WSGI环境中。在调试时很有用。
:param shallow:             使得读取:attr:`stream`(以及任何将从中读取的方法)引发:exc:`RuntimeError`。
                            防止在中间件中使用表单数据,这将使最终应用程序无法使用表单数据。
版本变更: 2.1                删除``disable_data_descriptor``属性。
版本变更: 2.0               将“BaseRequest”和“mixins”合并成一个“Request”类。使用旧的类是不赞成的,并将在Werkzeug 2.1中删除。
版本变更: 0.5               所有数据的不可变类强制使用只读模式。

data

1 form_data_parser_class=werkzeug.formparser.FormDataParser'> kind:data type:type class:werkzeug.wrappers.request.Request’>
2 input_stream= kind:data type:environ_property class:werkzeug.wrappers.request.Request'> 3 is_multiprocess= kind:data type:environ_property class:werkzeug.wrappers.request.Request’>
4 is_multithread= kind:data type:environ_property class:werkzeug.wrappers.request.Request'> 5 is_run_once= kind:data type:environ_property class:werkzeug.wrappers.request.Request’>
6 json_module=jsonfrom...\\lib\\json\\__init__.py'> kind:data type:module class:werkzeug.wrappers.request.Request’>
7 max_content_length=None kind:data type:NoneType class:werkzeug.wrappers.request.Request'> 8 max_form_memory_size=None kind:data type:NoneType class:werkzeug.wrappers.request.Request’>
9 max_form_parts=1000 kind:data type:int class:werkzeug.wrappers.request.Request'> 10 remote_user= kind:data type:environ_property class:werkzeug.wrappers.request.Request’>

property

11 data= kind:property type:cached_property class:werkzeug.wrappers.request.Request'> 12 files= kind:property type:cached_property class:werkzeug.wrappers.request.Request’>
13 form= kind:property type:cached_property class:werkzeug.wrappers.request.Request'> 14 json= kind:property type:property class:werkzeug.wrappers.request.Request’>
15 script_root= kind:property type:property class:werkzeug.wrappers.request.Request'> 16 stream= kind:property type:cached_property class:werkzeug.wrappers.request.Request’>
17 url_root= kind:property type:cached_property class:werkzeug.wrappers.request.Request'> 18 values= kind:property type:cached_property class:werkzeug.wrappers.request.Request’>
19 want_form_data_parsed= kind:property type:property class:

method

20 close(self) -> None:

kind=method class=Request objtype=function line:304 at …\lib\site-packages\werkzeug\wrappers\request.py

关闭此请求对象的相关资源。这显式地关闭所有文件句柄。
你也可以在with语句中使用request对象来自动关闭它。
版本增加: 0.9

21 get_data(

kind=method class=Request objtype=function line:365 at …\lib\site-packages\werkzeug\wrappers\request.py

这将从客户机读取缓冲的传入数据到一个字节的对象中。
默认情况下,这是缓存的,但这种行为可以通过将“cache”设置为“False”来改变。
通常,不首先检查内容长度就调用此方法是一个坏主意,因为客户机可能会发送几十兆字节或更多的内容,从而导致服务器出现内存问题。
注意,如果表单数据已经被解析过,这个方法将不会返回任何东西,因为表单数据解析不会像这个方法那样缓存数据。
要隐式调用表单数据解析函数,请将`parse_form_data`设置为`True`。
完成此操作后,如果表单解析器处理数据,则此方法的返回值将是一个空字符串。
这通常是不必要的,因为如果缓存了整个数据(这是默认情况),表单解析器将使用缓存的数据来解析表单数据。
在调用此方法之前,请首先检查内容长度,以避免耗尽服务器内存。如果`as text`被设置为`True`,返回值将是一个解码的字符串。	
版本增加: 0.9

22 get_json(

kind=method class=Request objtype=function line:555 at …\lib\site-packages\werkzeug\wrappers\request.py

将:attr:`data`解析为JSON。
如果mimetype不表示JSON (:mimetype:`application/ JSON`,请参阅:attr:`is JSON`),
或解析失败,则调用:meth:`on JSON loading failed`,并使用其返回值作为返回值。
默认情况下,这会引发400 Bad Request错误。
:param force:忽略mime类型,始终尝试解析JSON。
:param silent:沉默mime类型和解析错误,并返回`None`。
:param cache:存储解析后的JSON以供后续调用返回。
版本变更: 2.1如果内容类型不正确则抛出400错误。

23 make_form_data_parser(self) -> FormDataParser:

kind=method class=Request objtype=function line:243 at …\lib\site-packages\werkzeug\wrappers\request.py

创建表单数据解析器。用一些参数实例化 :attr:`form_data_parser_class` 。
版本增加: 0.8

24 on_json_loading_failed(self, e: t.Optional[ValueError]) -> t.Any:

kind=method class=Request objtype=function line:618 at …\lib\site-packages\werkzeug\wrappers\request.py

如果:meth:`get_json`失败且未静音则调用。
    如果这个方法返回一个值,它将被用作:meth:`get_json`的返回值。
    默认实现会引发:exc:`~werkzeug.exceptions.BadRequest`。
    :param e:   如果解析失败,这是异常。如果内容类型不是``application/json``,它将是“None”。

class method

25 application(

kind=class method class=Request objtype=classmethod line:162 at …\lib\site-packages\werkzeug\wrappers\request.py

将函数转换为类方法。

26 from_values(cls, *args: t.Any, **kwargs: t.Any) -> “Request”:

kind=class method class=Request objtype=classmethod line:133 at …\lib\site-packages\werkzeug\wrappers\request.py

将函数转换为类方法。

18 werkzeug.wrappers.response.Response

Response, werkzeug.wrappers.response.Response, module=werkzeug.wrappers.response, line:67 at site-packages\werkzeug\wrappers\response.py

表示带有body、status和header的传出WSGI HTTP响应。
    具有用于使用各种HTTP规范定义的功能的属性和方法。
    响应体是灵活的,可以支持不同的用例。简单的形式是传递字节,或将被编码为UTF-8的字符串。
    传递一个字节或字符串的可迭代对象使其成为流响应。
    生成器对于在内存中构建CSV文件或使用SSE (Server Sent Events)特别有用。类文件对象也是可迭代的,尽管:func:`~werkzeug.utils.send_file`。
    在这种情况下,应该使用Send file`helper。
    响应对象本身是一个可调用的WSGI应用程序。当使用``environ``和``start_response``调用(:meth:`__call__`) 时,它会将其状态和头传递给``start_response``,
    然后将其主体作为可迭代对象返回。
    代码块:
        from werkzeug.wrappers.response import Response
        def index():
            return Response("Hello, World!")
        def application(environ, start_response):
            path = environ.get("PATH_INFO") or "/"
            if path == "/":
                response = index()
            else:
                response = Response("Not Found", status=404)
            return response(environ, start_response)
    :param response:响应正文的数据。用于固定长度响应的字符串或字节,或字符串或字节的元组或列表,或用于流响应的任何其他字符串或字节可迭代对象。默认为空主体。
    :param status:响应的状态码。可以是int,在这种情况下会添加默认状态消息,或者是``{code} {message}``'形式的字符串,如``404 Not Found``。默认为200。
    :param headers: 一个:class:`~werkzeug.datastructures.Headers`对象,或将被转换为``Headers``对象的``(键,值)``元组列表。
    :param mimetype:响应的mime类型(不带字符集和其他参数的内容类型)。如果值以 ``text/``(或匹配一些其他特殊情况)开头,字符集将被添加以创建``content_type``。
    :param content_type:响应的完整内容类型。覆盖从``mimetype``构建值。
    :param direct_passthrough:将响应体作为WSGI可迭代对象直接传递。当主体是二进制文件或其他字节迭代器时,可以使用此方法跳过一些不必要的检查。
            使用:func:`~werkzeug.utils.send_file`,而不是手动设置。
    版本变更: 2.0
            将``BaseResponse``和mixins合并成一个“Response”类。使用旧的类是不赞成的,并将在Werkzeug 2.1中删除。
    版本变更: 0.5增加 ``direct_passthrough``  参数。

data

1 autocorrect_location_header=False kind:data type:bool class:werkzeug.wrappers.response.Response'> 2 automatically_set_content_length=True kind:data type:bool class:werkzeug.wrappers.response.Response’>
3 implicit_sequence_conversion=True kind:data type:bool class:werkzeug.wrappers.response.Response'> 4 json_module=jsonfrom…\lib\json\init.py’> kind:data type:module class:

property

5 data= kind:property type:property class:werkzeug.wrappers.response.Response'> 6 is_sequence= kind:property type:property class:werkzeug.wrappers.response.Response’>
7 is_streamed= kind:property type:property class:werkzeug.wrappers.response.Response'> 8 json= kind:property type:property class:werkzeug.wrappers.response.Response’>
9 stream= kind:property type:cached_property class:

method

10 add_etag(self, overwrite: bool = False, weak: bool = False) -> None:

kind=method class=Response objtype=function line:832 at …\lib\site-packages\werkzeug\wrappers\response.py

为当前响应添加一个标签(如果还没有)。	
版本变更: 2.0使用SHA-1算法生成。MD5在某些环境中可能不可用。

11 calculate_content_length(self) -> t.Optional[int]:

kind=method class=Response objtype=function line:345 at …\lib\site-packages\werkzeug\wrappers\response.py

如果可用则返回内容长度,否则返回`None`。

12 call_on_close(self, func: t.Callable[[], t.Any]) -> t.Callable[[], t.Any]:

kind=method class=Response objtype=function line:210 at …\lib\site-packages\werkzeug\wrappers\response.py

将一个函数添加到关闭响应时应调用的函数的内部列表中。
    从0.7开始,这个函数也会返回传递的函数,这样它就可以用作装饰器。
    版本增加: 0.6

13 close(self) -> None:

kind=method class=Response objtype=function line:434 at …\lib\site-packages\werkzeug\wrappers\response.py

如果可能,关闭包装后的响应。你也可以在with语句中使用该对象来自动关闭它。	
版本增加: 0.9现在可以在with语句中使用。

14 freeze(self) -> None:

kind=method class=Response objtype=function line:452 at …\lib\site-packages\werkzeug\wrappers\response.py

将响应对象准备好以进行pickle。执行以下操作:
* 将响应缓冲到列表中,忽略 ``implicity_sequence_conversion`` 和 ``direct_passthrough`` 属性。
* 设置 ``Content-Length`` 头。
* 如果未设置,则生成 ``ETag`` 头。
版本更改:
2.1: 删除了 ``no_etag`` 参数。
2.0: 添加了 ``ETag`` 头,``no_etag`` 参数已弃用,并将在 Werkzeug 2.1 中删除。
0.6: 设置了 ``Content-Length`` 头。

15 get_app_iter(self, environ: “WSGIEnvironment”) -> t.Iterable[bytes]:

kind=method class=Response objtype=function line:571 at …\lib\site-packages\werkzeug\wrappers\response.py

返回给定环境的应用程序迭代器。根据请求方法和当前状态码,返回值可能是空响应而不是响应之一。
    如果请求方法是`HEAD`或状态代码在范围内,在HTTP规范要求空响应的情况下,将返回一个空的可迭代对象。
    版本增加:0.6
    :param environ: 请求的WSGI环境。
    :return:        响应可迭代对象。

16 get_data(self, as_text: “te.Literal[False]” = False) -> bytes:

kind=method class=Response objtype=function line:294 at …\lib\site-packages\werkzeug\wrappers\response.py

响应体的字符串表示形式。每次调用此属性时,响应可迭代对象都会被编码并展平。
    如果您流式传输大量数据,这可能会导致意外的行为。
    通过将 :attr:`implicit_sequence_conversion` 设置为`False`,可以禁用此行为。
    如果将`as_text`设置为`True`,返回值将是一个解码后的字符串。
    版本增加:0.9

17 get_json(self, force: bool = …, silent: “te.Literal[False]” = …) -> t.Any:

kind=method class=Response objtype=function line:649 at …\lib\site-packages\werkzeug\wrappers\response.py

将:attr:`data`解析为JSON格式。在测试过程中很有用。
    如果MIME类型不是JSON(:mimetype:`application/json`,参见:attr:`is_json`),则返回``None``。
    与:meth:`Request.get_json`不同,此结果不会被缓存。
    :param force: 忽略MIME类型并始终尝试解析JSON。
    :param silent: 静默解析错误并返回``None``。

18 get_wsgi_headers(self, environ: “WSGIEnvironment”) -> Headers:

kind=method class=Response objtype=function line:478 at …\lib\site-packages\werkzeug\wrappers\response.py

这将在响应启动之前自动调用,并返回针对给定环境修改的标头。
    它从响应中返回报头的副本,并在必要时进行一些修改。
    例如,位置标头(如果存在)与环境的根URL连接在一起。此外,对于某些状态码,内容长度在这里自动设置为零。
    版本变更: 0.6
    以前,该函数被称为“fix headers”,并在适当的位置修改响应对象。
    同样从0.6开始,位置和内容位置标头中的IRIs得到了正确的处理。同样从0.6开始,Werkzeug将尝试设置内容长度,如果它能够自己计算出来的话。
    如果响应可迭代对象中的所有字符串都已编码并且可迭代对象已被缓冲,则会出现这种情况。
    :param environ: 请求的WSGI环境。
    :return:        返回一个新的类: class:`~werkzeug.datastructures.Headers` 对象。

19 get_wsgi_response(

kind=method class=Response objtype=function line:600 at …\lib\site-packages\werkzeug\wrappers\response.py

以元组的形式返回最终的WSGI响应。元组中的第一项是应用程序迭代器,第二项是状态,第三项是标题列表。
返回的响应是专门为给定环境创建的。例如,如果WSGI环境中的请求方法是“HEAD”,则响应将为空,并且只显示头和状态码。
版本增加: 0.6:
:param environ: 请求的WSGI环境。
:return:        ``(app_iter, status, headers)``元组。

20 iter_encoded(self) -> t.Iterator[bytes]:

kind=method class=Response objtype=function line:395 at …\lib\site-packages\werkzeug\wrappers\response.py

用响应的编码对响应进行编码。如果响应对象被作为WSGI应用程序调用,则该方法的返回值被用作应用程序迭代器,除非:attr:`direct_passthrough`被激活。

21 make_conditional(

kind=method class=Response objtype=function line:757 at …\lib\site-packages\werkzeug\wrappers\response.py

对请求作出有条件的响应。
    如果已经为响应定义了etag,则此方法最有效。
    可以使用`add_etag`方法来做到这一点。如果调用时不带etag,则只设置日期头。
    如果请求或环境中的请求方法不是GET或HEAD,则此方法不执行任何操作。
    为了在处理范围请求时获得最佳性能,建议您的响应数据对象实现`seekable`、`seek`和`tell`。
    方法由:py:class:`io.IOBase`描述。返回的对象 :meth:`~werkzeug.wsgi.wrap_file` 自动实现这些方法。
    它不会删除响应体,因为这是 :meth:`__call__` 函数自动为我们做的事情。
    返回self,这样你就能做``return resp.make_conditional(req)``,但在适当位置修改对象。
    :param request_or_environ:  用于使响应成为条件的请求对象或WSGI环境。
    :param accept_ranges:       该参数指定`Accept-Ranges`报头的值。如果``False``(默认),则不设置标头。
                                如果``True``,它将被设置为``bytes``'。
                                如果``None``,它将被设置为``None``。
                                如果它是一个字符串,它将使用这个值。
    :param complete_length:     将仅在有效范围请求中使用。它将设置“Content-Range”完整长度值并计算“Content-Length”实值。
                                成功完成Range Requests时,此参数是必选的。
    :raises:                    class:`~werkzeug.exceptions.RequestedRangeNotSatisfiable`。如果`Range`报头不能被解析或满足。
    版本变更: 2.0               如果length为0则跳过范围处理,而不是引发416 Range Not Satisfiable错误。

22 make_sequence(self) -> None:

kind=method class=Response objtype=function line:378 at …\lib\site-packages\werkzeug\wrappers\response.py

在列表中转换响应迭代器。
    默认情况下,如果需要,这将自动发生。
    如果禁用“隐式序列转换”,则不会自动调用此方法,并且某些属性可能会引发异常。这也编码了所有的项目。
版本增加: 0.6

23 set_data(self, value: t.Union[bytes, str]) -> None:

kind=method class=Response objtype=function line:322 at …\lib\site-packages\werkzeug\wrappers\response.py

设置一个新字符串作为响应。取值必须为字符串或字节。如果设置了字符串,则将其编码为响应的字符集(默认为utf-8)。	
版本增加: 0.9

class method

24 force_type(

kind=class method class=Response objtype=classmethod line:229 at …\lib\site-packages\werkzeug\wrappers\response.py

将函数转换为类方法。

25 from_app(

kind=class method class=Response objtype=classmethod line:274 at …\lib\site-packages\werkzeug\wrappers\response.py

将函数转换为类方法。

私有或局部

19 _internal werkzeug._internalfrom`…\lib\site-packages\werkzeug\_internal.py’>

统计

序号 类别 数量
1 int 1
4 str 4
8 dict 1
9 module 1
10 class 14
11 function 5
13 residual 11
14 system 8
15 private 2
16 all 37

常量

int

1 SEARCH_EXTRA_LENGTH 8

模块

2 re

re, fullname=re, file=re.py

函数

3 dataclass(_cls=None, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False)

dataclass(_cls=None, *, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False), module=dataclasses, line:987 at dataclasses.py

返回与传入的相同的类,并根据类中定义的字段添加不同的方法。
    检查PEP 526 __annotations__ 以确定字段。
    如果init为true,则在类中添加__init__() 方法。如果repr为true,则添加__repr__()方法。
    如果order为真,则会添加丰富的比较方法。如果unsafe_hash为真,则添加__hash__()方法函数。
    如果frozen为true,则实例创建后可能不会分配字段。

4 cast(typ, val)

cast(typ, val), module=typing, line:898 at typing.py

将值强制转换为类型。这将返回不变的值。
对于类型检查器,这表明返回值具有指定的类型,但在运行时,我们故意不检查任何内容(我们希望这尽可能快)。

5 _to_bytes(x: Union[str, bytes], charset: str =utf-8', errors: str =strict’) -> bytes

_to_bytes(x: Union[str, bytes], charset: str =utf-8', errors: str =strict’) -> bytes, module=werkzeug._internal, line:95 at site-packages\werkzeug_internal.py

6 _to_str(x: Union[Any, NoneType], charset: Union[str, NoneType] =utf-8', errors: str =strict’, allow_none_charset: bool = False) -> Union[str, bytes, NoneType]

_to_str(x: Union[Any, NoneType], charset: Union[str, NoneType] =utf-8', errors: str =strict’, allow_none_charset: bool = False) -> Union[str, bytes, NoneType], module=werkzeug._internal, line:130 at site-packages\werkzeug_internal.py

7 parse_options_header(value: Union[str, NoneType]) -> Tuple[str, Dict[str, str]]

parse_options_header(value: Union[str, NoneType]) -> Tuple[str, Dict[str, str]], module=werkzeug.http, line:390 at site-packages\werkzeug\http.py

解析一个``Content-Type``之类的标头到一个包含值和任意选项的元组:
        >>> parse_options_header('text/html; charset=utf8')
        ('text/html', {'charset':`utf8'})
    这应该不适用于``Cache-Control``之类的标头,它们使用不同的格式。对于那些,使用 :func:`parse_dict_header`。
    :param value:   要解析的报头值。
    版本变更: 2.2   选项名总是被转换成小写。
    版本变更: 2.1
    ``multiple``参数已弃用,并将在Werkzeug 2.2中删除。
    版本变更: 0.15:rfc:`2231`参数的延续被处理。
    版本增加: 0.5

8 enum.auto

auto, enum.auto, module=enum, line:50 at enum.py

实例被替换为Enum类套件中的适当值。

data

1 value= kind:data type:object class:

9 Enum

Enum, Enum, module=enum, line:128 at enum.py

通用的枚举。
从该类派生以定义新的枚举。

data

1 name= kind:data type:DynamicClassAttribute class:Enum'> 2 value= kind:data type:DynamicClassAttribute class:Enum’>

10 werkzeug.datastructures.Headers

Headers, werkzeug.datastructures.Headers, module=werkzeug.datastructures, line:848 at site-packages\werkzeug\datastructures.py

存储一些头文件的对象。
    它有一个类似字典的接口,但是是有序的,可以多次存储相同的键,迭代产生``(key, value)``对,而不仅仅是键。
    如果你想用一种更好的方式来处理以元组形式存储在列表中的WSGI标头,这个数据结构是很有用的。
    从Werkzeug 0.3开始,这个类引发的 :class:`~exceptions.BadRequest` HTTP异常,如果捕获到HTTP异常,将呈现一个``400 BAD REQUEST``的页面。
    Headers与Python :class:`wsgiref.headers.Headers` 基本兼容,但`__getitem__`除外。
            :mod:`wsgiref`将为`headers['missing']``返回`None`,而:class:`headers`将引发:class:`KeyError`。
            要创建一个新的“Headers”对象,传递给它一个列表、字典或其他具有默认值的“Headers”对象。验证这些值的方式与稍后添加的值相同。
    :param defaults:    :class:`Headers`的默认值列表。
    版本变更: 2.1.0 默认值与后续添加的值相同。
    版本变更: 0.9   这个数据结构现在存储unicode值的方式与多字典类似。主要的区别是字节也可以设置,这将自动被latin1解码。
    版本变更: 0.9   :meth:`linked`函数被删除而没有替换,因为它是一个不支持更改编码模型的API。

method

1 add(self, _key, _value, **kw)

kind=method class=Headers objtype=function line:1090 at …\lib\site-packages\werkzeug\datastructures.py

向列表中添加一个新的头元组。
    关键字参数可以为header值指定附加参数,下划线转换为虚线:
        >>> d = Headers()
        >>> d.add('Content-Type',`text/plain')
        >>> d.add('Content-Disposition',`attachment', filename='foo.png')
    转储在幕后使用 :func:`dump_options_header`
    版本增加: 0.4.1 为:mod:`wsgiref`兼容性添加了关键字参数

2 add_header(self, _key, _value, **_kw)

kind=method class=Headers objtype=function line:1122 at …\lib\site-packages\werkzeug\datastructures.py

向列表中添加一个新的头元组。为与:mod:`wsgiref` :meth:`~wsgiref.headers.Headers.add_header`兼容,:meth:`add`的别名。

3 clear(self)

kind=method class=Headers objtype=function line:1130 at …\lib\site-packages\werkzeug\datastructures.py

清除所有标头。

4 copy(self)

kind=method class=Headers objtype=function line:1283 at …\lib\site-packages\werkzeug\datastructures.py

5 extend(self, *args, **kwargs)

kind=method class=Headers objtype=function line:1007 at …\lib\site-packages\werkzeug\datastructures.py

使用来自另一个对象的项(包含头项和关键字参数)扩展此对象中的头项。
    要替换现有密钥而不是扩展,请使用:meth:`update`。
    如果提供,第一个参数可以是另一个:class:`Headers`对象,一个:class:`MultiDict`,:class:`dict`,或对的可迭代对象。
    版本变更: 1.0   支持:class:`MultiDict`。允许传递“kwargs”。

6 get(self, key, default=None, type=None, as_bytes=False)

kind=method class=Headers objtype=function line:919 at …\lib\site-packages\werkzeug\datastructures.py

如果请求的数据不存在,返回默认值。
    如果提供了`type`并且是一个可调用对象,它应该转换值,返回它,如果不可能,则引发:exc:`ValueError`。
    在这种情况下,函数将返回默认值,就像没有找到值一样:
    版本增加: 0.9增加了对`as bytes`的支持。参数key:要查找的键。
        >>> d = Headers([('Content-Length',`42')])
        >>> d.get('Content-Length', type=int)
        42
    :param key:     要查找的关键字。
    :param default: 查找不到键时返回的默认值。如果没有进一步指定,则返回`None`。
    :param type:    一个可调用对象,用于强制转换:类:`Headers`中的值。如果此可调用对象引发a:exc:`ValueError`,则返回默认值。
    :param as bytes:    返回字节而不是字符串。
    版本增加: 0.9   增加对`as_bytes`的支持。

7 get_all(self, name)

kind=method class=Headers objtype=function line:985 at …\lib\site-packages\werkzeug\datastructures.py

返回指定字段的所有值的列表。此方法与:mod:`wsgiref` :meth:`~wsgiref.headers.Headers.get_all`方法兼容。

8 getlist(self, key, type=None, as_bytes=False)

kind=method class=Headers objtype=function line:955 at …\lib\site-packages\werkzeug\datastructures.py

返回给定键的项列表。
    如果该键不在:class:`Headers`中,则返回值将是一个空列表。
    就像:meth:`get`一样,:meth:`getlist`接受一个`type`参数。所有的项都将用那里定义的可调用对象进行转换。
    版本增加: 0.9        增加了对`as_bytes`的支持。
    :param key:         要查找的键。参数类型:一个可调用对象,用于强制转换类型中的值 :class:`Headers`。
                        如果此可调用对象引发:exc:`ValueError`,则该值将从列表中删除。
    :return:            :class:键的所有值的`list`。
    :param as_bytes:    返回字节而不是字符串。

9 items(self, lower=False)

kind=method class=Headers objtype=function line:993 at …\lib\site-packages\werkzeug\datastructures.py

10 keys(self, lower=False)

kind=method class=Headers objtype=function line:999 at …\lib\site-packages\werkzeug\datastructures.py

11 pop(self, key=None, default=_missing)

kind=method class=Headers objtype=function line:1049 at …\lib\site-packages\werkzeug\datastructures.py

移除并返回键或索引。
    ::param key:    要弹出的键。如果这是一个整数,在该位置的项被删除,如果它是一个字符串,该键的值为。如果键省略或为“None”,则删除最后一项。
    :return:        一个项。

12 popitem(self)

kind=method class=Headers objtype=function line:1071 at …\lib\site-packages\werkzeug\datastructures.py

移除键或索引并返回(键,值)项。

13 remove(self, key)

kind=method class=Headers objtype=function line:1042 at …\lib\site-packages\werkzeug\datastructures.py

取下钥匙。
    :param key: 要删除的密钥。

14 set(self, _key, _value, **kw)

kind=method class=Headers objtype=function line:1134 at …\lib\site-packages\werkzeug\datastructures.py

删除`key`的所有头元组,并添加一个新的。
    如果没有条目,新添加的键要么出现在列表的末尾,要么替换第一个条目。
    关键字参数可以为头值指定附加参数,并将下划线转换为破折号。更多信息请参见:meth:`add`。
    版本变更: 0.6.1      :meth:`set`现在接受与:meth:`add`相同的参数。
    :param key:         要插入的密钥。
    :param value:       要插入的值。

15 setdefault(self, key, default)

kind=method class=Headers objtype=function line:1186 at …\lib\site-packages\werkzeug\datastructures.py

如果键在头文件中,则返回键的第一个值,否则将头文件设置为``default``给出的值并返回。
    :param key:     获取的报头密钥。
    :param default: 如果密钥不在头文件中,则为该密钥设置的值。

16 setlist(self, key, values)

kind=method class=Headers objtype=function line:1169 at …\lib\site-packages\werkzeug\datastructures.py

删除标题的所有现有值并添加新值。
    :param key:要设置的报头密钥。
    :param values:键值的可迭代对象。
    版本增加: 1.0

17 setlistdefault(self, key, default)

kind=method class=Headers objtype=function line:1201 at …\lib\site-packages\werkzeug\datastructures.py

如果键在头文件中,则返回键的值列表,否则将头文件设置为``default``给出的值列表并返回。
    不同的是:meth:`MultiDict.setlistdefault`,修改返回的列表不会影响头文件。
    :param key:     获取的报头密钥。
    :param default: 如果键不在头文件中,则为其设置一个可迭代值。
    版本增加: 1.0

18 to_wsgi_list(self)

kind=method class=Headers objtype=function line:1276 at …\lib\site-packages\werkzeug\datastructures.py

将报头转换为适合WSGI的列表。
    :返回:    列表

19 update(self, *args, **kwargs)

kind=method class=Headers objtype=function line:1238 at …\lib\site-packages\werkzeug\datastructures.py

将此对象中的头替换为来自另一个头对象和关键字参数的项。
    要扩展现有密钥而不是替换,请使用:meth:`extend`。
    如果提供,第一个参数可以是另一个:class:`Headers`对象,一个:class:`MultiDict`,:class:`dict`,或对的可迭代对象。
    版本增加: 1.0

20 values(self)

kind=method class=Headers objtype=function line:1003 at …\lib\site-packages\werkzeug\datastructures.py

11 werkzeug.exceptions.RequestEntityTooLarge

RequestEntityTooLarge, werkzeug.exceptions.RequestEntityTooLarge, module=werkzeug.exceptions, line:477 at site-packages\werkzeug\exceptions.py

*413*`Request Entity Too Large`
    `如果提交的数据超过给定的限制,应该返回的状态码。

data

1 code=413 kind:data type:int class:werkzeug.exceptions.RequestEntityTooLarge'> 2 description=The data value transmitted exceeds the capacity limit. kind:data type:str class:werkzeug.exceptions.RequestEntityTooLarge’>

12 werkzeug.sansio.multipart.Event

Event, werkzeug.sansio.multipart.Event, module=werkzeug.sansio.multipart, line:17 at site-packages\werkzeug\sansio\multipart.py

13 werkzeug.sansio.multipart.Preamble

Preamble, werkzeug.sansio.multipart.Preamble, module=werkzeug.sansio.multipart, line:22 at site-packages\werkzeug\sansio\multipart.py

Preamble(data: bytes)

14 werkzeug.sansio.multipart.Field

Field, werkzeug.sansio.multipart.Field, module=werkzeug.sansio.multipart, line:27 at site-packages\werkzeug\sansio\multipart.py

Field(name: str, headers: werkzeug.datastructures.Headers)

15 werkzeug.sansio.multipart.File

File, werkzeug.sansio.multipart.File, module=werkzeug.sansio.multipart, line:33 at site-packages\werkzeug\sansio\multipart.py

File(name: str, filename: str, headers: werkzeug.datastructures.Headers)

16 werkzeug.sansio.multipart.Data

Data, werkzeug.sansio.multipart.Data, module=werkzeug.sansio.multipart, line:40 at site-packages\werkzeug\sansio\multipart.py

Data(data: bytes, more_data: bool)

17 werkzeug.sansio.multipart.Epilogue

Epilogue, werkzeug.sansio.multipart.Epilogue, module=werkzeug.sansio.multipart, line:46 at site-packages\werkzeug\sansio\multipart.py

Epilogue(data: bytes)

18 werkzeug.sansio.multipart.NeedData

NeedData, werkzeug.sansio.multipart.NeedData, module=werkzeug.sansio.multipart, line:50 at site-packages\werkzeug\sansio\multipart.py

19 State

State, State, module=werkzeug.sansio.multipart, line:57 at site-packages\werkzeug\sansio\multipart.py

枚举。

data

1 COMPLETE=State.COMPLETE kind:data type:State class:State'> 2 DATA=State.DATA kind:data type:State class:State’>
3 EPILOGUE=State.EPILOGUE kind:data type:State class:State'> 4 PART=State.PART kind:data type:State class:State’>
5 PREAMBLE=State.PREAMBLE kind:data type:State class:

20 werkzeug.sansio.multipart.MultipartDecoder

MultipartDecoder, werkzeug.sansio.multipart.MultipartDecoder, module=werkzeug.sansio.multipart, line:79 at site-packages\werkzeug\sansio\multipart.py

将多部分消息作为字节解码为Python事件。部件数据作为可用数据返回,以便调用者可以根据需要将数据从内存保存到磁盘。

method

1 last_newline(self) -> int:

kind=method class=MultipartDecoder objtype=function line:126 at …\lib\site-packages\werkzeug\sansio\multipart.py

2 next_event(self) -> Event:

kind=method class=MultipartDecoder objtype=function line:149 at …\lib\site-packages\werkzeug\sansio\multipart.py

3 receive_data(self, data: Optional[bytes]) -> None:

kind=method class=MultipartDecoder objtype=function line:138 at …\lib\site-packages\werkzeug\sansio\multipart.py

21 werkzeug.sansio.multipart.MultipartEncoder

MultipartEncoder, werkzeug.sansio.multipart.MultipartEncoder, module=werkzeug.sansio.multipart, line:256 at site-packages\werkzeug\sansio\multipart.py

method

1 send_event(self, event: Event) -> bytes:

kind=method class=MultipartEncoder objtype=function line:261 at …\lib\site-packages\werkzeug\sansio\multipart.py

私有或局部

22 _to_bytes
23 _to_str

剩余

24 doc
25 loader <_frozen_importlib_external.SourceFileLoader object at 0x000002BE6680D1C8>
26 spec ModuleSpec(name=‘werkzeug.sansio.multipart’, loader=<_frozen_importlib_external.SourceFileLoader object at 0x000002BE6680D1C8>, origin=‘…\lib\site-packages\werkzeug\sansio\multipart.py’)
27 List typing.List
28 Optional typing.Optional
29 Tuple typing.Tuple
30 NEED_DATA
31 LINE_BREAK b’(?:\r\n|\n|\r)’
32 BLANK_LINE_RE re.compile(b’(?:\r\n\r\n|\r\r|\n\n)‘, re.MULTILINE)
33 LINE_BREAK_RE re.compile(b’(?:\r\n|\n|\r)‘, re.MULTILINE)
34 HEADER_CONTINUATION_RE re.compile(b’(?:\r\n|\n|\r)[ \t]', re.MULTILINE)

☘️【werkzeug.sansio.request】

request, fullname=werkzeug.sansio.request, file=werkzeug\sansio\request.py

统计

序号 类别 数量
4 str 4
8 dict 1
9 module 1
10 class 19
11 function 15
13 residual 3
14 system 8
15 private 1
16 all 43

模块

1 typing

typing, fullname=typing, file=typing.py

函数

2 _to_str(x: Union[Any, NoneType], charset: Union[str, NoneType] =utf-8', errors: str =strict’, allow_none_charset: bool = False) -> Union[str, bytes, NoneType]

_to_str(x: Union[Any, NoneType], charset: Union[str, NoneType] =utf-8', errors: str =strict’, allow_none_charset: bool = False) -> Union[str, bytes, NoneType], module=werkzeug._internal, line:130 at site-packages\werkzeug_internal.py

3 parse_accept_header(value: Union[str, NoneType], cls: Union[Type[~_TAnyAccept], NoneType] = None) -> ~_TAnyAccept

parse_accept_header(value: Union[str, NoneType], cls: Union[Type[~_TAnyAccept], NoneType] = None) -> ~_TAnyAccept, module=werkzeug.http, line:484 at site-packages\werkzeug\http.py

解析HTTP Accept-*报头。
    这并没有实现一个完整有效的算法,但至少支持价值和质量提取。
    返回一个新的:class:`Accept`对象(基本上是一个``(value, quality)``元组列表,按质量排序,并使用一些附加的访问器方法)。
    第二个参数可以是:class:`Accept`的子类,它是用解析后的值创建并返回的。
    :param value:   要解析的接收报头字符串。
    :param cls:     返回值的包装类(可以是:class:`Accept`或其子类)
    :return:        `cls`的实例。

4 parse_authorization_header(value: Union[str, NoneType]) -> Union[ForwardRef(‘ds.Authorization’), NoneType]

parse_authorization_header(value: Union[str, NoneType]) -> Union[ForwardRef(‘ds.Authorization’), NoneType], module=werkzeug.http, line:654 at site-packages\werkzeug\http.py

解析web浏览器发送的HTTP基本/摘要授权头。
    如果头文件无效或未给出,返回值为`None`,否则返回 :class:`~werkzeug.datastructures.Authorization` 对象。
    :param value:   要解析的授权头。
    :return:        :class:`~werkzeug.datastructures.Authorization` 对象或`None`。

5 parse_cache_control_header(value: Union[str, NoneType], on_update: Union[Callable[[~_TAnyCC], NoneType], NoneType] = None, cls: Union[Type[~_TAnyCC], NoneType] = None) -> ~_TAnyCC

parse_cache_control_header(value: Union[str, NoneType], on_update: Union[Callable[[~_TAnyCC], NoneType], NoneType] = None, cls: Union[Type[~_TAnyCC], NoneType] = None) -> ~_TAnyCC, module=werkzeug.http, line:537 at site-packages\werkzeug\http.py

解析缓存控制标头。
    RFC在响应和请求缓存控制之间是不同的,这个方法没有。不要使用错误的控制声明是你的责任。
    版本增加: 0.5    添加“cls”。如果没有指定一个不可变的,返回:class:`~werkzeug.datastructures.RequestCacheControl`。
    :param value:   要解析的缓存控制头。
    :param on_update: 一个可选的可调用对象,每次在 :class:`~werkzeug.datastructures.CacheControl` 对象发生变化时调用它。
    :param cls:     返回对象的类。默认使用:class:`~werkzeug.datastructures.RequestCacheControl`。
    :return:        一个`cls`对象。

6 parse_date(value: Union[str, NoneType]) -> Union[datetime.datetime, NoneType]

parse_date(value: Union[str, NoneType]) -> Union[datetime.datetime, NoneType], module=werkzeug.http, line:931 at site-packages\werkzeug\http.py

解析一个:rfc:`2822`日期到一个时区感知的 :class:`datetime.datetime`对象,如果解析失败,则为`None`。
    这是:func:`email.utils.parsedate_to_datetime` 的包装器。
    如果解析失败,它返回`None`,而不是引发异常,并且总是返回一个时区感知的datetime对象。
    如果字符串没有时区信息,则假定为UTC。
    :param value:   支持日期格式的字符串。
    版本变更: 2.0    返回一个支持时区的datetime对象。使用 ``email.utils.parsedate_to_datetime``。

7 parse_etags(value: Union[str, NoneType]) ->`ds.ETags’

parse_etags(value: Union[str, NoneType]) ->`ds.ETags’, module=werkzeug.http, line:893 at site-packages\werkzeug\http.py

解析etag标头。
:param value: 要解析的标头。
返回: :class:`~werkzeug.datastructures.ETags` 对象。

8 parse_if_range_header(value: Union[str, NoneType]) ->`ds.IfRange’

parse_if_range_header(value: Union[str, NoneType]) ->`ds.IfRange’, module=werkzeug.http, line:723 at site-packages\werkzeug\http.py

解析if-range报头,该报头可以是标签或日期。
返回一个 :class:`~werkzeug.datastructures.IfRange`
版本变更: 2.0如果该值表示日期时间,则支持时区…	
版本增加: 0.7

9 parse_list_header(value: str) -> List[str]

parse_list_header(value: str) -> List[str], module=werkzeug.http, line:320 at site-packages\werkzeug\http.py

按照RFC 2068第2节的描述解析列表。
    特别是,解析逗号分隔的列表,其中的元素可能包含带引号的字符串。
    带引号的字符串可以包含逗号。非引号字符串的中间可以有引号。
    解析后,引号会自动删除。它基本上像:func:`parse_set_header`一样工作,只是项目可能出现多次并且保留大小写敏感性。
    返回值是一个标准的:class:`list`:
        >>> parse_list_header('token, "quoted value"')
        ['token',`quoted value']
    :func:`dump_header` function.
    :param value: a string with a list header.
    :return: :class:`list`

10 parse_options_header(value: Union[str, NoneType]) -> Tuple[str, Dict[str, str]]

parse_options_header(value: Union[str, NoneType]) -> Tuple[str, Dict[str, str]], module=werkzeug.http, line:390 at site-packages\werkzeug\http.py

解析一个``Content-Type``之类的标头到一个包含值和任意选项的元组:
    >>> parse_options_header('text/html; charset=utf8')
    ('text/html', {'charset':`utf8'})
    这应该不适用于``Cache-Control``之类的标头,它们使用不同的格式。对于那些,使用:func:`parse_dict_header`。
    :param value:      要解析的报头值。
    版本变更: 2.2       选项名总是被转换成小写。
    版本变更: 2.1       ``multiple``参数已弃用,并将在Werkzeug 2.2中删除。
    版本变更: 0.15      :rfc:`2231`参数的延续被处理。
    版本增加: 0.5

11 parse_range_header(value: Union[str, NoneType], make_inclusive: bool = True) -> Union[ForwardRef(‘ds.Range’), NoneType]

parse_range_header(value: Union[str, NoneType], make_inclusive: bool = True) -> Union[ForwardRef(‘ds.Range’), NoneType], module=werkzeug.http, line:741 at site-packages\werkzeug\http.py

将范围头解析为 :class:`~werkzeug.datastructures.Range` 对象。
如果标头缺失或格式错误,则返回`None`。`ranges`是一个``(start, stop)``元组的列表,其中的范围是不包含的。
版本增加: 0.7

12 parse_set_header(value: Union[str, NoneType], on_update: Union[Callable[[ForwardRef(‘ds.HeaderSet’)], NoneType], NoneType] = None) ->`ds.HeaderSet’

parse_set_header(value: Union[str, NoneType], on_update: Union[Callable[[ForwardRef(‘ds.HeaderSet’)], NoneType], NoneType] = None) ->`ds.HeaderSet’, module=werkzeug.http, line:621 at site-packages\werkzeug\http.py

解析一个类似set的头文件并返回 :class:`~werkzeug.datastructures.HeaderSet`对象:
        >>> hs = parse_set_header('token, "quoted value"')
        返回值是一个对象,它不区分大小写,并保持项目的顺序:
        >>>`TOKEN`in hs
        True
        >>> hs.index('quoted value')
        1
        >>> hs
        HeaderSet(['token',`quoted value'])
    要再次从:class:`HeaderSet`创建头文件,请使用:func:`dump header`函数。
    :param value:       要解析的集合报头。
    :param on_update:   一个可选的可调用对象,每次在:class:`~werkzeug.datastructures.HeaderSet` 对象发生了变化时调用。
    :return:            class:`~werkzeug.datastructures.HeaderSet`类。

13 url_decode(s: ~AnyStr, charset: str =utf-8', include_empty: bool = True, errors: str =replace’, separator: str =&', cls: Union[Type[ForwardRef('ds.MultiDict')], NoneType] = None) ->ds.MultiDict[str, str]’

url_decode(s: ~AnyStr, charset: str =utf-8', include_empty: bool = True, errors: str =replace’, separator: str =&', cls: Union[Type[ForwardRef('ds.MultiDict')], NoneType] = None) ->ds.MultiDict[str, str]', module=werkzeug.urls, line:819 at site-packages\werkzeug\urls.py

解析查询字符串并以   :class:`MultiDict`的形式返回。
    :param s:               要解析的查询字符串。
    :param charset:         用这个字符集解码字节到字符串。如果未给出,则按原样返回字节。
    :param include_empty:   在字典中包含空值的键。
    :param errors:          解码字节时的错误处理行为。
    :param separator:       对之间的分隔符。
    :param cls:             容器保存结果,而不是:class:`MultiDict`。
    版本变更: 2.0           ``decode_keys``'参数已弃用,并将在Werkzeug 2.1中删除。
    版本变更: 0.5           在以前的版本中,“;”和“&”可以用于url解码。现在只支持"&"。如果你想使用“;”,可以提供一个不同的``separator``。
    版本变更: 0.5           新增“cls”参数。

14 parse_cookie(cookie: Union[bytes, str, NoneType] =', charset: str =utf-8’, errors: str =replace', cls: Union[Type[ForwardRef('ds.MultiDict')], NoneType] = None) ->ds.MultiDict[str, str]’

parse_cookie(cookie: Union[bytes, str, NoneType] =', charset: str =utf-8’, errors: str =replace', cls: Union[Type[ForwardRef('ds.MultiDict')], NoneType] = None) ->ds.MultiDict[str, str]', module=werkzeug.sansio.http, line:97 at site-packages\werkzeug\sansio\http.py

从字符串解析cookie。
    同一个键可以提供多次,值按顺序存储。
    默认的:class:`MultiDict`将首先具有第一个值,所有值都可以使用:meth:`MultiDict.getlist`检索。
    :param cookie:  作为字符串的cookie头。
    :param charset: cookie值的字符集。
    :param errors:  字符集解码的错误行为。
    :param cls:     一个类似字典的类,用于存储解析后的cookie。默认为:class:`MultiDict`。
    版本增加: 2.2

15 get_current_url(scheme: str, host: str, root_path: Union[str, NoneType] = None, path: Union[str, NoneType] = None, query_string: Union[bytes, NoneType] = None) -> str

get_current_url(scheme: str, host: str, root_path: Union[str, NoneType] = None, path: Union[str, NoneType] = None, query_string: Union[bytes, NoneType] = None) -> str, module=werkzeug.sansio.utils, line:104 at site-packages\werkzeug\sansio\utils.py

为请求重新创建URL。
    如果没有提供可选部分,则它和后续部分不会包含在URL中。
    URL是IRI,而不是URI,因此它可能包含Unicode字符。使用 :func:`~werkzeug.urls.iri_to_uri` 将其转换为ASCII。
    :param scheme:      请求使用的协议,如“https”。
    :param host:        请求发送到的主机。参见:func:`get_host`。
    :param root_path:   应用程序挂载的前缀。它被附加在`path`前面。
    :param path:在``root_path``之后的URL路径部分。
    :param query_string: URL中“?”后面的部分。

16 get_host(scheme: str, host_header: Union[str, NoneType], server: Union[Tuple[str, Union[int, NoneType]], NoneType] = None, trusted_hosts: Union[Iterable[str], NoneType] = None) -> str

get_host(scheme: str, host_header: Union[str, NoneType], server: Union[Tuple[str, Union[int, NoneType]], NoneType] = None, trusted_hosts: Union[Iterable[str], NoneType] = None) -> str, module=werkzeug.sansio.utils, line:56 at site-packages\werkzeug\sansio\utils.py

返回给定参数的主机。
    这首先检查``host_header``。如果不存在,则使用`server`。
    主机将只包含与协议的标准端口不同的端口。
    可选地,使用:func:`host_is_trusted`验证主机是否受信任,如果不是,并引发:exc:`~werkzeug.exceptions.SecurityError`。
    :param scheme: 请求使用的协议,比如``"https"``。
    :param host_header:     ``Host``头的值。
    :param server:          服务器的地址。``(host, port)``,或者 ``(path, None)`` 对于Unix套接字。
    :param trusted_hosts:   可信任主机名列表。
    :return:                主机名,如果需要,带端口号。
    :raise ~werkzeug.exceptions.SecurityError: 如果主机不可信任。

17 datetime.datetime

datetime, datetime.datetime, module=datetime, line:0 at

datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])
需要年,月和日参数。tzinfo可以是None,或者是tzinfo子类的一个实例。剩下的参数可以是整型。

data

1 fold=foldofdatetime.datetimeobjects> kind:data type:getset_descriptor class:datetime.datetime'> 2 hour=hourofdatetime.datetimeobjects> kind:data type:getset_descriptor class:datetime.datetime’>
3 max=9999-12-31 23:59:59.999999 kind:data type:datetime class:datetime.datetime'> 4 microsecond=microsecondofdatetime.datetimeobjects> kind:data type:getset_descriptor class:datetime.datetime’>
5 min=0001-01-01 00:00:00 kind:data type:datetime class:datetime.datetime'> 6 minute=minuteofdatetime.datetimeobjects> kind:data type:getset_descriptor class:datetime.datetime’>
7 resolution=0:00:00.000001 kind:data type:timedelta class:datetime.datetime'> 8 second=secondofdatetime.datetimeobjects> kind:data type:getset_descriptor class:datetime.datetime’>
9 tzinfo=tzinfo
ofdatetime.datetimeobjects> kind:data type:getset_descriptor class:

method

10 astimezone(self, tz=None)

kind=method class=datetime objtype=method_descriptor line:1813 at …\datetime.py

Tz ->转换为新时区Tz的本地时间

11 ctime(self)

kind=method class=datetime objtype=method_descriptor line:1840 at …\datetime.py

返回ctime()样式字符串。

12 date(self)

kind=method class=datetime objtype=method_descriptor line:1756 at …\datetime.py

返回具有相同年、月和日的日期对象。

13 dst(self)

kind=method class=datetime objtype=method_descriptor line:1927 at …\datetime.py

返回 self.tzinfo.dst(self).

14 isoformat(self, sep=‘T’, timespec=‘auto’)

kind=method class=datetime objtype=method_descriptor line:1850 at …\datetime.py

[sep] -> string ISO 8601格式的字符串,YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM]。
    sep用于分隔年份和时间,默认为'T'。
    timespec指定要包含的时间组件(允许的值是'auto'、'hours'、'minutes'、'seconds'、'milliseconds'和'microseconds')。

15 replace(self, year=None, month=None, day=None, hour=None,

kind=method class=datetime objtype=method_descriptor line:1769 at …\datetime.py

返回带有新指定字段的datetime。

16 time(self)

kind=method class=datetime objtype=method_descriptor line:1760 at …\datetime.py

返回具有相同时间但tzinfo=None的时间对象。

17 timestamp(self)

kind=method class=datetime objtype=method_descriptor line:1739 at …\datetime.py

返回POSIX时间戳为float。

18 timetuple(self)

kind=method class=datetime objtype=method_descriptor line:1691 at …\datetime.py

返回时间元组,与time.localtime()兼容。

19 timetz(self)

kind=method class=datetime objtype=method_descriptor line:1764 at …\datetime.py

返回具有相同时间和tzinfo的时间对象。

20 tzname(self)

kind=method class=datetime objtype=method_descriptor line:1914 at …\datetime.py

返回self.tzinfo.tzname(self)。

21 utcoffset(self)

kind=method class=datetime objtype=method_descriptor line:1905 at …\datetime.py

返回self.tzinfo.utcoffset(self)。

22 utctimetuple(self)

kind=method class=datetime objtype=method_descriptor line:1747 at …\datetime.py

返回UTC时间元组,与time.localtime()兼容。

class method

23 combine(cls, date, time, tzinfo=True)

kind=class method class=datetime objtype=classmethod_descriptor line:1654 at …\datetime.py

Date, time -> datetime具有相同的日期和时间字段

24 fromisoformat(cls, date_string)

kind=class method class=datetime objtype=classmethod_descriptor line:1667 at …\datetime.py

String -> datetime.isoformat()输出中的datetime

25 fromtimestamp(cls, t, tz=None)

kind=class method class=datetime objtype=classmethod_descriptor line:1627 at …\datetime.py

timestamp[, tz] -> tz的本地时间从POSIX时间戳。

26 now(cls, tz=None)

kind=class method class=datetime objtype=classmethod_descriptor line:1642 at …\datetime.py

返回新的datetime对象,表示tz本地的当前时间。
    tz  时区对象。
    如果未指定tz,则使用本地时区。

27 strptime(cls, date_string, format)

kind=class method class=datetime objtype=classmethod_descriptor line:1900 at …\datetime.py

string, format  ->从字符串(如time.strptime())解析的新日期时间。

28 utcfromtimestamp(cls, t)

kind=class method class=datetime objtype=classmethod_descriptor line:1637 at …\datetime.py

从POSIX时间戳构造一个朴素的UTC日期时间。

29 utcnow(cls)

kind=class method class=datetime objtype=classmethod_descriptor line:1648 at …\datetime.py

返回表示UTC日期和时间的新日期时间。

18 werkzeug.datastructures.Accept

Accept, werkzeug.datastructures.Accept, module=werkzeug.datastructures, line:1629 at site-packages\werkzeug\datastructures.py

class:`Accept`对象只是`(value, quality)``元组列表的列表子类。
    它是自动分类的特异性和质量。
    所有:class:`Accept`对象的工作方式类似于列表,但为处理数据提供了额外的功能。
    包含检查被归一化为该报头的规则:
        >>> a = CharsetAccept([('ISO-8859-1', 1), ('utf-8', 0.7)])
        >>> a.best
       `ISO-8859-1'
        >>>`iso-8859-1`in a
        True
        >>>`UTF8`in a
        True
        >>>`utf7`in a
        False
    要获得一个项目的质量,您可以使用正常的项目查找:
        >>> print a['utf-8']
        0.7
        >>> a['utf7']
        0
    版本变更: 0.5:      class:`Accept`对象现在是强制不可变的。	
    版本变更: 1.0.0:    class:`Accept`内部值不再按字母顺序排列。相反,保留了初始顺序。

property

1 best= kind:property type:property class:

method

2 best_match(self, matches, default=None)

kind=method class=Accept objtype=function line:1768 at …\lib\site-packages\werkzeug\datastructures.py

根据客户端的特异性和质量从可能匹配列表中返回最佳匹配。如果两个项目具有相同的质量和特性,则先返回的项目。
    :param matches:要检查的匹配列表
    :param default:无匹配时返回的值

3 find(self, key)

kind=method class=Accept objtype=function line:1734 at …\lib\site-packages\werkzeug\datastructures.py

获取条目的位置或返回-1。
    :param key:  要查找的键。

4 index(self, key)

kind=method class=Accept objtype=function line:1718 at …\lib\site-packages\werkzeug\datastructures.py

获取条目的位置或引发:exc:`ValueError`。
    :param key:要查找的键。
    版本变更: 0.5       这用于引发:exc:`IndexError`,这与列表API不一致。

5 quality(self, key)

kind=method class=Accept objtype=function line:1696 at …\lib\site-packages\werkzeug\datastructures.py

返回密钥的质量。
    版本增加: 0.6
        在以前的版本中,你必须使用项查找语法(例如:``obj[key]``而不是``obj.quality(key)``))

6 to_header(self)

kind=method class=Accept objtype=function line:1749 at …\lib\site-packages\werkzeug\datastructures.py

将报头集转换为HTTP报头字符串。

7 values(self)

kind=method class=Accept objtype=function line:1744 at …\lib\site-packages\werkzeug\datastructures.py

遍历所有值。

19 werkzeug.datastructures.Authorization

Authorization, werkzeug.datastructures.Authorization, module=werkzeug.datastructures, line:2631 at site-packages\werkzeug\datastructures.py

表示客户端发送的 ``Authorization`` 头。
    它由:func:`~werkzeug.http.parse_authorization_header` 返回。手动创建对象以传递给test:class:`~werkzeug.test.Client`是很有用的。	
    版本变更: 0.5       该对象变得不可变。

property

1 cnonce= kind:property type:property class:werkzeug.datastructures.Authorization'> 2 nc= kind:property type:property class:werkzeug.datastructures.Authorization’>
3 nonce= kind:property type:property class:werkzeug.datastructures.Authorization'> 4 opaque= kind:property type:property class:werkzeug.datastructures.Authorization’>
5 password= kind:property type:property class:werkzeug.datastructures.Authorization'> 6 qop= kind:property type:property class:werkzeug.datastructures.Authorization’>
7 realm= kind:property type:property class:werkzeug.datastructures.Authorization'> 8 response= kind:property type:property class:werkzeug.datastructures.Authorization’>
9 uri= kind:property type:property class:werkzeug.datastructures.Authorization'> 10 username= kind:property type:property class:werkzeug.datastructures.Authorization’>

method

11 to_header(self)

kind=method class=Authorization objtype=function line:2719 at …\lib\site-packages\werkzeug\datastructures.py

将``Authorization``标头转换为字符串值。
版本增加: 2.0
    新增支持向测试客户端传递授权。

20 werkzeug.datastructures.CharsetAccept

CharsetAccept, werkzeug.datastructures.CharsetAccept, module=werkzeug.datastructures, line:1936 at site-packages\werkzeug\datastructures.py

类似于:class:`Accept`,但对字符集进行了规范化。

21 werkzeug.datastructures.ETags

ETags, werkzeug.datastructures.ETags, module=werkzeug.datastructures, line:2368 at site-packages\werkzeug\datastructures.py

一个集合,用于检查etag集合中是否存在一个etag。

method

1 as_set(self, include_weak=False)

kind=method class=ETags objtype=function line:2382 at …\lib\site-packages\werkzeug\datastructures.py

将`ETags`对象转换为python集。默认情况下,所有弱标签都不是这个集合的一部分。

2 contains(self, etag)

kind=method class=ETags objtype=function line:2402 at …\lib\site-packages\werkzeug\datastructures.py

检查etag是否为集合的一部分,忽略弱标记。也可以使用“in”操作符。

3 contains_raw(self, etag)

kind=method class=ETags objtype=function line:2410 at …\lib\site-packages\werkzeug\datastructures.py

当传递一个引号标记时,它将检查该标记是否属于集合的一部分。如果标签是弱的,它将根据弱和强标签进行检查,否则只检查强标签。

4 contains_weak(self, etag)

kind=method class=ETags objtype=function line:2398 at …\lib\site-packages\werkzeug\datastructures.py

检查etag是否是包含弱和强标记的集合的一部分。

5 is_strong(self, etag)

kind=method class=ETags objtype=function line:2394 at …\lib\site-packages\werkzeug\datastructures.py

检查etag是否强。

6 is_weak(self, etag)

kind=method class=ETags objtype=function line:2390 at …\lib\site-packages\werkzeug\datastructures.py

检查etag是否弱。

7 to_header(self)

kind=method class=ETags objtype=function line:2419 at …\lib\site-packages\werkzeug\datastructures.py

将etags集合转换为HTTP报头字符串。

22 werkzeug.datastructures.Headers

Headers, werkzeug.datastructures.Headers, module=werkzeug.datastructures, line:848 at site-packages\werkzeug\datastructures.py

22 werkzeug.datastructures.HeaderSet

HeaderSet, werkzeug.datastructures.HeaderSet, module=werkzeug.datastructures, line:2218 at site-packages\werkzeug\datastructures.py

类似于:class:`ETags`类,它实现了一个类似集合的结构。
    与:class:`ETags`不同,这是不区分大小写的,用于vary, allow和content-language标头。
    如果不是使用:func:`parse_set_header`函数构造,则实例化的方式如下:
        >>> hs = HeaderSet(['foo',`bar',`baz'])
        >>> hs
        HeaderSet(['foo',`bar',`baz'])

method

1 add(self, header)

kind=method class=HeaderSet objtype=function line:2236 at …\lib\site-packages\werkzeug\datastructures.py

向集合添加一个新标题。

2 as_set(self, preserve_casing=False)

kind=method class=HeaderSet objtype=function line:2315 at …\lib\site-packages\werkzeug\datastructures.py

返回实际python集合类型的集合。
    调用此方法时,所有项都转换为小写,并且顺序丢失。
    :param preserve_casing:     如果设置为`True`,返回的集合中的项将具有原始的大小写,如:class:`HeaderSet`,否则它们将是小写的。

3 clear(self)

kind=method class=HeaderSet objtype=function line:2308 at …\lib\site-packages\werkzeug\datastructures.py

清理现场。

4 discard(self, header)

kind=method class=HeaderSet objtype=function line:2276 at …\lib\site-packages\werkzeug\datastructures.py

像:meth:`remove`但忽略错误。
    :param header:  要丢弃的报头。

5 find(self, header)

kind=method class=HeaderSet objtype=function line:2286 at …\lib\site-packages\werkzeug\datastructures.py

返回集合中标题的索引,如果没有找到则返回-1。
    :param header:  要查找的头。

6 index(self, header)

kind=method class=HeaderSet objtype=function line:2297 at …\lib\site-packages\werkzeug\datastructures.py

返回集合中标头的索引,否则引发:exc:`IndexError`。
    :param header:  要查找的头。

7 remove(self, header)

kind=method class=HeaderSet objtype=function line:2240 at …\lib\site-packages\werkzeug\datastructures.py

从集合中移除一个标头。如果标头不在集合中,将引发:exc:`KeyError`。	
    版本变更: 0.5
        在旧版本中,如果对象缺失会引发a:exc:`IndexError`而不是a:exc:`KeyError`。
    :param header:  要删除的报头。

8 to_header(self)

kind=method class=HeaderSet objtype=function line:2328 at …\lib\site-packages\werkzeug\datastructures.py

将报头集转换为HTTP报头字符串。

9 update(self, iterable)

kind=method class=HeaderSet objtype=function line:2261 at …\lib\site-packages\werkzeug\datastructures.py

将可迭代对象中的所有头元素添加到集合中。
    :param iterable:    使用iterable中的项更新集合。

23 werkzeug.datastructures.IfRange

IfRange, werkzeug.datastructures.IfRange, module=werkzeug.datastructures, line:2456 at site-packages\werkzeug\datastructures.py

非常简单的对象,以解析形式表示`If-Range`标头。它要么没有标签,要么没有日期,要么两者都没有。	
版本增加: 0.7

method

1 to_header(self)

kind=method class=IfRange objtype=function line:2471 at …\lib\site-packages\werkzeug\datastructures.py

将对象转换回HTTP报头。

24 werkzeug.datastructures.ImmutableList

ImmutableList, werkzeug.datastructures.ImmutableList, module=werkzeug.datastructures, line:38 at site-packages\werkzeug\datastructures.py

一个不可变的:class:`list`
版本增加: 0.5:
private:

25 werkzeug.datastructures.ImmutableMultiDict

ImmutableMultiDict, werkzeug.datastructures.ImmutableMultiDict, module=werkzeug.datastructures, line:153 at site-packages\werkzeug\datastructures.py

一个不可变的:class:`MultiDict`
版本增加: 0.5

method

1 copy(self)

kind=method class=ImmutableMultiDict objtype=function line:278 at …\lib\site-packages\werkzeug\datastructures.py

返回该对象的浅可变副本。
    请记住,标准库的:func:`copy`函数对于此类是无操作的,就像任何其他python不可变类型(例如::class:`tuple`)一样。

26 werkzeug.datastructures.LanguageAccept

LanguageAccept, werkzeug.datastructures.LanguageAccept, module=werkzeug.datastructures, line:1882 at site-packages\werkzeug\datastructures.py

类似于:class:`Accept`,但对语言标记进行了规范化。

method

1 best_match(self, matches, default=None)

kind=method class=LanguageAccept objtype=function line:1888 at …\lib\site-packages\werkzeug\datastructures.py

给定支持的值列表,从可接受的值列表中查找最佳匹配项。
为了匹配的目的,语言标记被规范化,但返回时不变。
如果没有找到精确匹配,这将返回到匹配第一个子标记(仅主要语言),首先与可接受的值匹配,然后与匹配值匹配。
该部分不应用于任何其他语言子标记。如果没有找到精确匹配或回退匹配,则返回默认值。
    :param matches:     支持的语言列表,用于查找匹配项。
    :param default:     不匹配时返回的值。

27 werkzeug.datastructures.MIMEAccept

MIMEAccept, werkzeug.datastructures.MIMEAccept, module=werkzeug.datastructures, line:1808 at site-packages\werkzeug\datastructures.py

类似于:class:`Accept`,但对mime类型有特殊的方法和行为。

property

1 accept_html= kind:property type:property class:werkzeug.datastructures.MIMEAccept'> 2 accept_json= kind:property type:property class:werkzeug.datastructures.MIMEAccept’>
3 accept_xhtml= kind:property type:property class:

28 werkzeug.datastructures.MultiDict

MultiDict, werkzeug.datastructures.MultiDict, module=werkzeug.datastructures, line:289 at site-packages\werkzeug\datastructures.py

:class:`MultiDict`是一个自定义的字典子类,用于处理相同键的多个值,例如由包装器中的解析函数使用。
    这是必要的,因为一些HTML表单元素为同一个键传递多个值。
    :class:`MultiDict`实现了所有标准字典方法。
    在内部,它将键的所有值保存为一个列表,但是标准的字典访问方法将只返回键的第一个值。
    如果您也想访问其他值,则必须使用下面解释的`list`方法。
    基本用法:
        >>> d = MultiDict([('a',`b'), ('a',`c')])
        >>> d
        MultiDict([('a',`b'), ('a',`c')])
        >>> d['a']
       `b'
        >>> d.getlist('a')
        ['b',`c']
        >>>`a`in d
        True
    它的行为就像一个普通的字典,因此当找到一个键的多个值时,所有的字典函数只会返回第一个值。
    从Werkzeug 0.3起,该类引发的`KeyError`也是 :exc:`~exceptions.BadRequest` HTTP异常,如果捕获到HTTP异常,将呈现一个``400 BAD REQUEST``的页面。
    一个:class:`MultiDict`可以从的可迭代对象构造``(key, value)``元组,一个字典,一个:class:`MultiDict`或从Werkzeug 0.2开始的一些关键字参数。
    :param mapping: 类的初始值:`MultiDict`。一个普通的字典,一个``(键,值)``元组的可迭代对象或`None`。

method

1 add(self, key, value)

kind=method class=MultiDict objtype=function line:385 at …\lib\site-packages\werkzeug\datastructures.py

为键添加一个新值。	
    版本增加: 0.6:
    :param key:值的关键字。
    :param value:要添加的值。

2 copy(self)

kind=method class=MultiDict objtype=function line:512 at …\lib\site-packages\werkzeug\datastructures.py

返回该对象的浅拷贝。

3 deepcopy(self, memo=None)

kind=method class=MultiDict objtype=function line:516 at …\lib\site-packages\werkzeug\datastructures.py

返回该对象的深层副本。

4 getlist(self, key, type=None)

kind=method class=MultiDict objtype=function line:395 at …\lib\site-packages\werkzeug\datastructures.py

返回给定键的项列表。如果该键不在`MultiDict`中,则返回值将是一个空列表。
就像`get`一样,`getlist`接受一个`type`参数。
所有项都将使用那里定义的可调用对象进行转换。
    :param key:     要查找的键。
    :param type:    一个可调用对象,用于在::class:`MultiDict`中转换值。如果此可调用对象引发:exc:`ValueError`,则该值将从列表中删除。
    :return:        :class:键的所有值的`list`。

5 items(self, multi=False)

kind=method class=MultiDict objtype=function line:477 at …\lib\site-packages\werkzeug\datastructures.py

返回``(键,值)``对的迭代器。
:param multi:   如果设置为`True`,则返回的迭代器将为每个键的每个值对应一对。否则,它将只包含每个键的第一个值的对。

6 lists(self)

kind=method class=MultiDict objtype=function line:491 at …\lib\site-packages\werkzeug\datastructures.py

返回``(key, values)``对的迭代器,其中values是与键相关的所有值的列表。

7 listvalues(self)

kind=method class=MultiDict objtype=function line:502 at …\lib\site-packages\werkzeug\datastructures.py

返回与键相关的所有值的迭代器。压缩 :meth:`keys`,这与调用:meth:`lists`相同:
        >>> d = MultiDict({"foo": [1, 2, 3]})
        >>> zip(d.keys(), d.listvalues()) == d.lists()
        True

8 pop(self, key, default=_missing)

kind=method class=MultiDict objtype=function line:555 at …\lib\site-packages\werkzeug\datastructures.py

在字典中弹出列表的第一个项目。之后键从字典中移除,所以额外的值被丢弃:
    >>> d = MultiDict({"foo": [1, 2, 3]})
    >>> d.pop("foo")
    1
    >>> "foo" in d
    False

    :param key: pop的键。
    :param default: 如果键不在字典中,则提供返回值。

9 popitem(self)

kind=method class=MultiDict objtype=function line:582 at …\lib\site-packages\werkzeug\datastructures.py

从字典中弹出一个条目。

10 popitemlist(self)

kind=method class=MultiDict objtype=function line:604 at …\lib\site-packages\werkzeug\datastructures.py

从字典中弹出一个``(key, list)``元组。

11 poplist(self, key)

kind=method class=MultiDict objtype=function line:594 at …\lib\site-packages\werkzeug\datastructures.py

从字典中弹出键列表。如果键不在字典中,则返回空列表。
    版本变更: 0.5   如果键不再存在,则返回一个列表而不是引发错误。

12 setdefault(self, key, default=None)

kind=method class=MultiDict objtype=function line:439 at …\lib\site-packages\werkzeug\datastructures.py

如果键在字典中,则返回键的值,否则返回`default`并为`key`设置该值。
    :param key:     要查找的键。
    :param default: 键不在字典中时返回的默认值。如果没有进一步指定,则为`None`。

13 setlist(self, key, new_list)

kind=method class=MultiDict objtype=function line:421 at …\lib\site-packages\werkzeug\datastructures.py

删除键的旧值并添加新值。请注意,您传入值的列表在插入字典之前将被浅复制。
    >>> d = MultiDict()
    >>> d.setlist('foo', ['1',`2'])
    >>> d['foo']
   `1'
    >>> d.getlist('foo')
    ['1',`2']
    :param key:           要设置的关键值。
    :param new list:    一个可迭代对象,包含键的新值。旧的值首先被删除。

14 setlistdefault(self, key, default_list=None)

kind=method class=MultiDict objtype=function line:453 at …\lib\site-packages\werkzeug\datastructures.py

类似于`setdefault`,但会设置多个值。
    返回的列表不是副本,而是内部实际使用的列表。
    这意味着您可以通过向列表添加项来将新值放入字典:
        >>> d = MultiDict({"foo": 1})
        >>> d.setlistdefault("foo").extend([2, 3])
        >>> d.getlist("foo")
        [1, 2, 3]
    :param key:             要查找的键。
    :param default_list:    包含默认值的可迭代对象。它要么被复制(如果它是一个列表),要么在返回之前被转换成一个列表。
    :return:                class:`list`

15 to_dict(self, flat=True)

kind=method class=MultiDict objtype=function line:520 at …\lib\site-packages\werkzeug\datastructures.py

返回常规字典的内容。
    如果`flat`为`True`,则返回的字典将只包含第一个条目,如果`flat`为`False`,则所有值将作为列表返回。
    :param flat:        如果设置为`False`,返回的字典将包含其中所有值的列表。否则,它将只包含每个键的第一个值。
    :return:            class:`dict`

16 update(self, mapping)

kind=method class=MultiDict objtype=function line:534 at …\lib\site-packages\werkzeug\datastructures.py

Update()扩展而不是替换现有的键列表:
        >>> a = MultiDict({'x': 1})
        >>> b = MultiDict({'x': 2,`y': 3})
        >>> a.update(b)
        >>> a
        MultiDict([('y', 3), ('x', 1), ('x', 2)])
    如果``other_dict`` 中键的值列表为空,则没有新值将被添加到字典中,并且不会创建密钥:
        >>> x = {'empty_list': []}
        >>> y = MultiDict()
        >>> y.update(x)
        >>> y
        MultiDict([])

17 values(self)

kind=method class=MultiDict objtype=function line:497 at …\lib\site-packages\werkzeug\datastructures.py

返回每个键值列表中第一个值的迭代器。

29 werkzeug.datastructures.Range

Range, werkzeug.datastructures.Range, module=werkzeug.datastructures, line:2486 at site-packages\werkzeug\datastructures.py

表示一个``Range``标头。所有方法只支持字节作为单位。
    如果给定,则存储一个范围列表,但只有在只提供一个范围时,这些方法才有效。
    :raise ValueError:     如果提供的范围无效。
    版本变更: 0.15          传入的范围被验证。
    版本增加: 0.7

method

1 make_content_range(self, length)

kind=method class=Range objtype=function line:2526 at …\lib\site-packages\werkzeug\datastructures.py

创建一个 :class:`~werkzeug.datastructures.ContentRange`  对象从当前范围和给定的内容长度。

2 range_for_length(self, length)

kind=method class=Range objtype=function line:2510 at …\lib\site-packages\werkzeug\datastructures.py

如果范围以字节为单位,则长度不是None,并且只有一个范围,并且它是可满足的,它返回``(start, stop)``元组,否则为`None`。

3 to_content_range_header(self, length)

kind=method class=Range objtype=function line:2545 at …\lib\site-packages\werkzeug\datastructures.py

根据给定的长度将对象转换为“Content-Range”HTTP标头

4 to_header(self)

kind=method class=Range objtype=function line:2535 at …\lib\site-packages\werkzeug\datastructures.py

将对象转换回HTTP报头。

30 werkzeug.datastructures.RequestCacheControl

RequestCacheControl, werkzeug.datastructures.RequestCacheControl, module=werkzeug.datastructures, line:2063 at site-packages\werkzeug\datastructures.py

请求的缓存控制。这是不可变的,并允许访问所有与请求相关的缓存控制头。
    要再次获得:class:`RequestCacheControl`对象的头部,您可以将该对象转换为字符串或调用 :meth:`to_header`方法。
    如果您计划子类化它并添加您自己的项,请查看该类的源代码。
    版本变更: 2.1.0     设置int属性,例如``max_age``,会将值转换为int类型。
    版本增加: 0.5       在以前的版本中,存在一个用于请求和响应的“CacheControl”类。

property

1 max_stale= kind:property type:property class:werkzeug.datastructures.RequestCacheControl'> 2 min_fresh= kind:property type:property class:werkzeug.datastructures.RequestCacheControl’>
3 only_if_cached= kind:property type:property class:

31 werkzeug.user_agent.UserAgent

UserAgent, werkzeug.user_agent.UserAgent, module=werkzeug.user_agent, line:4 at site-packages\werkzeug\user_agent.py

表示已解析的用户代理标头值。
    默认实现不进行解析,只设置:attr:`string`属性。
    子类可以解析字符串以设置公共属性或公开其他信息。设置 :attr:`werkzeug.wrappers.Request.user_agent_class`  使用子类。
    :param string:      要解析的报头值。
    版本增加: 2.0       这将取代之前的``useragents``模块,但不提供内置解析器。

data

1 browser=None kind:data type:NoneType class:werkzeug.user_agent.UserAgent'> 2 language=None kind:data type:NoneType class:werkzeug.user_agent.UserAgent’>
3 platform=None kind:data type:NoneType class:werkzeug.user_agent.UserAgent'> 4 version=None kind:data type:NoneType class:werkzeug.user_agent.UserAgent’>

method

5 to_header(self) -> str:

kind=method class=UserAgent objtype=function line:45 at …\lib\site-packages\werkzeug\user_agent.py

转换为标头值。

32 werkzeug.utils.cached_property

cached_property, werkzeug.utils.cached_property, module=werkzeug.utils, line:49 at site-packages\werkzeug\utils.py

一个:func:只计算一次的“属性”。后续访问返回缓存的值。
    设置该属性将设置缓存值。删除属性将清除缓存的值,再次访问它将再次计算它。
    代码块:
        class Example:
            @cached_property
            def value(self):
                # 计算重要的东西在这里
                return 42
        e = Example()
        e.value  # evaluates
        e.value  # uses cache
        e.value = 16  # sets cache
        del e.value  # clears cache
    如果类定义了``__slots__``,它必须添加``_cache_{name}``作为一个插槽。或者,它可以添加``__dict__``,但这通常是不可取的。
    版本变更: 2.1   适用于``__slots__``。
    版本变更: 2.0   ``del obj.name``清除缓存值。

33 werkzeug.utils.header_property

header_property, werkzeug.utils.header_property, module=werkzeug.utils, line:152 at site-packages\werkzeug\utils.py

就像`environ_property`,但用于标头。

method

1 lookup(self, obj: t.Union[“Request”, “Response”]) -> Headers:

kind=method class=header_property objtype=function line:155 at …\lib\site-packages\werkzeug\utils.py

34 werkzeug.sansio.request.Request

Request, werkzeug.sansio.request.Request, module=werkzeug.sansio.request, line:38 at site-packages\werkzeug\sansio\request.py

私有或局部

34 _to_str

☘️【werkzeug.sansio.response】

response, fullname=werkzeug.sansio.response, file=werkzeug\sansio\response.py

统计

序号 类别 数量
4 str 4
8 dict 2
9 module 1
10 class 15
11 function 18
13 residual 3
14 system 8
15 private 2
16 all 43

常量

dict

1 HTTP_STATUS_CODES {100:Continue', 101:Switching Protocols’, 102:Processing', 103:Early Hints’, 200:OK', 201:Created’, 202:`Ac…

模块

2 typing

typing, fullname=typing, file=typing.py

函数

3 _to_str(x: Union[Any, NoneType], charset: Union[str, NoneType] =utf-8', errors: str =strict’, allow_none_charset: bool = False) -> Union[str, bytes, NoneType]

_to_str(x: Union[Any, NoneType], charset: Union[str, NoneType] =utf-8', errors: str =strict’, allow_none_charset: bool = False) -> Union[str, bytes, NoneType], module=werkzeug._internal, line:130 at site-packages\werkzeug_internal.py

4 dump_cookie(key: str, value: Union[bytes, str] =', max_age: Union[datetime.timedelta, int, NoneType] = None, expires: Union[str, datetime.datetime, int, float, NoneType] = None, path: Union[str, NoneType] =/‘, domain: Union[str, NoneType] = None, secure: bool = False, httponly: bool = False, charset: str =`utf-8’, sync_expires: bool = True, max_size: int = 4093, samesite: Union[str, NoneType] = None) -> str

dump_cookie(key: str, value: Union[bytes, str] =', max_age: Union[datetime.timedelta, int, NoneType] = None, expires: Union[str, datetime.datetime, int, float, NoneType] = None, path: Union[str, NoneType] =/‘, domain: Union[str, NoneType] = None, secure: bool = False, httponly: bool = False, charset: str =`utf-8’, sync_expires: bool = True, max_size: int = 4093, samesite: Union[str, NoneType] = None) -> str, module=werkzeug.http, line:1173 at site-packages\werkzeug\http.py

创建一个不带``Set-Cookie``前缀的Set-Cookie头。
    返回值通常被限制为ascii,因为绝大多数值都被正确转义了,但这并不能保证。
    它按照:pep:`3333`的要求通过latin1进行隧道化。
    如果键包含unicode字符,则返回值不是ASCII安全的。
    这在技术上是违反规范的,但在实际情况中确实会发生。强烈建议不要为键使用非ascii值。
    :param max_age:     应该是秒数,如果cookie应该只持续客户端浏览器会话的时间,则为`None`(默认)。另外,`timedelta`对象也被接受。
    :param expires:     应该是一个`datetime`对象或Unix时间戳。
    :param path:        将cookie限制为给定的路径,默认情况下它将跨越整个域。
    :param domain:      设置跨域cookie时使用。例如,``domain=".example.com"`` 将设置一个cookie,该cookie可由域名``www.example.com``,``foo.example.com``等读取。
                        否则,cookie只能被设置它的域读取。
    :param secure:      cookie只能通过HTTPS访问
    :param httponly:    禁止JavaScript访问cookie。这是cookie标准的扩展,可能不是所有浏览器都支持。
    :param charset:     字符串值的编码。
    :param sync_expires:    当设置了Max age但未设置时,自动设置过期时间。
    :param max_size:    如果最终报头值超过此大小,则发出警告。默认值,4093,应该被大多数浏览器安全支持。设置为0禁用此检查。
    :param samesite:    限制cookie的范围,这样它只会附加到请求,如果这些请求是相同的站点。
                        _`cookie`:http://browsercookielimits.squawky.net/
    版本变更: 1.0.0     字符串``'None'``被 ``samesite``接受。

5 get_content_type(mimetype: str, charset: str) -> str

get_content_type(mimetype: str, charset: str) -> str, module=werkzeug.utils, line:172 at site-packages\werkzeug\utils.py

返回带有mime类型字符集的完整内容类型字符串。
    如果mimetype表示文本,则将追加字符集参数,否则mimetype将原样返回。
    :param mimetype:    内容类型的mime类型。
    :param charset:     文本mime类型要附加的字符集。
    :return:            内容类型。
    版本变更: 0.15       任何以“+xml”结尾的类型都会得到一个字符集,而不仅仅是以“application/”开头的。
                        已知的文本类型,如``application/javascript``'也给出了字符集。

6 dump_age(age: Union[datetime.timedelta, int, NoneType] = None) -> Union[str, NoneType]

dump_age(age: Union[datetime.timedelta, int, NoneType] = None) -> Union[str, NoneType], module=werkzeug.http, line:1014 at site-packages\werkzeug\http.py

将持续时间格式化为以10为基数的整数。
:param age: 应该是秒数的整数,一个 :class:`datetime.timedelta` 对象,如果时间未知,则为`None`(默认值)。

7 dump_header(iterable: Union[Dict[str, Union[str, int]], Iterable[str]], allow_token: bool = True) -> str

dump_header(iterable: Union[Dict[str, Union[str, int]], Iterable[str]], allow_token: bool = True) -> str, module=werkzeug.http, line:273 at site-packages\werkzeug\http.py

再次转储HTTP报头。
    这是:func:`parse_list_header`,:func:`parse_set_header`和:func:`parse_dict_header`的反转。
    它还引用包含等号的字符串,除非您将其作为键、值对的字典传递。
        >>> dump_header({'foo':`bar baz'})
       `foo="bar baz"'
        >>> dump_header(('foo',`bar baz'))
       `foo, "bar baz"'
    :param iterable: 要引用的值的可迭代对象或字典。
    :param allow token: 如果设置为`False`,则不允许将token作为值。参见:func:`quote_header_value`了解更多细节。

8 dump_options_header(header: Union[str, NoneType], options: Mapping[str, Union[str, int, NoneType]]) -> str

dump_options_header(header: Union[str, NoneType], options: Mapping[str, Union[str, int, NoneType]]) -> str, module=werkzeug.http, line:252 at site-packages\werkzeug\http.py

与:func:`parse_options_header`相反的函数。
    :param header:  要转储的头文件;
    :param options: 要追加的选项字典。

9 http_date(timestamp: Union[datetime.datetime, datetime.date, int, float, time.struct_time, NoneType] = None) -> str

http_date(timestamp: Union[datetime.datetime, datetime.date, int, float, time.struct_time, NoneType] = None) -> str, module=werkzeug.http, line:960 at site-packages\werkzeug\http.py

将datetime对象或时间戳格式化为:rfc:`2822`日期字符串。
    这是:func:`email.utils.format_datetime`包装器。它假设朴素datetime对象是UTC格式的,而不是引发异常。
    :param timestamp:   要格式化的日期时间或时间戳。默认为当前时间。
    版本变更: 2.0   使用``email.utils.format_datetime`` 。接受``date`` 对象。

10 parse_age(value: Union[str, NoneType] = None) -> Union[datetime.timedelta, NoneType]

parse_age(value: Union[str, NoneType] = None) -> Union[datetime.timedelta, NoneType], module=werkzeug.http, line:992 at site-packages\werkzeug\http.py

将以10为基数的整数秒数解析为timedelta。
    如果解析失败,返回值为`None`。
    :param value:   一个以基数为10的整数组成的字符串。
    return:         一个 :class:`datetime.timedelta` 对象或`None`。

11 parse_cache_control_header(value: Union[str, NoneType], on_update: Union[Callable[[~_TAnyCC], NoneType], NoneType] = None, cls: Union[Type[~_TAnyCC], NoneType] = None) -> ~_TAnyCC

parse_cache_control_header(value: Union[str, NoneType], on_update: Union[Callable[[~_TAnyCC], NoneType], NoneType] = None, cls: Union[Type[~_TAnyCC], NoneType] = None) -> ~_TAnyCC, module=werkzeug.http, line:537 at site-packages\werkzeug\http.py

解析缓存控制标头。
    RFC在响应和请求缓存控制之间是不同的,这个方法没有。不要使用错误的控制声明是你的责任。
    版本增加: 0.5        添加“cls”。如果没有指定一个不可变的:class:`~werkzeug.datastructures.RequestCacheControl`返回。
    :param value:       要解析的缓存控制头。
    :param on_update:   一个可选的可调用对象,每次在 :class:`~werkzeug.datastructures.CacheControl` 对象发生变化时调用它。
    :param cls:         返回对象的类。默认使用 :class:`~werkzeug.datastructures.RequestCacheControl`。
    :return:            一个`cls`对象。

12 parse_content_range_header(value: Union[str, NoneType], on_update: Union[Callable[[ForwardRef(‘ds.ContentRange’)], NoneType], NoneType] = None) -> Union[ForwardRef(‘ds.ContentRange’), NoneType]

parse_content_range_header(value: Union[str, NoneType], on_update: Union[Callable[[ForwardRef(‘ds.ContentRange’)], NoneType], NoneType] = None) -> Union[ForwardRef(‘ds.ContentRange’), NoneType], module=werkzeug.http, line:800 at site-packages\werkzeug\http.py

将范围头解析为:class:`~werkzeug.datastructures.ContentRange`或`None`,如果无法解析。
    版本增加: 0.7
    :param value:       要解析的内容范围头。
    :param on_update:   一个可选的可调用对象,每次在 :class:`~werkzeug.datastructures.ContentRange`对象发生了变化时调用。

13 parse_csp_header(value: Union[str, NoneType], on_update: Union[Callable[[~_TAnyCSP], NoneType], NoneType] = None, cls: Union[Type[~_TAnyCSP], NoneType] = None) -> ~_TAnyCSP

parse_csp_header(value: Union[str, NoneType], on_update: Union[Callable[[~_TAnyCSP], NoneType], NoneType] = None, cls: Union[Type[~_TAnyCSP], NoneType] = None) -> ~_TAnyCSP, module=werkzeug.http, line:585 at site-packages\werkzeug\http.py

解析内容安全策略头。
    版本增加: 1.0.0      增加了对内容安全策略头的支持。
    :param value:       要解析的CSP报头。
    :param on_update:   一个可选的可调用对象,每次对象上的值被改变时调用。
    :param cls:         返回对象的类。默认 :class:`~werkzeug.datastructures.ContentSecurityPolicy`。
    :return:            一个`cls`对象。

14 parse_date(value: Union[str, NoneType]) -> Union[datetime.datetime, NoneType]

parse_date(value: Union[str, NoneType]) -> Union[datetime.datetime, NoneType], module=werkzeug.http, line:931 at site-packages\werkzeug\http.py

解析一个:rfc:`2822`日期到一个时区感知的:class:`datetime.datetime`对象,如果解析失败,则为`None`。
    这是:func:`email.utils.parsedate_to_datetime` 的包装器。
    如果解析失败,它返回`None`,而不是引发异常,并且总是返回一个时区感知的datetime对象。
    如果字符串没有时区信息,则假定为UTC。
    :param value:       支持日期格式的字符串。
    版本变更: 2.0        返回一个支持时区的datetime对象。使用``email.utils.parsedate_to_datetime``。

15 parse_options_header(value: Union[str, NoneType]) -> Tuple[str, Dict[str, str]]

parse_options_header(value: Union[str, NoneType]) -> Tuple[str, Dict[str, str]], module=werkzeug.http, line:390 at site-packages\werkzeug\http.py

解析一个``Content-Type``之类的标头到一个包含值和任意选项的元组:
        >>> parse_options_header('text/html; charset=utf8')
        ('text/html', {'charset':`utf8'})
    这应该不适用于``Cache-Control``之类的标头,它们使用不同的格式。对于那些,使用:func:`parse_dict_header`。
    :param value:   要解析的报头值。
    版本变更: 2.2   选项名总是被转换成小写。
    版本变更: 2.1   ``multiple``参数已弃用,并将在Werkzeug 2.2中删除。
    版本变更: 0.15  :rfc:`2231`参数的延续被处理。
    版本增加: 0.5

16 parse_set_header(value: Union[str, NoneType], on_update: Union[Callable[[ForwardRef(‘ds.HeaderSet’)], NoneType], NoneType] = None) ->`ds.HeaderSet’

parse_set_header(value: Union[str, NoneType], on_update: Union[Callable[[ForwardRef(‘ds.HeaderSet’)], NoneType], NoneType] = None) ->`ds.HeaderSet’, module=werkzeug.http, line:621 at site-packages\werkzeug\http.py

解析一个类似set的头文件并返回 :class:`~werkzeug.datastructures.HeaderSet` 对象:
        >>> hs = parse_set_header('token, "quoted value"')
    返回值是一个对象,它不区分大小写,并保持项目的顺序:
        >>>`TOKEN`in hs
        True
        >>> hs.index('quoted value')
        1
        >>> hs
        HeaderSet(['token',`quoted value'])
    要再次从:class:`HeaderSet`创建头文件,请使用:func:`dump_header`函数。
    :param value:       要解析的集合报头。
    :param on_update:   一个可选的可调用对象,每次在:class:`~werkzeug.datastructures.HeaderSet`对象发生了变化时调用。
    :return:            一个`~werkzeug.datastructures.HeaderSet`对象。

17 parse_www_authenticate_header(value: Union[str, NoneType], on_update: Union[Callable[[ForwardRef(‘ds.WWWAuthenticate’)], NoneType], NoneType] = None) ->`ds.WWWAuthenticate’

parse_www_authenticate_header(value: Union[str, NoneType], on_update: Union[Callable[[ForwardRef(‘ds.WWWAuthenticate’)], NoneType], NoneType] = None) ->`ds.WWWAuthenticate’, module=werkzeug.http, line:700 at site-packages\werkzeug\http.py

解析HTTP WWW-Authenticate报头到:class:`~werkzeug.datastructures.WWWAuthenticate` 对象。
    :param value:       一个要解析的WWW-Authenticate报头。
    :param on_update:   一个可选的可调用对象,每次在:class:`~werkzeug.datastructures.WWWAuthenticate`被更改时调用。
    :return:            一个 class:`~werkzeug.datastructures.WWWAuthenticate” 对象。

18 quote_etag(etag: str, weak: bool = False) -> str

quote_etag(etag: str, weak: bool = False) -> str, module=werkzeug.http, line:854 at site-packages\werkzeug\http.py

引用标签。
    :param etag:    要引用的etag。
    :param weak:    设置为“True”来标记它为“weak”。

19 unquote_etag(etag: Union[str, NoneType]) -> Union[Tuple[str, bool], Tuple[NoneType, NoneType]]

unquote_etag(etag: Union[str, NoneType]) -> Union[Tuple[str, bool], Tuple[NoneType, NoneType]], module=werkzeug.http, line:868 at site-packages\werkzeug\http.py

取消引用单个etag:
    >>> unquote_etag('W/"bar"')
    ('bar', True)
    >>> unquote_etag('"bar"')
    ('bar', False)
    :param etag: the etag identifier to unquote.
    :return: a``(etag, weak)`` tuple.

20 _set_property(name: str, doc: Union[str, NoneType] = None) -> property

_set_property(name: str, doc: Union[str, NoneType] = None) -> property, module=werkzeug.sansio.response, line:37 at site-packages\werkzeug\sansio\response.py

21 datetime.datetime

datetime, datetime.datetime, module=datetime, line:0 at

21 datetime.timedelta

timedelta, datetime.timedelta, module=datetime, line:0 at

两个日期时间值之间的差异。
timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)
所有参数都是可选的,默认值为0。实参可以是整数或浮点数,也可以是正数或负数。

data

1 days=daysofdatetime.timedeltaobjects> kind:data type:member_descriptor class:datetime.timedelta'> 2 max=999999999 days, 23:59:59.999999 kind:data type:timedelta class:datetime.timedelta’>
3 microseconds=microseconds
ofdatetime.timedeltaobjects> kind:data type:member_descriptor class:datetime.timedelta'> 4 min=-999999999 days, 0:00:00 kind:data type:timedelta class:datetime.timedelta’>
5 resolution=0:00:00.000001 kind:data type:timedelta class:datetime.timedelta'> 6 seconds=secondsofdatetime.timedeltaobjects> kind:data type:member_descriptor class:datetime.timedelta’>

method

7 total_seconds(self)

kind=method class=timedelta objtype=method_descriptor line:600 at …\datetime.py

持续时间内的总秒数。

22 datetime.timezone

timezone, datetime.timezone, module=datetime, line:0 at

tzinfo的UTC实现的固定偏移量。

data

1 max=UTC+23:59 kind:data type:timezone class:datetime.timezone'> 2 min=UTC-23:59 kind:data type:timezone class:datetime.timezone’>
3 utc=UTC kind:data type:timezone class:

method

4 dst(self, dt)

kind=method class=timezone objtype=method_descriptor line:2214 at …\datetime.py

返回None。

5 fromutc(self, dt)

kind=method class=timezone objtype=method_descriptor line:2220 at …\datetime.py

UTC的datetime ->本地时间的datetime。

6 tzname(self, dt)

kind=method class=timezone objtype=method_descriptor line:2206 at …\datetime.py

如果在创建时区时指定了name,则返回名称。否则返回偏移量为'UTC(+|-)HH:MM'。

7 utcoffset(self, dt)

kind=method class=timezone objtype=method_descriptor line:2200 at …\datetime.py

返回固定偏移量。

23 HTTPStatus

HTTPStatus, HTTPStatus, module=http, line:-1 at site-packages\werkzeug\http.py

HTTP状态码和原因语状态码来自以下:
    * RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616
    * RFC 6585: Additional HTTP Status Codes
    * RFC 3229: Delta encoding in HTTP
    * RFC 4918: HTTP Extensions for WebDAV, obsoletes 2518
    * RFC 5842: Binding Extensions to WebDAV
    * RFC 7238: Permanent Redirect
    * RFC 2295: Transparent Content Negotiation in HTTP
    * RFC 2774: An HTTP Extension Framework
    * RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2)

data

1 ACCEPTED=202 kind:data type:HTTPStatus class:HTTPStatus'> 2 ALREADY_REPORTED=208 kind:data type:HTTPStatus class:HTTPStatus’>
3 BAD_GATEWAY=502 kind:data type:HTTPStatus class:HTTPStatus'> 4 BAD_REQUEST=400 kind:data type:HTTPStatus class:HTTPStatus’>
5 CONFLICT=409 kind:data type:HTTPStatus class:HTTPStatus'> 6 CONTINUE=100 kind:data type:HTTPStatus class:HTTPStatus’>
7 CREATED=201 kind:data type:HTTPStatus class:HTTPStatus'> 8 EXPECTATION_FAILED=417 kind:data type:HTTPStatus class:HTTPStatus’>
9 FAILED_DEPENDENCY=424 kind:data type:HTTPStatus class:HTTPStatus'> 10 FORBIDDEN=403 kind:data type:HTTPStatus class:HTTPStatus’>
11 FOUND=302 kind:data type:HTTPStatus class:HTTPStatus'> 12 GATEWAY_TIMEOUT=504 kind:data type:HTTPStatus class:HTTPStatus’>
13 GONE=410 kind:data type:HTTPStatus class:HTTPStatus'> 14 HTTP_VERSION_NOT_SUPPORTED=505 kind:data type:HTTPStatus class:HTTPStatus’>
15 IM_USED=226 kind:data type:HTTPStatus class:HTTPStatus'> 16 INSUFFICIENT_STORAGE=507 kind:data type:HTTPStatus class:HTTPStatus’>
17 INTERNAL_SERVER_ERROR=500 kind:data type:HTTPStatus class:HTTPStatus'> 18 LENGTH_REQUIRED=411 kind:data type:HTTPStatus class:HTTPStatus’>
19 LOCKED=423 kind:data type:HTTPStatus class:HTTPStatus'> 20 LOOP_DETECTED=508 kind:data type:HTTPStatus class:HTTPStatus’>
21 METHOD_NOT_ALLOWED=405 kind:data type:HTTPStatus class:HTTPStatus'> 22 MISDIRECTED_REQUEST=421 kind:data type:HTTPStatus class:HTTPStatus’>
23 MOVED_PERMANENTLY=301 kind:data type:HTTPStatus class:HTTPStatus'> 24 MULTIPLE_CHOICES=300 kind:data type:HTTPStatus class:HTTPStatus’>
25 MULTI_STATUS=207 kind:data type:HTTPStatus class:HTTPStatus'> 26 NETWORK_AUTHENTICATION_REQUIRED=511 kind:data type:HTTPStatus class:HTTPStatus’>
27 NON_AUTHORITATIVE_INFORMATION=203 kind:data type:HTTPStatus class:HTTPStatus'> 28 NOT_ACCEPTABLE=406 kind:data type:HTTPStatus class:HTTPStatus’>
29 NOT_EXTENDED=510 kind:data type:HTTPStatus class:HTTPStatus'> 30 NOT_FOUND=404 kind:data type:HTTPStatus class:HTTPStatus’>
31 NOT_IMPLEMENTED=501 kind:data type:HTTPStatus class:HTTPStatus'> 32 NOT_MODIFIED=304 kind:data type:HTTPStatus class:HTTPStatus’>
33 NO_CONTENT=204 kind:data type:HTTPStatus class:HTTPStatus'> 34 OK=200 kind:data type:HTTPStatus class:HTTPStatus’>
35 PARTIAL_CONTENT=206 kind:data type:HTTPStatus class:HTTPStatus'> 36 PAYMENT_REQUIRED=402 kind:data type:HTTPStatus class:HTTPStatus’>
37 PERMANENT_REDIRECT=308 kind:data type:HTTPStatus class:HTTPStatus'> 38 PRECONDITION_FAILED=412 kind:data type:HTTPStatus class:HTTPStatus’>
39 PRECONDITION_REQUIRED=428 kind:data type:HTTPStatus class:HTTPStatus'> 40 PROCESSING=102 kind:data type:HTTPStatus class:HTTPStatus’>
41 PROXY_AUTHENTICATION_REQUIRED=407 kind:data type:HTTPStatus class:HTTPStatus'> 42 REQUESTED_RANGE_NOT_SATISFIABLE=416 kind:data type:HTTPStatus class:HTTPStatus’>
43 REQUEST_ENTITY_TOO_LARGE=413 kind:data type:HTTPStatus class:HTTPStatus'> 44 REQUEST_HEADER_FIELDS_TOO_LARGE=431 kind:data type:HTTPStatus class:HTTPStatus’>
45 REQUEST_TIMEOUT=408 kind:data type:HTTPStatus class:HTTPStatus'> 46 REQUEST_URI_TOO_LONG=414 kind:data type:HTTPStatus class:HTTPStatus’>
47 RESET_CONTENT=205 kind:data type:HTTPStatus class:HTTPStatus'> 48 SEE_OTHER=303 kind:data type:HTTPStatus class:HTTPStatus’>
49 SERVICE_UNAVAILABLE=503 kind:data type:HTTPStatus class:HTTPStatus'> 50 SWITCHING_PROTOCOLS=101 kind:data type:HTTPStatus class:HTTPStatus’>
51 TEMPORARY_REDIRECT=307 kind:data type:HTTPStatus class:HTTPStatus'> 52 TOO_MANY_REQUESTS=429 kind:data type:HTTPStatus class:HTTPStatus’>
53 UNAUTHORIZED=401 kind:data type:HTTPStatus class:HTTPStatus'> 54 UNPROCESSABLE_ENTITY=422 kind:data type:HTTPStatus class:HTTPStatus’>
55 UNSUPPORTED_MEDIA_TYPE=415 kind:data type:HTTPStatus class:HTTPStatus'> 56 UPGRADE_REQUIRED=426 kind:data type:HTTPStatus class:HTTPStatus’>
57 USE_PROXY=305 kind:data type:HTTPStatus class:HTTPStatus'> 58 VARIANT_ALSO_NEGOTIATES=506 kind:data type:HTTPStatus class:HTTPStatus’>

24 werkzeug.datastructures.Headers

Headers, werkzeug.datastructures.Headers, module=werkzeug.datastructures, line:848 at site-packages\werkzeug\datastructures.py

24 werkzeug.datastructures.HeaderSet

HeaderSet, werkzeug.datastructures.HeaderSet, module=werkzeug.datastructures, line:2218 at site-packages\werkzeug\datastructures.py

24 werkzeug.datastructures.CallbackDict

CallbackDict, werkzeug.datastructures.CallbackDict, module=werkzeug.datastructures, line:2205 at site-packages\werkzeug\datastructures.py

每次更改内容时调用传递的函数的字典。函数被传递给dict实例。

25 werkzeug.datastructures.ContentRange

ContentRange, werkzeug.datastructures.ContentRange, module=werkzeug.datastructures, line:2573 at site-packages\werkzeug\datastructures.py

表示内容范围标头。	
版本增加: 0.7

property

1 length= kind:property type:property class:werkzeug.datastructures.ContentRange'> 2 start= kind:property type:property class:werkzeug.datastructures.ContentRange’>
3 stop= kind:property type:property class:werkzeug.datastructures.ContentRange'> 4 units= kind:property type:property class:werkzeug.datastructures.ContentRange’>

method

5 set(self, start, stop, length=None, units=“bytes”)

kind=method class=ContentRange objtype=function line:2594 at …\lib\site-packages\werkzeug\datastructures.py

更新范围的简单方法。

6 to_header(self)

kind=method class=ContentRange objtype=function line:2610 at …\lib\site-packages\werkzeug\datastructures.py

7 unset(self)

kind=method class=ContentRange objtype=function line:2604 at …\lib\site-packages\werkzeug\datastructures.py

将单位设置为`None`,这表示不应再使用标头。

26 werkzeug.datastructures.ContentSecurityPolicy

ContentSecurityPolicy, werkzeug.datastructures.ContentSecurityPolicy, module=werkzeug.datastructures, line:2129 at site-packages\werkzeug\datastructures.py

存储内容安全策略标头值的字典的子类。
    它具有所有3级策略的访问器。因为HTTP头中的csp指令使用破折号,所以python描述符使用下划线。
    要再次获得:class:`ContentSecuirtyPolicy`对象的头部,您可以将该对象转换为字符串或调用 :meth:`to_header`方法。
    如果您计划子类化它并添加您自己的项,请查看该类的源代码。
版本增加: 1.0.0     增加了对内容安全策略标头的支持。

property

1 base_uri= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy'> 2 child_src= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy’>
3 connect_src= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy'> 4 default_src= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy’>
5 font_src= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy'> 6 form_action= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy’>
7 frame_ancestors= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy'> 8 frame_src= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy’>
9 img_src= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy'> 10 manifest_src= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy’>
11 media_src= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy'> 12 navigate_to= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy’>
13 object_src= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy'> 14 plugin_types= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy’>
15 prefetch_src= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy'> 16 report_to= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy’>
17 report_uri= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy'> 18 sandbox= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy’>
19 script_src= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy'> 20 script_src_attr= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy’>
21 script_src_elem= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy'> 22 style_src= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy’>
23 style_src_attr= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy'> 24 style_src_elem= kind:property type:property class:werkzeug.datastructures.ContentSecurityPolicy’>
25 worker_src= kind:property type:property class:

method

26 to_header(self)

kind=method class=ContentSecurityPolicy objtype=function line:2193 at …\lib\site-packages\werkzeug\datastructures.py

将存储的值转换为缓存控制标头。

27 werkzeug.datastructures.ResponseCacheControl

ResponseCacheControl, werkzeug.datastructures.ResponseCacheControl, module=werkzeug.datastructures, line:2086 at site-packages\werkzeug\datastructures.py

响应的缓存控制。与:class:`RequestCacheControl`不同,这是可变的,并允许访问与响应相关的缓存控制头。
    要再次获得:class:`ResponseCacheControl`对象的头部,你可以将该对象转换为字符串或调用:meth:`to_header`方法。
    如果您计划子类化它并添加您自己的项,请查看该类的源代码。
    版本变更: 2.1.1     ``s_maxage``将值转换为int类型。
    版本变更:0.5        设置int属性,如``max_age``'将把值转换为int类型。在以前的版本中,存在一个用于请求和响应的“CacheControl”类。

property

1 immutable= kind:property type:property class:werkzeug.datastructures.ResponseCacheControl'> 2 must_revalidate= kind:property type:property class:werkzeug.datastructures.ResponseCacheControl’>
3 private= kind:property type:property class:werkzeug.datastructures.ResponseCacheControl'> 4 proxy_revalidate= kind:property type:property class:werkzeug.datastructures.ResponseCacheControl’>
5 public= kind:property type:property class:werkzeug.datastructures.ResponseCacheControl'> 6 s_maxage= kind:property type:property class:werkzeug.datastructures.ResponseCacheControl’>

28 werkzeug.datastructures.WWWAuthenticate

WWWAuthenticate, werkzeug.datastructures.WWWAuthenticate, module=werkzeug.datastructures, line:2770 at site-packages\werkzeug\datastructures.py

提供对“WWW-Authenticate”标头的简单访问。

property

1 algorithm= kind:property type:property class:werkzeug.datastructures.WWWAuthenticate'> 2 domain= kind:property type:property class:werkzeug.datastructures.WWWAuthenticate’>
3 nonce= kind:property type:property class:werkzeug.datastructures.WWWAuthenticate'> 4 opaque= kind:property type:property class:werkzeug.datastructures.WWWAuthenticate’>
5 qop= kind:property type:property class:werkzeug.datastructures.WWWAuthenticate'> 6 realm= kind:property type:property class:werkzeug.datastructures.WWWAuthenticate’>
7 stale= kind:property type:property class:werkzeug.datastructures.WWWAuthenticate'> 8 type= kind:property type:property class:werkzeug.datastructures.WWWAuthenticate’>

method

9 set_basic(self, realm=“authentication required”)

kind=method class=WWWAuthenticate objtype=function line:2782 at …\lib\site-packages\werkzeug\datastructures.py

清除auth信息并启用基本auth。

10 set_digest(

kind=method class=WWWAuthenticate objtype=function line:2789 at …\lib\site-packages\werkzeug\datastructures.py

清除验证信息并启用摘要验证。

11 to_header(self)

kind=method class=WWWAuthenticate objtype=function line:2810 at …\lib\site-packages\werkzeug\datastructures.py

将存储的值转换为WWW-Authenticate报头。

static method

12 auth_property()

kind=static method class=WWWAuthenticate objtype=staticmethod

staticmethod(function) -> method将函数转换为静态方法。

29 COEP

COEP, COEP, module=werkzeug.http, line:178 at site-packages\werkzeug\http.py

跨域嵌入器策略

data

1 REQUIRE_CORP=COEP.REQUIRE_CORP kind:data type:COEP class:COEP'> 2 UNSAFE_NONE=COEP.UNSAFE_NONE kind:data type:COEP class:COEP’>

30 COOP

COOP, COOP, module=werkzeug.http, line:185 at site-packages\werkzeug\http.py

跨原产地开放政策

data

1 SAME_ORIGIN=COOP.SAME_ORIGIN kind:data type:COOP class:COOP'> 2 SAME_ORIGIN_ALLOW_POPUPS=COOP.SAME_ORIGIN_ALLOW_POPUPS kind:data type:COOP class:COOP’>
3 UNSAFE_NONE=COOP.UNSAFE_NONE kind:data type:COOP class:

31 werkzeug.utils.header_property

header_property, werkzeug.utils.header_property, module=werkzeug.utils, line:152 at site-packages\werkzeug\utils.py

31 werkzeug.sansio.response.Response

Response, werkzeug.sansio.response.Response, module=werkzeug.sansio.response, line:63 at site-packages\werkzeug\sansio\response.py

私有或局部

31 _to_str
32 _set_property

☘️【werkzeug.wrappers.request】

request, fullname=werkzeug.wrappers.request, file=werkzeug\wrappers\request.py

统计

序号 类别 数量
4 str 4
8 dict 1
9 module 4
10 class 12
11 function 5
13 residual 3
14 system 8
15 private 3
16 all 29

常量

模块

1 functools

functools, fullname=functools, file=functools.py

2 json

json, fullname=json, file=json_init_.py

3 typing

typing, fullname=typing, file=typing.py

4 typing

typing, fullname=typing, file=typing.py

函数

5 _wsgi_decoding_dance(s: str, charset: str =utf-8', errors: str =replace’) -> str

_wsgi_decoding_dance(s: str, charset: str =utf-8', errors: str =replace’) -> str, module=werkzeug._internal, line:149 at site-packages\werkzeug_internal.py

6 iter_multi_items(mapping)

iter_multi_items(mapping), module=werkzeug.datastructures, line:21 at site-packages\werkzeug\datastructures.py

迭代映射的项,生成键和值,而不从更复杂的结构中删除任何键和值。

7 default_stream_factory(total_content_length: Union[int, NoneType], content_type: Union[str, NoneType], filename: Union[str, NoneType], content_length: Union[int, NoneType] = None) -> IO[bytes]

default_stream_factory(total_content_length: Union[int, NoneType], content_type: Union[str, NoneType], filename: Union[str, NoneType], content_length: Union[int, NoneType] = None) -> IO[bytes], module=werkzeug.formparser, line:58 at site-packages\werkzeug\formparser.py

8 _get_server(environ:`WSGIEnvironment’) -> Union[Tuple[str, Union[int, NoneType]], NoneType]

_get_server(environ:`WSGIEnvironment’) -> Union[Tuple[str, Union[int, NoneType]], NoneType], module=werkzeug.wsgi, line:76 at site-packages\werkzeug\wsgi.py

9 get_input_stream(environ:`WSGIEnvironment’, safe_fallback: bool = True) -> IO[bytes]

get_input_stream(environ:`WSGIEnvironment’, safe_fallback: bool = True) -> IO[bytes], module=werkzeug.wsgi, line:136 at site-packages\werkzeug\wsgi.py

从WSGI环境返回输入流,并以最合理的方式包装它。
    在大多数情况下,返回的流不是原始的WSGI流,而是可以安全地读取而不考虑内容长度的流。
    如果未设置内容长度,则出于安全原因,流将为空。
    如果WSGI服务器支持分块或无限流,它应该设置``wsgi.input_terminated``值,以指示。
    版本增加: 0.9
    :parameter_environ:     要从中获取流的WSGI环境。
    :param safe_fallback:   当内容长度未设置时,使用空流作为安全回退。禁用此功能允许无限流,这可能存在拒绝服务风险。

10 _io.BytesIO

BytesIO, _io.BytesIO, module=_io, line:0 at

使用内存字节缓冲区的缓冲I/O实现。

data

1 closed=closedof_io.BytesIOobjects> kind:data type:getset_descriptor class:

method

2 close()

kind=method class=BytesIO objtype=method_descriptor

禁用所有I/O操作。

3 flush()

kind=method class=BytesIO objtype=method_descriptor

什么也不做。

4 getbuffer()

kind=method class=BytesIO objtype=method_descriptor

获取BytesIO对象内容的读写视图。

5 getvalue()

kind=method class=BytesIO objtype=method_descriptor

检索BytesIO对象的全部内容。

6 isatty()

kind=method class=BytesIO objtype=method_descriptor

总是返回False。
BytesIO对象没有连接到类似tty的设备。

7 read()

kind=method class=BytesIO objtype=method_descriptor

最多读取大小字节,作为bytes对象返回。
如果size参数为负,则读取直到达到EOF。在EOF时返回一个空字节对象。

8 read1()

kind=method class=BytesIO objtype=method_descriptor

最多读取大小字节,作为bytes对象返回。
如果size参数为负或省略,则读取直到达到EOF。在EOF时返回一个空字节对象。

9 readable()

kind=method class=BytesIO objtype=method_descriptor

如果IO对象可以被读取,则返回True。

10 readinto()

kind=method class=BytesIO objtype=method_descriptor

将字节读入缓冲区。
返回读取的字节数(EOF为0),如果将对象设置为不阻塞且没有数据可读,则返回None。

11 readline()

kind=method class=BytesIO objtype=method_descriptor

文件的下一行,作为bytes对象。
保留换行符。非负的size参数限制了返回的最大字节数(那么可能返回不完整的行)。在EOF时返回一个空字节对象。

12 readlines()

kind=method class=BytesIO objtype=method_descriptor

字节对象的列表,每一行来自文件。
反复调用readline()并返回这样读取的行列表。如果给出了可选的size参数,则是返回行中总字节数的近似界限。

13 seek()

kind=method class=BytesIO objtype=method_descriptor

改变流的位置。
    查找相对于由where:
    0   指示的位置的字节偏移位置(默认值)。Pos >= 0;
    1   当前位置- pos可能为负值;
    2   流的结尾-通常是否定的。
    返回新的绝对位置。

14 seekable()

kind=method class=BytesIO objtype=method_descriptor

如果IO对象可以被查找,则返回True。

15 tell()

kind=method class=BytesIO objtype=method_descriptor

当前文件位置,整数。

16 truncate()

kind=method class=BytesIO objtype=method_descriptor

将文件截短至最多大小字节。
大小默认为当前文件位置,由tell()返回。
当前文件位置不变。返回新的大小。

17 writable()

kind=method class=BytesIO objtype=method_descriptor

如果IO对象可以写入,则返回True。

18 write()

kind=method class=BytesIO objtype=method_descriptor

写入字节到文件。返回写入的字节数。

19 writelines()

kind=method class=BytesIO objtype=method_descriptor

向文件写入行。
注意,没有添加换行符。行可以是产生字节类对象的任何可迭代对象。这相当于为每个元素调用write()。

11 werkzeug.datastructures.CombinedMultiDict

CombinedMultiDict, werkzeug.datastructures.CombinedMultiDict, module=werkzeug.datastructures, line:1405 at site-packages\werkzeug\datastructures.py

一个只读的:class:`MultiDict`,你可以传递多个:class:`MultiDict`实例作为序列,它将组合所有包装字典的返回值:
    >>> from werkzeug.datastructures import CombinedMultiDict, MultiDict
    >>> post = MultiDict([('foo',`bar')])
    >>> get = MultiDict([('blub',`blah')])
    >>> combined = CombinedMultiDict([get, post])
    >>> combined['foo']
   `bar'
    >>> combined['blub']
   `blah'
    这适用于所有的读操作,并将引发`TypeError`对于通常改变数据的方法,这是不可能的。
    从Werkzeug 0.3起,该类引发的`KeyError`也是 :exc:`~exceptions.BadRequest` HTTP异常,如果捕获到HTTP异常,将呈现一个``400 BAD REQUEST``的页面。

method

1 copy(self)

kind=method class=CombinedMultiDict objtype=function line:1499 at …\lib\site-packages\werkzeug\datastructures.py

返回该对象的浅可变副本。
    这将返回一个:class:`MultiDict`,表示复制时的数据。
    副本将不再反映对包装字典的更改。
    版本变更: 0.15  返回一个可变的:class:`MultiDict`。

2 get(self, key, default=None, type=None)

kind=method class=CombinedMultiDict objtype=function line:1444 at …\lib\site-packages\werkzeug\datastructures.py

3 getlist(self, key, type=None)

kind=method class=CombinedMultiDict objtype=function line:1455 at …\lib\site-packages\werkzeug\datastructures.py

4 items(self, multi=False)

kind=method class=CombinedMultiDict objtype=function line:1475 at …\lib\site-packages\werkzeug\datastructures.py

5 keys(self)

kind=method class=CombinedMultiDict objtype=function line:1469 at …\lib\site-packages\werkzeug\datastructures.py

6 lists(self)

kind=method class=CombinedMultiDict objtype=function line:1489 at …\lib\site-packages\werkzeug\datastructures.py

7 listvalues(self)

kind=method class=CombinedMultiDict objtype=function line:1496 at …\lib\site-packages\werkzeug\datastructures.py

8 to_dict(self, flat=True)

kind=method class=CombinedMultiDict objtype=function line:1511 at …\lib\site-packages\werkzeug\datastructures.py

返回常规字典的内容。如果`flat`为`True`,则返回的字典将只包含第一个条目,如果`flat`为`False`,则所有值将作为列表返回。
    :param flat:    如果设置为`False`,返回的字典将包含其中所有值的列表。否则,它将只包含每个键的第一个项。
    :return:        class:`dict`

9 values(self)

kind=method class=CombinedMultiDict objtype=function line:1485 at …\lib\site-packages\werkzeug\datastructures.py

class method

10 fromkeys(cls, keys, value=None)

kind=class method class=CombinedMultiDict objtype=classmethod line:1435 at …\lib\site-packages\werkzeug\datastructures.py

将函数转换为类方法。

12 werkzeug.datastructures.EnvironHeaders

EnvironHeaders, werkzeug.datastructures.EnvironHeaders, module=werkzeug.datastructures, line:1354 at site-packages\werkzeug\datastructures.py

来自WSGI环境的头文件的只读版本。
    它提供了与`Headers`相同的接口,并且是从WSGI环境中构造的。
    从Werkzeug 0.3起,该类引发的`KeyError`也是 :exc:`~exceptions.BadRequest` HTTP异常,如果捕获到HTTP异常,将呈现一个``400 BAD REQUEST``的页面。

method

1 copy(self)

kind=method class=EnvironHeaders objtype=function line:1401 at …\lib\site-packages\werkzeug\datastructures.py

13 werkzeug.datastructures.FileStorage

FileStorage, werkzeug.datastructures.FileStorage, module=werkzeug.datastructures, line:2894 at site-packages\werkzeug\datastructures.py

:class:`FileStorage` 类是传入文件的薄包装器。
    请求对象使用它来表示上传的文件。包装器流的所有属性都由文件存储代理,
    因此可以执行``storage.read()``而不是长格式``storage.stream.read()``。

property

1 content_length= kind:property type:property class:werkzeug.datastructures.FileStorage'> 2 content_type= kind:property type:property class:werkzeug.datastructures.FileStorage’>
3 mimetype= kind:property type:property class:werkzeug.datastructures.FileStorage'> 4 mimetype_params= kind:property type:property class:werkzeug.datastructures.FileStorage’>

method

5 close(self)

kind=method class=FileStorage objtype=function line:3011 at …\lib\site-packages\werkzeug\datastructures.py

如果可能的话,关闭底层文件。

6 save(self, dst, buffer_size=16384)

kind=method class=FileStorage objtype=function line:2978 at …\lib\site-packages\werkzeug\datastructures.py

将文件保存到目标路径或文件对象。
    如果目标是一个文件对象,则必须在调用之后自己关闭它。
    缓冲区大小是在复制过程中内存中保存的字节数。默认为16KB。
    要安全保存文件,还可以查看:func:`secure_filename`。
    :param dst:         文件名,:class:`os.`PathLike`,或要写入的打开文件对象。
    :param buffer_size: 作为:func:`shutil.copyfileobj`的``length`参数传递。
    版本变更: 1.0       支持:mod:“pathlib”。

14 werkzeug.datastructures.ImmutableMultiDict

ImmutableMultiDict, werkzeug.datastructures.ImmutableMultiDict, module=werkzeug.datastructures, line:153 at site-packages\werkzeug\datastructures.py

14 werkzeug.datastructures.MultiDict

MultiDict, werkzeug.datastructures.MultiDict, module=werkzeug.datastructures, line:289 at site-packages\werkzeug\datastructures.py

14 werkzeug.formparser.FormDataParser

FormDataParser, werkzeug.formparser.FormDataParser, module=werkzeug.formparser, line:156 at site-packages\werkzeug\formparser.py

这个类实现了对Werkzeug表单数据的解析。
    它本身可以解析多部分和url编码的表单数据。
    它可以被子类化和扩展,但对于大多数mime类型来说,使用未修改的流并将其作为请求对象上的单独属性公开是一个更好的主意。
    版本增加: 0.8
    :param stream_factory:  一个可选的可调用对象,返回一个新的可读写文件描述符。这个可调用函数的工作原理与:meth:`Response._get_file_stream`相同。
    :param charset:         URL和URL编码的表单数据的字符集。
    :param errors:          编码错误行为。
    :param max_form_memory_size:    在内存中存储表单数据所接受的最大字节数。如果数据超过指定的值,引发:exc:`~exceptions.RequestEntityTooLarge`异常。
    :param max_content_length:      如果提供了此值,并且传输的数据超过此值,则引发:exc:`~exceptions.RequestEntityTooLarge`异常。
    :param cls:             一个可选的字典类。如果未指定或为“None”,则使用默认的:class:`MultiDict`。
    :param silent:          如果设置为False,解析错误将不会被捕获。
    :param max_form_parts:  要解析的零件的最大数量。如果超出了这个值,引发:exc:`~exceptions.RequestEntityTooLarge`异常。

data

1 parse_functions={‘multipart/form-data’:

method

2 get_parse_func(

kind=method class=FormDataParser objtype=function line:214 at …\lib\site-packages\werkzeug\formparser.py

3 parse(

kind=method class=FormDataParser objtype=function line:235 at …\lib\site-packages\werkzeug\formparser.py

解析来自给定流、mime类型、内容长度和mime类型参数的信息。
    :param stream:      输入流
    :param mimetype:    数据的mimetype
    :param content_length:  传入数据的内容长度
    :param options:     可选的mimetype参数(例如用于多部分边界)
    :return:            形式为``(stream, form, files)``的元组。

4 parse_from_environ(self, environ: “WSGIEnvironment”) -> “t_parse_result”:

kind=method class=FormDataParser objtype=function line:224 at …\lib\site-packages\werkzeug\formparser.py

将来自环境的信息解析为表单数据。
    :param environ: 用于解析的WSGI环境。
    :return:        一个形式为``(stream, form, files)``的元组。

15 werkzeug.sansio.request.Request

Request, werkzeug.sansio.request.Request, module=werkzeug.sansio.request, line:38 at site-packages\werkzeug\sansio\request.py

表示HTTP请求的非io部分,包括方法、URL信息和标头。
    这个类不适合一般用途。它应该只在实现WSGI, ASGI或其他HTTP应用程序规范时使用。
    Werkzeug在 :cls:`werkzeug.wrappers.Request` 提供了一个WSGI实现。
    :param method:          发出请求的方法,如“GET”。
    :param scheme:          请求使用的协议URL方案,如“https”或“wss”。
    :param server:          服务器地址。unix套接字为``(host, port)``,``(path, None)``,如果未知则为``None``。
    :param root_path:       应用程序挂载的前缀。这是附加到生成的url,但不是路由匹配的一部分。
    :param path:            在“根路径”之后的URL路径部分。
    :param query_string:    URL中“?”后面的部分。
    :param headers:         与请求一起收到的报头。
    :param remote_addr:     发送请求的客户端地址。
    版本增加: 2.0

data

1 access_control_request_headers= kind:data type:header_property class:werkzeug.sansio.request.Request'> 2 access_control_request_method= kind:data type:header_property class:werkzeug.sansio.request.Request’>
3 charset=utf-8 kind:data type:str class:werkzeug.sansio.request.Request'> 4 content_encoding= kind:data type:header_property class:werkzeug.sansio.request.Request’>
5 content_md5= kind:data type:header_property class:werkzeug.sansio.request.Request'> 6 content_type= kind:data type:header_property class:werkzeug.sansio.request.Request’>
7 date= kind:data type:header_property class:werkzeug.sansio.request.Request'> 8 dict_storage_class=werkzeug.datastructures.ImmutableMultiDict’> kind:data type:type class:werkzeug.sansio.request.Request'> 9 encoding_errors=replace kind:data type:str class:werkzeug.sansio.request.Request’>
10 list_storage_class=werkzeug.datastructures.ImmutableList'> kind:data type:type class:werkzeug.sansio.request.Request’>
11 max_forwards= kind:data type:header_property class:werkzeug.sansio.request.Request'> 12 origin= kind:data type:header_property class:werkzeug.sansio.request.Request’>
13 parameter_storage_class=werkzeug.datastructures.ImmutableMultiDict'> kind:data type:type class:werkzeug.sansio.request.Request’>
14 referrer= kind:data type:header_property class:werkzeug.sansio.request.Request'> 15 trusted_hosts=None kind:data type:NoneType class:werkzeug.sansio.request.Request’>
16 user_agent_class=werkzeug.user_agent.UserAgent'> kind:data type:type class:werkzeug.sansio.request.Request’>

property

17 accept_charsets= kind:property type:cached_property class:werkzeug.sansio.request.Request'> 18 accept_encodings= kind:property type:cached_property class:werkzeug.sansio.request.Request’>
19 accept_languages= kind:property type:cached_property class:werkzeug.sansio.request.Request'> 20 accept_mimetypes= kind:property type:cached_property class:werkzeug.sansio.request.Request’>
21 access_route= kind:property type:cached_property class:werkzeug.sansio.request.Request'> 22 args= kind:property type:cached_property class:werkzeug.sansio.request.Request’>
23 authorization= kind:property type:cached_property class:werkzeug.sansio.request.Request'> 24 base_url= kind:property type:cached_property class:werkzeug.sansio.request.Request’>
25 cache_control= kind:property type:cached_property class:werkzeug.sansio.request.Request'> 26 content_length= kind:property type:cached_property class:werkzeug.sansio.request.Request’>
27 cookies= kind:property type:cached_property class:werkzeug.sansio.request.Request'> 28 full_path= kind:property type:cached_property class:werkzeug.sansio.request.Request’>
29 host= kind:property type:cached_property class:werkzeug.sansio.request.Request'> 30 host_url= kind:property type:cached_property class:werkzeug.sansio.request.Request’>
31 if_match= kind:property type:cached_property class:werkzeug.sansio.request.Request'> 32 if_modified_since= kind:property type:cached_property class:werkzeug.sansio.request.Request’>
33 if_none_match= kind:property type:cached_property class:werkzeug.sansio.request.Request'> 34 if_range= kind:property type:cached_property class:werkzeug.sansio.request.Request’>
35 if_unmodified_since= kind:property type:cached_property class:werkzeug.sansio.request.Request'> 36 is_json= kind:property type:property class:werkzeug.sansio.request.Request’>
37 is_secure= kind:property type:property class:werkzeug.sansio.request.Request'> 38 mimetype= kind:property type:property class:werkzeug.sansio.request.Request’>
39 mimetype_params= kind:property type:property class:werkzeug.sansio.request.Request'> 40 pragma= kind:property type:cached_property class:werkzeug.sansio.request.Request’>
41 range= kind:property type:cached_property class:werkzeug.sansio.request.Request'> 42 root_url= kind:property type:cached_property class:werkzeug.sansio.request.Request’>
43 url= kind:property type:cached_property class:werkzeug.sansio.request.Request'> 44 url_charset= kind:property type:property class:werkzeug.sansio.request.Request’>
45 user_agent= kind:property type:cached_property class:

16 werkzeug.utils.cached_property

cached_property, werkzeug.utils.cached_property, module=werkzeug.utils, line:49 at site-packages\werkzeug\utils.py

16 werkzeug.utils.environ_property

environ_property, werkzeug.utils.environ_property, module=werkzeug.utils, line:125 at site-packages\werkzeug\utils.py

将请求属性映射到环境变量。
    这不仅适用于Werkzeug请求对象,也适用于任何其他具有环境属性的类:
        >>> class Test(object):
        ...     environ = {'key':`value'}
        ...     test = environ_property('key')
        >>> var = Test()
        >>> var.test
       `value'
    如果你传递第二个值,如果键不存在,它被用作默认值,第三个可以是一个转换器,它接受一个值并转换它。
    如果引发:exc:`ValueError`或:exc:`TypeError`,则使用默认值。
    如果没有提供默认值,则使用`None`。默认情况下,该属性是只读的。你必须通过向构造函数传递``read_only=False``来显式地启用它。

data

1 read_only=True kind:data type:bool class:

method

2 lookup(self, obj: “Request”) -> “WSGIEnvironment”:

kind=method class=environ_property objtype=function line:148 at …\lib\site-packages\werkzeug\utils.py

17 werkzeug.exceptions.BadRequest

BadRequest, werkzeug.exceptions.BadRequest, module=werkzeug.exceptions, line:174 at site-packages\werkzeug\exceptions.py

*400*如果浏览器向应用程序或服务器发送了无法处理的内容,则会引发`Bad Request`。

data

1 code=400 kind:data type:int class:werkzeug.exceptions.BadRequest'> 2 description=The browser (or proxy) sent a request that this server could not understand. kind:data type:str class:werkzeug.exceptions.BadRequest’>

18 werkzeug.wrappers.request.Request

Request, werkzeug.wrappers.request.Request, module=werkzeug.wrappers.request, line:29 at site-packages\werkzeug\wrappers\request.py

私有或局部

18 _wsgi_decoding_dance
19 _SansIORequest
20 _get_server

☘️【werkzeug.wrappers.response】

response, fullname=werkzeug.wrappers.response, file=werkzeug\wrappers\response.py

统计

序号 类别 数量
4 str 4
8 dict 1
9 module 4
10 class 8
11 function 14
13 residual 3
14 system 8
15 private 7
16 all 34

模块

1 json

json, fullname=json, file=json_init_.py

2 typing

typing, fullname=typing, file=typing.py

3 typing

typing, fullname=typing, file=typing.py

4 warnings

warnings, fullname=warnings, file=warnings.py

函数

5 _to_bytes(x: Union[str, bytes], charset: str =utf-8', errors: str =strict’) -> bytes

_to_bytes(x: Union[str, bytes], charset: str =utf-8', errors: str =strict’) -> bytes, module=werkzeug._internal, line:95 at site-packages\werkzeug_internal.py

6 remove_entity_headers(headers: Union[ForwardRef(‘ds.Headers’), List[Tuple[str, str]]], allowed: Iterable[str] = (‘expires’,`content-location’)) -> None

remove_entity_headers(headers: Union[ForwardRef(‘ds.Headers’), List[Tuple[str, str]]], allowed: Iterable[str] = (‘expires’,`content-location’)) -> None, module=werkzeug.http, line:1072 at site-packages\werkzeug\http.py

从列表或:class:`headers`对象中删除所有实体头文件。
    这个操作可以就地进行。`Expires`和`Content-Location`标头默认不会被删除。
    这样做的原因是:rfc:`2616`节10.3.5,其中指定了应该发送的一些实体头。
    版本变更: 0.5        增加了`allowed`参数。
    :param headers:     一个列表或:class:`headers`对象。
    :param allowed:     一个应该仍然允许的报头列表,即使它们是实体头。

7 iri_to_uri(iri: Union[str, Tuple[str, str, str, str, str]], charset: str =utf-8', errors: str =strict’, safe_conversion: bool = False) -> str

iri_to_uri(iri: Union[str, Tuple[str, str, str, str, str]], charset: str =utf-8', errors: str =strict’, safe_conversion: bool = False) -> str, module=werkzeug.urls, line:753 at site-packages\werkzeug\urls.py

将IRI转换为URI。
    所有非ascii字符和不安全字符都加引号。如果URL有域,则将其编码为Punycode。
        >>> iri_to_uri('http://\u2603.net/p\xe5th?q=\xe8ry%DF')
       `http://xn--n3h.net/p%C3%A5th?q=%C3%A8ry%DF'
    :param iri:     要转换的iri。
    :param charset: IRI的编码。
    :param errors:    在``bytes.encode``期间使用的错误处理程序。
    :param safe_conversion: 如果URL只包含ASCII字符且不包含空格,则返回不变的URL。请看下面的解释。
    对于违反URI规范的某些协议,IRI转换存在一个普遍的问题。考虑以下两个IRIs:
        magnet:?xt=uri:whatever
        itms-services://?action=download-manifest
    解析后,我们不知道方案是否需要``//``,如果为空,它将被删除,但在最终URL中传达不同的含义,如果它存在或不存在。
    在这种情况下,您可以使用 ``safe_conversion``,如果URL只包含ASCII字符且不包含空格,则将返回不变的URL。
    如果没有正确地引用,这可能会导致一个带有未引号字符的URI,但保留了URL的语义。Werkzeug将此用于重定向的“Location”标头。
    版本变更: 0.15  所有保留字符不加引号。以前,只有一些保留字符不加引号。
    版本变更: 0.9.6 增加了``safe_conversion``参数。
    版本增加: 0.6

8 url_join(base: Union[str, Tuple[str, str, str, str, str]], url: Union[str, Tuple[str, str, str, str, str]], allow_fragments: bool = True) -> str

url_join(base: Union[str, Tuple[str, str, str, str, str]], url: Union[str, Tuple[str, str, str, str, str]], allow_fragments: bool = True) -> str, module=werkzeug.urls, line:999 at site-packages\werkzeug\urls.py

将基本URL和可能的相对URL连接起来,形成对后者的绝对解释。
    :param base:    连接操作的基URL。
    :param url:     要加入的url。
    :param allow_fragments: 表示是否允许分片。

9 get_current_url(environ:`WSGIEnvironment’, root_only: bool = False, strip_querystring: bool = False, host_only: bool = False, trusted_hosts: Union[Iterable[str], NoneType] = None) -> str

get_current_url(environ:`WSGIEnvironment’, root_only: bool = False, strip_querystring: bool = False, host_only: bool = False, trusted_hosts: Union[Iterable[str], NoneType] = None) -> str, module=werkzeug.wsgi, line:38 at site-packages\werkzeug\wsgi.py

在WSGI环境中为来自部件的请求重新创建URL。
    URL是IRI,而不是URI,因此它可能包含Unicode字符。
    使用:func:`~werkzeug.urls.iri_to_uri`将其转换为ASCII。
    :param environ:     获取URL部分的WSGI环境。
    :param root_only:   只构建根路径,不包含剩余路径或查询字符串。
    :param strip_querystring:   不包含查询字符串。
    :param host_only:           只构建方案和主机。
    :param trusted_hosts:       要验证主机的可信主机名列表。

10 _get_environ(obj: Union[ForwardRef(‘WSGIEnvironment’), ForwardRef(‘Request’)]) ->`WSGIEnvironment’

_get_environ(obj: Union[ForwardRef(‘WSGIEnvironment’), ForwardRef(‘Request’)]) ->`WSGIEnvironment’, module=werkzeug._internal, line:164 at site-packages\werkzeug_internal.py

11 generate_etag(data: bytes) -> str

generate_etag(data: bytes) -> str, module=werkzeug.http, line:922 at site-packages\werkzeug\http.py

为一些数据生成etag。
    版本变更: 2.0   使用SHA-1。MD5在某些环境中可能不可用。

12 http_date(timestamp: Union[datetime.datetime, datetime.date, int, float, time.struct_time, NoneType] = None) -> str

http_date(timestamp: Union[datetime.datetime, datetime.date, int, float, time.struct_time, NoneType] = None) -> str, module=werkzeug.http, line:960 at site-packages\werkzeug\http.py

将datetime对象或时间戳格式化为:rfc:`2822`日期字符串。
    这是:func:`email.utils.format_datetime` 的包装器。它假设朴素datetime对象是UTC格式的,而不是引发异常。
    :param timestamp:   要格式化的日期时间或时间戳。默认为当前时间。
    版本变更: 2.0        使用``email.utils.format_datetime``。接受“date”对象。

13 is_resource_modified(environ:`WSGIEnvironment’, etag: Union[str, NoneType] = None, data: Union[bytes, NoneType] = None, last_modified: Union[datetime.datetime, str, NoneType] = None, ignore_if_range: bool = True) -> bool

is_resource_modified(environ:`WSGIEnvironment’, etag: Union[str, NoneType] = None, data: Union[bytes, NoneType] = None, last_modified: Union[datetime.datetime, str, NoneType] = None, ignore_if_range: bool = True) -> bool, module=werkzeug.http, line:1034 at site-packages\werkzeug\http.py

条件请求的方便方法。
    :param environ: 要检查的请求的WSGI环境。
    :param etag:    用于比较的响应的etag。
    :param data:    或者使用:func:`generate_etag`自动生成etag的响应数据。
    :param last_modified:   可选的最后修改日期。
    :param ignore_if_range: 如果`False`,`If-Range`头将被考虑。
    :return:`   如果资源被修改,则返回`True`,否则返回`False`。
    版本变更: 2.0   使用SHA-1对数据生成etag值。MD5可能在某些环境中不可用。
    版本变更: 1.0.0 检查除“GET”和“HEAD”之外的方法。

14 parse_etags(value: Union[str, NoneType]) ->`ds.ETags’

parse_etags(value: Union[str, NoneType]) ->`ds.ETags’, module=werkzeug.http, line:893 at site-packages\werkzeug\http.py

解析etag标头。
    :param value: 要解析的头。
    返回:     class:`~werkzeug.datastructures.ETags`对象。

15 parse_range_header(value: Union[str, NoneType], make_inclusive: bool = True) -> Union[ForwardRef(‘ds.Range’), NoneType]

parse_range_header(value: Union[str, NoneType], make_inclusive: bool = True) -> Union[ForwardRef(‘ds.Range’), NoneType], module=werkzeug.http, line:741 at site-packages\werkzeug\http.py

将范围头解析为 :class:`~werkzeug.datastructures.Range` 对象。
    如果标头缺失或格式错误,则返回`None`。`ranges`是一个``(start, stop)``元组的列表,其中的范围是不包含的。
    版本增加: 0.7

16 _warn_if_string(iterable: Iterable) -> None

_warn_if_string(iterable: Iterable) -> None, module=werkzeug.wrappers.response, line:32 at site-packages\werkzeug\wrappers\response.py

帮助器用于检查返回到WSGI服务器的可迭代对象是否为字符串。

17 _iter_encoded(iterable: Iterable[Union[str, bytes]], charset: str) -> Iterator[bytes]

_iter_encoded(iterable: Iterable[Union[str, bytes]], charset: str) -> Iterator[bytes], module=werkzeug.wrappers.response, line:47 at site-packages\werkzeug\wrappers\response.py

18 _clean_accept_ranges(accept_ranges: Union[bool, str]) -> str

_clean_accept_ranges(accept_ranges: Union[bool, str]) -> str, module=werkzeug.wrappers.response, line:57 at site-packages\werkzeug\wrappers\response.py

19 HTTPStatus

HTTPStatus, HTTPStatus, module=http, line:-1 at site-packages\werkzeug\http.py

19 werkzeug.datastructures.Headers

Headers, werkzeug.datastructures.Headers, module=werkzeug.datastructures, line:848 at site-packages\werkzeug\datastructures.py

19 werkzeug.sansio.response.Response

Response, werkzeug.sansio.response.Response, module=werkzeug.sansio.response, line:63 at site-packages\werkzeug\sansio\response.py

表示HTTP响应的非io部分,特别是状态和报头,但不包括正文。
    这个类不适合一般用途。它应该只在实现WSGI, ASGI或其他HTTP应用程序规范时使用。
    :param status:  响应的状态码。可以是int,在这种情况下会添加默认状态消息,或者是``{code} {message}``'形式的字符串,如``404 Not Found``。默认为200。
    :param headers: :class:`~werkzeug.datastructures.Headers`对象,或将被转换为``Headers``对象的``(键,值)``元组列表。
    :param mimetype:    响应的mime类型(不带字符集和其他参数的内容类型)。如果值以``text/``(或匹配一些其他特殊情况)开头,字符集将被添加以创建``content_type``。
    :param content_type:    响应的完整内容类型。覆盖从``mime``'构建值。
    版本增加: 2.0

data

1 accept_ranges= kind:data type:header_property class:werkzeug.sansio.response.Response'> 2 access_control_allow_headers= kind:data type:header_property class:werkzeug.sansio.response.Response’>
3 access_control_allow_methods= kind:data type:header_property class:werkzeug.sansio.response.Response'> 4 access_control_allow_origin= kind:data type:header_property class:werkzeug.sansio.response.Response’>
5 access_control_expose_headers= kind:data type:header_property class:werkzeug.sansio.response.Response'> 6 access_control_max_age= kind:data type:header_property class:werkzeug.sansio.response.Response’>
7 age= kind:data type:header_property class:werkzeug.sansio.response.Response'> 8 charset=utf-8 kind:data type:str class:werkzeug.sansio.response.Response’>
9 content_encoding= kind:data type:header_property class:werkzeug.sansio.response.Response'> 10 content_length= kind:data type:header_property class:werkzeug.sansio.response.Response’>
11 content_location= kind:data type:header_property class:werkzeug.sansio.response.Response'> 12 content_md5= kind:data type:header_property class:werkzeug.sansio.response.Response’>
13 content_type= kind:data type:header_property class:werkzeug.sansio.response.Response'> 14 cross_origin_embedder_policy= kind:data type:header_property class:werkzeug.sansio.response.Response’>
15 cross_origin_opener_policy= kind:data type:header_property class:werkzeug.sansio.response.Response'> 16 date= kind:data type:header_property class:werkzeug.sansio.response.Response’>
17 default_mimetype=text/plain kind:data type:str class:werkzeug.sansio.response.Response'> 18 default_status=200 kind:data type:int class:werkzeug.sansio.response.Response’>
19 expires= kind:data type:header_property class:werkzeug.sansio.response.Response'> 20 last_modified= kind:data type:header_property class:werkzeug.sansio.response.Response’>
21 location= kind:data type:header_property class:werkzeug.sansio.response.Response'> 22 max_cookie_size=4093 kind:data type:int class:werkzeug.sansio.response.Response’>

property

23 access_control_allow_credentials= kind:property type:property class:werkzeug.sansio.response.Response'> 24 allow= kind:property type:property class:werkzeug.sansio.response.Response’>
25 cache_control= kind:property type:property class:werkzeug.sansio.response.Response'> 26 content_language= kind:property type:property class:werkzeug.sansio.response.Response’>
27 content_range= kind:property type:property class:werkzeug.sansio.response.Response'> 28 content_security_policy= kind:property type:property class:werkzeug.sansio.response.Response’>
29 content_security_policy_report_only= kind:property type:property class:werkzeug.sansio.response.Response'> 30 is_json= kind:property type:property class:werkzeug.sansio.response.Response’>
31 mimetype= kind:property type:property class:werkzeug.sansio.response.Response'> 32 mimetype_params= kind:property type:property class:werkzeug.sansio.response.Response’>
33 retry_after= kind:property type:property class:werkzeug.sansio.response.Response'> 34 status= kind:property type:property class:werkzeug.sansio.response.Response’>
35 status_code= kind:property type:property class:werkzeug.sansio.response.Response'> 36 vary= kind:property type:property class:werkzeug.sansio.response.Response’>
37 www_authenticate= kind:property type:property class:

method

38 delete_cookie(

kind=method class=Response objtype=function line:245 at …\lib\site-packages\werkzeug\sansio\response.py

删除cookie。如果key不存在,则静默失败。
    :param key:         要删除的cookie的密钥(名称)。
    :param path:        如果要删除的cookie仅限于路径,则必须在此处定义路径。
    :param domain:      如果要删除的cookie仅限于一个域,则必须在此处定义该域。
    :param secure:      如果``True``, cookie将只通过HTTPS可用。
    :param httponly:    禁止JavaScript访问cookie。
    :param samesite:    将cookie的范围限制为仅附加到“同一站点”的请求。

39 get_etag(self) -> t.Union[t.Tuple[str, bool], t.Tuple[None, None]]:

kind=method class=Response objtype=function line:504 at …\lib\site-packages\werkzeug\sansio\response.py

返回一个形式为``(etag, is_weak)``的元组。如果没有ETag,返回值为``(None, None)``。

40 set_cookie(

kind=method class=Response objtype=function line:192 at …\lib\site-packages\werkzeug\sansio\response.py

设置cookie。
    如果cookie头的大小超过:attr:`max_cookie_size`,则会引发警告,但头仍将被设置。
    :param key:         要设置的cookie的密钥(名称)。
    :param value:       cookie的值。
    :param max_age:     应该是秒数,如果cookie应该只持续客户端浏览器会话的时间,则为`None`(默认)。
    :param expires:     应该是一个`datetime`对象或UNIX时间戳。
    param path:         将cookie限制为给定的路径,默认情况下它将跨越整个域。
    :param domain:      设置跨域cookie。例如,``domain=".example.com"``'将设置一个cookie,该cookie可由域名``www.example.com``,
                        ``foo.example.com``等读取。否则,cookie只能被设置它的域读取。
    :param secure:      如果``True``, cookie将只通过HTTPS可用。
    :param httponly:    禁止JavaScript访问cookie。
    :param samesite:    将cookie的范围限制为仅附加到"same-site"的请求。

41 set_etag(self, etag: str, weak: bool = False) -> None:

kind=method class=Response objtype=function line:500 at …\lib\site-packages\werkzeug\sansio\response.py

设置etag,如果有,则覆盖旧的etag。

20 werkzeug.utils.cached_property

cached_property, werkzeug.utils.cached_property, module=werkzeug.utils, line:49 at site-packages\werkzeug\utils.py

20 werkzeug.wsgi.ClosingIterator

ClosingIterator, werkzeug.wsgi.ClosingIterator, module=werkzeug.wsgi, line:454 at site-packages\werkzeug\wsgi.py

WSGI规范要求所有中间件和网关尊重应用程序返回的可迭代对象的“close”回调。
    因为在返回的可迭代对象中添加另一个close操作是有用的,而添加自定义可迭代对象是一项无聊的任务,
    所以这个类可以用于:
        return ClosingIterator(app(environ, start_response), [cleanup_session, cleanup_locals])
    如果只有一个close函数,它可以传递而不是传递列表。
    如果应用程序使用响应对象并在响应开始时完成处理,则不需要关闭迭代器:
        try:
            return response(environ, start_response)
        finally:
            cleanup_session()
            cleanup_locals()

method

1 close(self) -> None:

kind=method class=ClosingIterator objtype=function line:502 at …\lib\site-packages\werkzeug\wsgi.py

21 werkzeug.wsgi._RangeWrapper

_RangeWrapper, werkzeug.wsgi._RangeWrapper, module=werkzeug.wsgi, line:582 at site-packages\werkzeug\wsgi.py

该类可用于将可迭代对象转换为只生成一部分底层内容的可迭代对象。
    它产生块,直到底层流范围被完全读取。
    生成的块的大小不能超过初始迭代器定义的块大小,但可以更小。
    如果你将这个对象与:class:`Response`一起使用,你必须使用`direct_passthrough`模式。
    :param iterable:    一个具有:meth:`next`方法的可迭代对象。
    :param start_byte:  读取将从哪个字节开始。
    :param byte_range:  读取多少字节。

method

1 close(self) -> None:

kind=method class=_RangeWrapper objtype=function line:664 at …\lib\site-packages\werkzeug\wsgi.py

22 werkzeug.wrappers.response.Response

Response, werkzeug.wrappers.response.Response, module=werkzeug.wrappers.response, line:67 at site-packages\werkzeug\wrappers\response.py

22 werkzeug.wrappers.response.ResponseStream

ResponseStream, werkzeug.wrappers.response.ResponseStream, module=werkzeug.wrappers.response, line:843 at site-packages\werkzeug\wrappers\response.py

一个类似于:meth:`Response.Stream``使用的对象的文件描述符来表示流的主体。它直接推入响应对象的响应可迭代对象。

data

1 mode=wb+ kind:data type:str class:

property

2 encoding= kind:property type:property class:

method

3 close(self) -> None:

kind=method class=ResponseStream objtype=function line:867 at …\lib\site-packages\werkzeug\wrappers\response.py

4 flush(self) -> None:

kind=method class=ResponseStream objtype=function line:870 at …\lib\site-packages\werkzeug\wrappers\response.py

5 isatty(self) -> bool:

kind=method class=ResponseStream objtype=function line:874 at …\lib\site-packages\werkzeug\wrappers\response.py

6 tell(self) -> int:

kind=method class=ResponseStream objtype=function line:879 at …\lib\site-packages\werkzeug\wrappers\response.py

7 write(self, value: bytes) -> int:

kind=method class=ResponseStream objtype=function line:855 at …\lib\site-packages\werkzeug\wrappers\response.py

8 writelines(self, seq: t.Iterable[bytes]) -> None:

kind=method class=ResponseStream objtype=function line:863 at …\lib\site-packages\werkzeug\wrappers\response.py

私有或局部

23 _to_bytes
24 _SansIOResponse werkzeug.sansio.response.Response'> 25 _get_environ 26 _RangeWrapper werkzeug.wsgi._RangeWrapper’>
27 _warn_if_string
28 _iter_encoded
29 _clean_accept_ranges

☘️【werkzeug._internal】

_internal, fullname=werkzeug._internal, file=werkzeug_internal.py

☘️【werkzeug.exceptions】

exceptions, fullname=werkzeug.exceptions, file=werkzeug\exceptions.py

☘️【werkzeug.urls】

urls, fullname=werkzeug.urls, file=werkzeug\urls.py

☘️【werkzeug.serving】

serving, fullname=werkzeug.serving, file=werkzeug\serving.py

☘️【werkzeug.sansio】

sansio, fullname=werkzeug.sansio, file=werkzeug\sansio_init_.py

☘️【werkzeug.http】

http, fullname=werkzeug.http, file=werkzeug\http.py

☘️【werkzeug.datastructures】

datastructures, fullname=werkzeug.datastructures, file=werkzeug\datastructures.py

☘️【werkzeug.security】

security, fullname=werkzeug.security, file=werkzeug\security.py

☘️【werkzeug.wsgi】

wsgi, fullname=werkzeug.wsgi, file=werkzeug\wsgi.py

☘️【werkzeug.utils】

utils, fullname=werkzeug.utils, file=werkzeug\utils.py

☘️【werkzeug.formparser】

formparser, fullname=werkzeug.formparser, file=werkzeug\formparser.py

☘️【werkzeug.user_agent】

user_agent, fullname=werkzeug.user_agent, file=werkzeug\user_agent.py

☘️【werkzeug.wrappers】

wrappers, fullname=werkzeug.wrappers, file=werkzeug\wrappers_init_.py

☘️【werkzeug.test】

test, fullname=werkzeug.test, file=werkzeug\test.py

☘️【werkzeug.sansio.http】

http, fullname=werkzeug.sansio.http, file=werkzeug\sansio\http.py

☘️【werkzeug.sansio.multipart】

multipart, fullname=werkzeug.sansio.multipart, file=werkzeug\sansio\multipart.py

☘️【werkzeug.sansio.utils】

utils, fullname=werkzeug.sansio.utils, file=werkzeug\sansio\utils.py

☘️【logging】

logging, fullname=logging, file=logging_init_.py

☘️【operator】

operator, fullname=operator, file=operator.py

☘️【re】

re, fullname=re, file=re.py

☘️【string】

string, fullname=string, file=string.py

☘️【sys】

sys, fullname=sys, file=

☘️【typing】

typing, fullname=typing, file=typing.py

☘️【codecs】

codecs, fullname=codecs, file=codecs.py

☘️【os】

os, fullname=os, file=os.py

☘️【errno】

errno, fullname=errno, file=

☘️【io】

io, fullname=io, file=io.py

☘️【socket】

socket, fullname=socket, file=socket.py

☘️【socketserver】

socketserver, fullname=socketserver, file=socketserver.py

☘️【ssl】

ssl, fullname=ssl, file=ssl.py

☘️【base64】

base64, fullname=base64, file=base64.py

☘️【email】

email, fullname=email, file=email_init_.py

☘️【warnings】

warnings, fullname=warnings, file=warnings.py

☘️【mimetypes】

mimetypes, fullname=mimetypes, file=mimetypes.py

☘️【hashlib】

hashlib, fullname=hashlib, file=hashlib.py

☘️【hmac】

hmac, fullname=hmac, file=hmac.py

☘️【posixpath】

posixpath, fullname=posixpath, file=posixpath.py

☘️【secrets】

secrets, fullname=secrets, file=secrets.py

☘️【pkgutil】

pkgutil, fullname=pkgutil, file=pkgutil.py

☘️【unicodedata】

unicodedata, fullname=unicodedata, file=unicodedata.pyd

☘️【functools】

functools, fullname=functools, file=functools.py

☘️【json】

json, fullname=json, file=json_init_.py

你可能感兴趣的:(python模块一图看懂,笔记,python,pycharm,开发语言,信息可视化)