Skip to content

ssrtw/fastpsl

Repository files navigation

fastpsl

FastPSL is a high-performance domain parser for Python, implemented in Rust and exposed via [PyO3]. It extracts a URL’s subdomain, registered domain, and public suffix in full compliance with the Public Suffix List (PSL). On first use, the PSL data is automatically downloaded and cached in a cross-platform location (public_suffix_list.dat). No manual setup required. Benchmarked against tldextract, FastPSL is approximately 4× faster under typical workloads. See test/benchmark.py for details.

Usage

pip install fastpsl
>>> import fastpsl

>>> fastpsl.extract("api.example.com")
ExtractResult(subdomain='api', domain='example', suffix='com', is_private=false)

>>> fastpsl.extract("https://sub.domain.example.com:8000/path?query=123")
ExtractResult(subdomain='sub.domain', domain='example', suffix='com', is_private=false)

Contributing

This project is actively being developed, and all forms of participation are welcome.

License

MIT License

About

FastPSL is a library that uses PyO3 to interface with Rust's PublicSuffixList library.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published