Skip to content

README example uses tldextract.extract_urllib, but method is not exported #360

@vpolyakov

Description

@vpolyakov

Hi!
In the README section “How to validate URLs before extraction” the example uses:

result = tldextract.extract_urllib(split_url)

But in tldextract 5.3.1 this attribute does not exist at the module level.

Environment:

  • Python: 3.13.9 (conda-forge) on macOS (darwin)
  • tldextract: 5.3.1
  • Installation: conda-forge
  • tldextract.file:
    /Users/polyakov/miniforge3/envs/ju13/lib/python3.13/site-packages/tldextract/init.py

Repro:

import tldextract

print(tldextract.__version__)                      # 5.3.1
print(hasattr(tldextract, "extract_urllib"))       # False
print(hasattr(tldextract.TLDExtract, "extract_urllib"))  # True

Suggested fix (either option):
1. Update README to call it via an instance:

extractor = tldextract.TLDExtract()
result = extractor.extract_urllib(split_url)

or
2. Export a module-level wrapper tldextract.extract_urllib(...) for consistency with the README.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions