@@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
27
27
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
28
.in \\n[ rst2man-indent\\n[ rst2man-indent-level ] ]u
29
29
..
30
- .TH "VALIDATORS" "1" "Jun 17 , 2024" "0.28.3 " "validators"
30
+ .TH "VALIDATORS" "1" "Sep 03 , 2024" "0.33.0 " "validators"
31
31
.SH NAME
32
32
validators \- Python Data Validation for Humans™
33
33
.sp
@@ -215,39 +215,6 @@ If neither \fImin_val\fP nor \fImax_val\fP is provided, result will always be \f
215
215
.UNINDENT
216
216
.UNINDENT
217
217
.UNINDENT
218
- .SS btc_address
219
- .INDENT 0.0
220
- .TP
221
- .B validators.btc_address.btc_address(value: str, /)
222
- Return whether or not given value is a valid bitcoin address.
223
- .sp
224
- Full validation is implemented for P2PKH and P2SH addresses.
225
- For segwit addresses a regexp is used to provide a reasonable
226
- estimate on whether the address is valid.
227
- .sp
228
- Examples
229
- .sp
230
- .nf
231
- .ft C
232
- >>> btc_address(\(aq 3Cwgr2g7vsi1bXDUkpEnVoRLA9w4FZfC69\(aq )
233
- # Output: True
234
- >>> btc_address(\(aq 1BvBMsEYstWetqTFn5Au4m4GFg7xJaNVN2\(aq )
235
- # Output: ValidationError(func=btc_address, args=...)
236
- .ft P
237
- .fi
238
- .INDENT 7.0
239
- .TP
240
- .B Parameters
241
- \fB value \fP \-\- Bitcoin address string to validate.
242
- .TP
243
- .B Returns
244
- If \fI value \fP is a valid bitcoin address.
245
- (ValidationError): If \fI value \fP is an invalid bitcoin address.
246
- .TP
247
- .B Return type
248
- (Literal[True])
249
- .UNINDENT
250
- .UNINDENT
251
218
.SS card
252
219
.INDENT 0.0
253
220
.TP
@@ -622,6 +589,129 @@ If \fIvalue\fP is a valid cron string.
622
589
(Literal[True])
623
590
.UNINDENT
624
591
.UNINDENT
592
+ .SS crypto_addresses
593
+ .INDENT 0.0
594
+ .TP
595
+ .B validators.crypto_addresses.bsc_address(value: str, /)
596
+ Return whether or not given value is a valid binance smart chain address.
597
+ .sp
598
+ Full validation is implemented for BSC addresses.
599
+ .sp
600
+ Examples
601
+ .sp
602
+ .nf
603
+ .ft C
604
+ >>> bsc_address(\(aq 0x4e5acf9684652BEa56F2f01b7101a225Ee33d23f\(aq )
605
+ # Output: True
606
+ >>> bsc_address(\(aq 0x4g5acf9684652BEa56F2f01b7101a225Eh33d23z\(aq )
607
+ # Output: ValidationError(func=bsc_address, args=...)
608
+ .ft P
609
+ .fi
610
+ .INDENT 7.0
611
+ .TP
612
+ .B Parameters
613
+ \fB value \fP \-\- BSC address string to validate.
614
+ .TP
615
+ .B Returns
616
+ If \fI value \fP is a valid bsc address.
617
+ (ValidationError): If \fI value \fP is an invalid bsc address.
618
+ .TP
619
+ .B Return type
620
+ (Literal[True])
621
+ .UNINDENT
622
+ .UNINDENT
623
+ .INDENT 0.0
624
+ .TP
625
+ .B validators.crypto_addresses.btc_address(value: str, /)
626
+ Return whether or not given value is a valid bitcoin address.
627
+ .sp
628
+ Full validation is implemented for P2PKH and P2SH addresses.
629
+ For segwit addresses a regexp is used to provide a reasonable
630
+ estimate on whether the address is valid.
631
+ .sp
632
+ Examples
633
+ .sp
634
+ .nf
635
+ .ft C
636
+ >>> btc_address(\(aq 3Cwgr2g7vsi1bXDUkpEnVoRLA9w4FZfC69\(aq )
637
+ # Output: True
638
+ >>> btc_address(\(aq 1BvBMsEYstWetqTFn5Au4m4GFg7xJaNVN2\(aq )
639
+ # Output: ValidationError(func=btc_address, args=...)
640
+ .ft P
641
+ .fi
642
+ .INDENT 7.0
643
+ .TP
644
+ .B Parameters
645
+ \fB value \fP \-\- Bitcoin address string to validate.
646
+ .TP
647
+ .B Returns
648
+ If \fI value \fP is a valid bitcoin address.
649
+ (ValidationError): If \fI value \fP is an invalid bitcoin address.
650
+ .TP
651
+ .B Return type
652
+ (Literal[True])
653
+ .UNINDENT
654
+ .UNINDENT
655
+ .INDENT 0.0
656
+ .TP
657
+ .B validators.crypto_addresses.eth_address(value: str, /)
658
+ Return whether or not given value is a valid ethereum address.
659
+ .sp
660
+ Full validation is implemented for ERC20 addresses.
661
+ .sp
662
+ Examples
663
+ .sp
664
+ .nf
665
+ .ft C
666
+ >>> eth_address(\(aq 0x9cc14ba4f9f68ca159ea4ebf2c292a808aaeb598\(aq )
667
+ # Output: True
668
+ >>> eth_address(\(aq 0x8Ba1f109551bD432803012645Ac136ddd64DBa72\(aq )
669
+ # Output: ValidationError(func=eth_address, args=...)
670
+ .ft P
671
+ .fi
672
+ .INDENT 7.0
673
+ .TP
674
+ .B Parameters
675
+ \fB value \fP \-\- Ethereum address string to validate.
676
+ .TP
677
+ .B Returns
678
+ If \fI value \fP is a valid ethereum address.
679
+ (ValidationError): If \fI value \fP is an invalid ethereum address.
680
+ .TP
681
+ .B Return type
682
+ (Literal[True])
683
+ .UNINDENT
684
+ .UNINDENT
685
+ .INDENT 0.0
686
+ .TP
687
+ .B validators.crypto_addresses.trx_address(value: str, /)
688
+ Return whether or not given value is a valid tron address.
689
+ .sp
690
+ Full validation is implemented for TRC20 tron addresses.
691
+ .sp
692
+ Examples
693
+ .sp
694
+ .nf
695
+ .ft C
696
+ >>> trx_address(\(aq TLjfbTbpZYDQ4EoA4N5CLNgGjfbF8ZWz38\(aq )
697
+ # Output: True
698
+ >>> trx_address(\(aq TR2G7Rm4vFqF8EpY4U5xdLdQ7XgJ2U8Vd\(aq )
699
+ # Output: ValidationError(func=trx_address, args=...)
700
+ .ft P
701
+ .fi
702
+ .INDENT 7.0
703
+ .TP
704
+ .B Parameters
705
+ \fB value \fP \-\- Tron address string to validate.
706
+ .TP
707
+ .B Returns
708
+ If \fI value \fP is a valid tron address.
709
+ (ValidationError): If \fI value \fP is an invalid tron address.
710
+ .TP
711
+ .B Return type
712
+ (Literal[True])
713
+ .UNINDENT
714
+ .UNINDENT
625
715
.SS domain
626
716
.INDENT 0.0
627
717
.TP
@@ -724,6 +814,62 @@ If \fIvalue\fP is a valid eMail.
724
814
.SS encoding
725
815
.INDENT 0.0
726
816
.TP
817
+ .B validators.encoding.base16(value: str, /)
818
+ Return whether or not given value is a valid base16 encoding.
819
+ .sp
820
+ Examples
821
+ .sp
822
+ .nf
823
+ .ft C
824
+ >>> base16(\(aq a3f4b2\(aq )
825
+ # Output: True
826
+ >>> base16(\(aq a3f4Z1\(aq )
827
+ # Output: ValidationError(func=base16, args={\(aq value\(aq : \(aq a3f4Z1\(aq })
828
+ .ft P
829
+ .fi
830
+ .INDENT 7.0
831
+ .TP
832
+ .B Parameters
833
+ \fB value \fP \-\- base16 string to validate.
834
+ .TP
835
+ .B Returns
836
+ If \fI value \fP is a valid base16 encoding.
837
+ (ValidationError): If \fI value \fP is an invalid base16 encoding.
838
+ .TP
839
+ .B Return type
840
+ (Literal[True])
841
+ .UNINDENT
842
+ .UNINDENT
843
+ .INDENT 0.0
844
+ .TP
845
+ .B validators.encoding.base32(value: str, /)
846
+ Return whether or not given value is a valid base32 encoding.
847
+ .sp
848
+ Examples
849
+ .sp
850
+ .nf
851
+ .ft C
852
+ >>> base32(\(aq MFZWIZLTOQ======\(aq )
853
+ # Output: True
854
+ >>> base32(\(aq MfZW3zLT9Q======\(aq )
855
+ # Output: ValidationError(func=base32, args={\(aq value\(aq : \(aq MfZW3zLT9Q======\(aq })
856
+ .ft P
857
+ .fi
858
+ .INDENT 7.0
859
+ .TP
860
+ .B Parameters
861
+ \fB value \fP \-\- base32 string to validate.
862
+ .TP
863
+ .B Returns
864
+ If \fI value \fP is a valid base32 encoding.
865
+ (ValidationError): If \fI value \fP is an invalid base32 encoding.
866
+ .TP
867
+ .B Return type
868
+ (Literal[True])
869
+ .UNINDENT
870
+ .UNINDENT
871
+ .INDENT 0.0
872
+ .TP
727
873
.B validators.encoding.base58(value: str, /)
728
874
Return whether or not given value is a valid base58 encoding.
729
875
.sp
@@ -990,6 +1136,37 @@ If \fIvalue\fP is a valid SHA256 hash.
990
1136
.UNINDENT
991
1137
.INDENT 0.0
992
1138
.TP
1139
+ .B validators.hashes.sha384(value: str, /)
1140
+ Return whether or not given value is a valid SHA384 hash.
1141
+ .sp
1142
+ Examples
1143
+ .sp
1144
+ .nf
1145
+ .ft C
1146
+ >>> sha384(
1147
+ \& ... \(aq cb00753f45a35e8bb5a03d699ac65007272c32ab0eded163\(aq
1148
+ \& ... \(aq 1a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7\(aq
1149
+ \& ... )
1150
+ # Output: True
1151
+ >>> sha384(\(aq 900zz11\(aq )
1152
+ # Output: ValidationError(func=sha384, args={\(aq value\(aq : \(aq 900zz11\(aq })
1153
+ .ft P
1154
+ .fi
1155
+ .INDENT 7.0
1156
+ .TP
1157
+ .B Parameters
1158
+ \fB value \fP \-\- SHA384 string to validate.
1159
+ .TP
1160
+ .B Returns
1161
+ If \fI value \fP is a valid SHA384 hash.
1162
+ (ValidationError): If \fI value \fP is an invalid SHA384 hash.
1163
+ .TP
1164
+ .B Return type
1165
+ (Literal[True])
1166
+ .UNINDENT
1167
+ .UNINDENT
1168
+ .INDENT 0.0
1169
+ .TP
993
1170
.B validators.hashes.sha512(value: str, /)
994
1171
Return whether or not given value is a valid SHA512 hash.
995
1172
.sp
0 commit comments