File tree Expand file tree Collapse file tree 6 files changed +153
-55
lines changed
Expand file tree Collapse file tree 6 files changed +153
-55
lines changed Original file line number Diff line number Diff line change 11include README.md
22include images/logo.png
33graft tests
4- recursive-include src *.h
4+ recursive-include src *.h *.cpp
5+ recursive-include pydomainextractor *.py *.pyi
Original file line number Diff line number Diff line change 1+ import typing
2+ import pydomainextractor .extractor
3+
4+
5+ class DomainExtractor :
6+ '''
7+ PyDomainExtractor is a highly optimized Domain Name Extraction library written in C++
8+ '''
9+ engine : typing .Optional [pydomainextractor .extractor .DomainExtractor ] = None
10+
11+ def __new__ (
12+ cls ,
13+ suffix_list_data : typing .Optional [str ] = None ,
14+ ):
15+ if suffix_list_data is None :
16+ if DomainExtractor .engine is None :
17+ DomainExtractor .engine = pydomainextractor .extractor .DomainExtractor ()
18+
19+ return DomainExtractor .engine
20+ else :
21+ return pydomainextractor .extractor .DomainExtractor (suffix_list_data )
Original file line number Diff line number Diff line change 1+ import typing
2+
3+
4+ class DomainExtractor :
5+ def __init__ (
6+ self ,
7+ suffix_list_data : typing .Optional [str ] = None ,
8+ ) -> None : ...
9+
10+ def extract (
11+ self ,
12+ domain : str ,
13+ ) -> typing .dict [str , str ]: ...
14+
15+ def extract_from_url (
16+ self ,
17+ url : str ,
18+ ) -> typing .dict [str , str ]: ...
19+
20+ def is_valid_domain (
21+ self ,
22+ domain : str ,
23+ ) -> bool : ...
24+
25+ def get_tld_list (
26+ self ,
27+ ) -> typing .List [str ]: ...
Original file line number Diff line number Diff line change 55
66setuptools .setup (
77 name = 'PyDomainExtractor' ,
8- version = '0.8.5 ' ,
8+ version = '0.9.0 ' ,
99 author = 'Gal Ben David' ,
10101111 url = 'https://github.com/Intsights/PyDomainExtractor' ,
2929 install_requires = [],
3030 package_data = {},
3131 include_package_data = True ,
32+ packages = setuptools .find_packages (),
33+ ext_package = 'pydomainextractor' ,
3234 ext_modules = [
3335 setuptools .Extension (
34- name = 'pydomainextractor ' ,
36+ name = 'extractor ' ,
3537 sources = glob .glob (
3638 pathname = os .path .join (
3739 'src' ,
38- 'pydomainextractor .cpp' ,
40+ 'extractor .cpp' ,
3941 ),
4042 ),
4143 language = 'c++' ,
Original file line number Diff line number Diff line change @@ -560,23 +560,23 @@ static PyTypeObject DomainExtractorType = {
560560};
561561
562562
563- static struct PyModuleDef pydomainextractor_definition = {
563+ static struct PyModuleDef extractor_definition = {
564564 PyModuleDef_HEAD_INIT,
565- " pydomainextractor " ,
565+ " extractor " ,
566566 " Extracting domain strings into their parts" ,
567567 -1 ,
568568 NULL ,
569569};
570570
571571
572572PyMODINIT_FUNC
573- PyInit_pydomainextractor (void ) {
573+ PyInit_extractor (void ) {
574574 PyObject *m;
575575 if (PyType_Ready (&DomainExtractorType) < 0 ) {
576576 return NULL ;
577577 }
578578
579- m = PyModule_Create (&pydomainextractor_definition );
579+ m = PyModule_Create (&extractor_definition );
580580 if (m == NULL ) {
581581 return NULL ;
582582 }
You can’t perform that action at this time.
0 commit comments