john-kurkowski / tldextract

Accurately separates a URL’s subdomain, domain, and public suffix, using the Public Suffix List (PSL).
BSD 3-Clause "New" or "Revised" License
1.81k stars 211 forks source link

control fallback_to_snapshot behavior from cli #251

Closed mcooperman closed 2 years ago

mcooperman commented 2 years ago

there is no command line option to toggle the fallback_to_snapshot behavior (True|False) of TLDExtract. At least from a testing perspective, to force URL fetch(es), it should be there.

john-kurkowski commented 2 years ago

I'm not sure about maintaining every possible Python API in the CLI. The CLI is just for quick, one-off queries. CLI users can do the following to set fallback_to_snapshot, yeah? Not too verbose.

$ python -c 'import tldextract; print(" ".join(tldextract.TLDExtract(fallback_to_snapshot=False)("forums.bbc.co.uk")))'
forums bbc co.uk
john-kurkowski commented 2 years ago

Fixed in #259/#260. I'm coming around on expanding the CLI. 😄