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

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

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

摘要

全文介绍系统内置 idna 模块、函数、类及类的方法和属性。
它通过代码抓取并经AI智能翻译和人工校对。
是一部不可多得的权威字典类工具书。它是系列集的一部分。后续陆续发布、敬请关注。【原创:AhcaoZhu大侠】

模块图

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)

统计

序号类别数量
4str5
6list2
8dict1
9module4
10class4
11function15
13residual3
14system11
16all34

常量

模块

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)

统计

序号类别数量
4str5
8dict1
12builtin_function_or_method6
13residual2
14system8
16all14

常量

内嵌函数或方法

1 insort_right
2 bisect_right
3 insort_left
4 bisect_left
5 bisect
6 insort

【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定义的相同的名称和符号。

统计

序号类别数量
4str5
10class1
12builtin_function_or_method12
13residual4
14system6
16all22

常量

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。

内嵌函数或方法

3 decimal
4 digit
5 numeric
6 category
7 bidirectional
8 combining
9 mirrored
10 east_asian_width
11 decomposition
12 name
13 lookup
14 normalize

剩余

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

  • 12
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 8
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AhcaoZhu

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值