一图看懂 idna 模块:国际化域名应用(Internationalized Domain Names in Applications), 资料整理+笔记(大全)

一图看懂 idna 模块:国际化域名应用(Internationalized Domain Names in Applications), 资料整理+笔记(大全)全文介绍系统内置 idna 模块 函数 类及类的方法和属性

大家好,欢迎来到IT知识分享网。

Alt
@[TOC](一图看懂 idna 模块:国际化域名应用(Internationalized Domain Names in Applications), 资料整理+笔记(大全))

摘要

模块图

idna-mod

idna idna.package_data idna.idnadata idna.intranges ◆bisect idna.core ◆unicodedata 

类关系图

idna-class

◆object ◆BaseException ◆Exception ◆ValueError ◆UnicodeError idna.core.IDNAError idna.core.IDNABidiError idna.core.InvalidCodepoint idna.core.InvalidCodepointContext ◆unicodedata.UCD 

模块全展开

【idna】

idna, fullname=idna, file=idna_init_.py

该模块实现了 RFCs 3490 (IDNA) 和3491 (Nameprep) 

统计

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

常量

模块

1 idna.package_data

package_data, fullname=idna.package_data, file=idna\package_data.py

2 idna.idnadata

idnadata, fullname=idna.idnadata, file=idna\idnadata.py

3 idna.intranges

intranges, fullname=idna.intranges, file=idna\intranges.py

给定一个整数列表,由(希望)少量连续整数的长周期运行组成,计算形式为((start1, end1), (start2, end2) ...)的表示形式。 然后在时间0(log(# runs))内回答问题“x是否出现在原始列表中?” 

4 idna.core

core, fullname=idna.core, file=idna\core.py

函数

5 alabel(label: str) -> bytes

alabel(label: str) -> bytes, module=idna.core, line:255 at site-packages\idna\core.py

6 check_bidi(label: str, check_ltr: bool = False) -> bool

check_bidi(label: str, check_ltr: bool = False) -> bool, module=idna.core, line:61 at site-packages\idna\core.py

7 check_hyphen_ok(label: str) -> bool

check_hyphen_ok(label: str) -> bool, module=idna.core, line:126 at site-packages\idna\core.py

8 check_initial_combiner(label: str) -> bool

check_initial_combiner(label: str) -> bool, module=idna.core, line:120 at site-packages\idna\core.py

9 check_label(label: Union[str, bytes, bytearray]) -> None

check_label(label: Union[str, bytes, bytearray]) -> None, module=idna.core, line:224 at site-packages\idna\core.py

10 check_nfc(label: str) -> None

check_nfc(label: str) -> None, module=idna.core, line:134 at site-packages\idna\core.py

11 decode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool = False, std3_rules: bool = False) -> str

decode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool = False, std3_rules: bool = False) -> str, module=idna.core, line:373 at site-packages\idna\core.py

12 encode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool = False, std3_rules: bool = False, transitional: bool = False) -> bytes

encode(s: Union[str, bytes, bytearray], strict: bool = False, uts46: bool = False, std3_rules: bool = False, transitional: bool = False) -> bytes, module=idna.core, line:340 at site-packages\idna\core.py

13 ulabel(label: Union[str, bytes, bytearray]) -> str

ulabel(label: Union[str, bytes, bytearray]) -> str, module=idna.core, line:279 at site-packages\idna\core.py

14 uts46_remap(domain: str, std3_rules: bool = True, transitional: bool = False) -> str

uts46_remap(domain: str, std3_rules: bool = True, transitional: bool = False) -> str, module=idna.core, line:308 at site-packages\idna\core.py

根据UTS46处理重新映射字符串中的字符。 

15 valid_contextj(label: str, pos: int) -> bool

valid_contextj(label: str, pos: int) -> bool, module=idna.core, line:139 at site-packages\idna\core.py

16 valid_contexto(label: str, pos: int, exception: bool = False) -> bool

valid_contexto(label: str, pos: int, exception: bool = False) -> bool, module=idna.core, line:182 at site-packages\idna\core.py

17 valid_label_length(label: Union[bytes, str]) -> bool

valid_label_length(label: Union[bytes, str]) -> bool, module=idna.core, line:49 at site-packages\idna\core.py

18 valid_string_length(label: Union[bytes, str], trailing_dot: bool) -> bool

valid_string_length(label: Union[bytes, str], trailing_dot: bool) -> bool, module=idna.core, line:55 at site-packages\idna\core.py

19 intranges_contain(int_: int, ranges: Tuple[int, …]) -> bool

intranges_contain(int_: int, ranges: Tuple[int, …]) -> bool, module=idna.intranges, line:39 at site-packages\idna\intranges.py

确定' int '是否属于' ranges '中的一个范围。 

20 idna.core.IDNABidiError

IDNABidiError, idna.core.IDNABidiError, module=idna.core, line:17 at site-packages\idna\core.py

当双向(bidirectional)需求不被满足时异常 

21 idna.core.IDNAError

IDNAError, idna.core.IDNAError, module=idna.core, line:12 at site-packages\idna\core.py

所有idna编码相关问题的基本异常 

22 idna.core.InvalidCodepoint

InvalidCodepoint, idna.core.InvalidCodepoint, module=idna.core, line:22 at site-packages\idna\core.py

在使用不允许的或未分配的代码点时异常 

23 idna.core.InvalidCodepointContext

InvalidCodepointContext, idna.core.InvalidCodepointContext, module=idna.core, line:27 at site-packages\idna\core.py

当代码点在使用它的上下文中无效时,将异常 

【idna.package_data】

package_data, fullname=idna.package_data, file=idna\package_data.py

【idna.idnadata】

idnadata, fullname=idna.idnadata, file=idna\idnadata.py

【idna.intranges】

intranges, fullname=idna.intranges, file=idna\intranges.py

【idna.core】

core, fullname=idna.core, file=idna\core.py

【bisect】

bisect, fullname=bisect, file=bisect.py

二分算法。(Bisection algorithms) 

统计

序号 类别 数量
4 str 5
8 dict 1
12 builtin_function_or_method 6
13 residual 2
14 system 8
16 all 14

常量

内嵌函数或方法

【unicodedata】

unicodedata, fullname=unicodedata, file=unicodedata.pyd

此模块提供对Unicode字符数据库的访问,该数据库定义了所有Unicode字符的字符属性。 此数据库中的数据基于[UnicodeData.txt文件](ftp://ftp.unicode.org/)11.0.0版本,该文件可从ftp://ftp.unicode.org/公开获取。 该模块使用与UnicodeData文件格式11.0.0定义的相同的名称和符号。 

统计

序号 类别 数量
4 str 5
10 class 1
12 builtin_function_or_method 12
13 residual 4
14 system 6
16 all 22

常量

str

1 unidata_version 11.0.0

2 unicodedata.UCD

UCD, unicodedata.UCD, module=unicodedata

data

1 unidata_version=<member ‘unidata_version’ of ‘unicodedata.UCD’ objects> kind:data type:member_descriptor class:<class ‘unicodedata.UCD’>

method
2 bidirectional()

kind=method class=UCD objtype=method_descriptor

返回分配给字符chr的双向类作为字符串。如果没有定义这样的值,则返回一个空字符串。 
3 category()

kind=method class=UCD objtype=method_descriptor

返回分配给字符chr的一般类别作为字符串。 
4 combining()

kind=method class=UCD objtype=method_descriptor

将分配给字符chr的正则组合类返回为整数。如果没有定义组合类,则返回0。 
5 decimal()

kind=method class=UCD objtype=method_descriptor

将Unicode字符转换为其等效的十进制值。 返回分配给字符chr的十进制值作为整数。 如果没有定义这样的值,则返回default,或者,如果没有给出,则引发ValueError。 
6 decomposition()

kind=method class=UCD objtype=method_descriptor

返回分配给字符chr的字符分解映射作为字符串。 如果没有定义这样的映射,则返回空字符串。 
7 digit()

kind=method class=UCD objtype=method_descriptor

将Unicode字符转换为其等效的数字值。 将分配给字符chr的数字值作为整数返回。 如果没有定义这样的值,则返回default,或者,如果没有给出,则引发ValueError。 
8 east_asian_width()

kind=method class=UCD objtype=method_descriptor

返回分配给字符chr的东亚宽度作为字符串。 
9 lookup()

kind=method class=UCD objtype=method_descriptor

按名字查找角色。 如果找到具有给定名称的字符,则返回相应的字符。 如果未找到,则引发KeyError。 
10 mirrored()

kind=method class=UCD objtype=method_descriptor

将分配给字符chr的镜像属性返回为整数。 如果字符在双向文本中被识别为“镜像”字符,则返回1,否则返回0。 
11 name()

kind=method class=UCD objtype=method_descriptor

以字符串形式返回分配给字符chr的名称。 如果没有定义名称,则返回default,如果没有给出,则引发ValueError。 
12 normalize()

kind=method class=UCD objtype=method_descriptor

返回Unicode字符串unistr的标准形式'form'。 form的有效值为'NFC', 'NFKC', 'NFD'和'NFKD'。 
13 numeric()

kind=method class=UCD objtype=method_descriptor

将Unicode字符转换为其等效的数值。 返回分配给字符chr的数值为float。 如果没有定义这样的值,则返回default,或者,如果没有给出,则引发ValueError。 

内嵌函数或方法

剩余

15 loader <_frozen_importlib_external.ExtensionFileLoader object at 0x0000025011E26A08>
16 spec ModuleSpec(name=‘unicodedata’, loader=<_frozen_importlib_external.ExtensionFileLoader object at 0x0000025011E26A08>, origin=‘…\DLLs\unicodedata.pyd’)
17 ucd_3_2_0 <unicodedata.UCD object at 0x0000025011E20B70>
18 ucnhash_CAPI <capsule object “unicodedata.ucnhash_CAPI” at 0x0000025011E20B40>


【re】

re, fullname=re, file=re.py

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://haidsoft.com/131223.html

(0)
上一篇 2025-08-09 17:00
下一篇 2025-08-09 17:15

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注微信