tld

Extracts the top level domain (TLD) from the URL given.

OTHER License

Downloads
3.2M
Stars
177
Committers
16
tld - 0.9.6-2019-09-12

Published by barseghyanartur about 5 years ago

  • Fix for update-tld-names returns a non-zero exit code on success (introduced with optimisations in 0.9.4).
  • Minor tests improvements.
tld - 0.9.5-2019-09-11

Published by barseghyanartur about 5 years ago

  • Tests improvements.
tld - 0.9.4-2019-09-11

Published by barseghyanartur about 5 years ago

  • Optimisations in setup.py, tests and console scripts.
  • Skip testing the update-tld-names functionality if no internet is available.
tld - 0.9.3-2019-04-05

Published by barseghyanartur over 5 years ago

  • Added is_tld function.
  • Docs updated.
  • Upgraded test suite.
tld - 0.9.2-2019-01-10

Published by barseghyanartur almost 6 years ago

  • Fix an issue causing certain punycode TLDs to be deemed invalid.
  • Tested against Python 3.7.
  • Added tests for commands.
  • Dropped Python 2.6 support.
  • TLD source updated to the latest version.
tld - 0.9.1-2018-07-09

Published by barseghyanartur over 6 years ago

  • Correctly handling nested TLDs.
tld - 0.9-2018-06-14

Published by barseghyanartur over 6 years ago

    This release contains backward incompatible changes. You should update
    your code.

    The ``active_only`` option has been removed from ``get_tld``, ``get_fld``
    and ``parse_url`` functions. Update your code accordingly.
  • Removed active_only option from get_tld, get_fld
    and parse_url functions.
  • Correctly handling exceptions (!) in the original TLD list.
  • Fixes in documentation.
  • Added parse_tld function.
tld - 0.8-2018-06-13

Published by barseghyanartur over 6 years ago


    This release contains backward incompatible changes. You should update
    your code.

    Old ``get_tld`` functionality remain is moved to ``get_fld`` (first-level
    domain definition). The ``as_object`` argument (False by default) has been
    deprecated for ``get_fld``.
        res = get_tld("http://www.google.co.uk", as_object=True)
**Old behaviour**

        In: res.domain
        Out: 'google'

        In: res.extension
        Out: 'co.uk'

        In: res.subdomain
        Out: 'www'

        In: res.suffix
        Out: 'co.uk'

        In: res.tld
        Out: 'google.co.uk'
**New behaviour**
        In: res.fld
        Out: 'google.co.uk'

        In: res.tld
        Out: 'co.uk'

        In: res.domain
        Out: 'google'

        In: res.subdomain
        Out: 'www'

When used without ``as_object`` it returns ``co.uk``.

**Recap**

If you have been happily using old version of ``get_tld`` function without
``as_object`` argument set to ``True``, you might want to replace ``get_tld``
import with ``get_fld`` import:

        # Old
        from tld import get_tld
        get_tld('http://google.co.uk')

        # New
        from tld import get_fld
        get_fld('http://google.co.uk')
  • Move to a Trie to match TLDs. This brings a speed up of 15-20%.
  • It's now possible to search in public, private or all suffixes (old
    behaviour). Use search_public and search_private arguments accordingly.
    By default (to support old behavior), both are set to True.
  • Correct TLD definitions.
  • Domains like *****.xn--fiqs8s are now recognized as well.
  • Due to usage of urlsplit instead of urlparse, the initial list of TLDs
    is assembled quicker (a speed-up of 15-20%).
  • Docs/ directory is included in source distribution tarball.
  • More tests.
tld - 0.7.10-2018-04-07

Published by barseghyanartur over 6 years ago

  • The fix_protocol argument respects protocol relative URLs.
  • Change year in the license.
  • Improved docstrings.
  • TLD source updated to the latest version.
tld - 0.7.9-2017-05-02

Published by barseghyanartur over 6 years ago

  • Added base path override for local .dat file.
  • python setup.py test can used to execute the tests.
tld - 0.7.8-2017-02-19

Published by barseghyanartur over 7 years ago

  • Fix relative import in non-package for update-tls-names script. #15
  • get_tld got a new argument fix_protocol, which fixes the missing
    protocol, having prepended "https" if missing or incorrect.
tld - 0.7.7-2017-02-09

Published by barseghyanartur over 7 years ago

  • Tested against Python 3.5, 3.6 and PyPy.
  • pep8 fixes.
  • removed deprecated tld.update module. Use update-tld-names command
    instead.
tld - 0.7.6-2016-01-23

Published by barseghyanartur over 7 years ago

  • Minor fixes.
tld - 0.7.5-2015-11-22

Published by barseghyanartur over 7 years ago

  • Minor fixes.
  • Updated tld names file to the latest version.
tld - 0.7.4-2015-09-24

Published by barseghyanartur about 9 years ago

  • Exposed TLD initialization as get_tld_names.
tld - 0.7.3-2015-07-18

Published by barseghyanartur over 9 years ago

  • Support for wheel packages.
  • Fixed failure on some unicode domains.
  • TLD source updated to the latest version.
  • Documentation updated.
tld - 0.7.2-2014-09-28

Published by barseghyanartur over 9 years ago

  • Minor fixes.
tld - 0.7.1-2014-09-23

Published by barseghyanartur over 9 years ago

  • Force lower case of the URL for correct search.
tld - 0.7-2014-08-14

Published by barseghyanartur over 9 years ago

  • Making it possible to obtain object instead of just extracting the TLD by
    setting the as_object argument of get_tld function to True.
tld - 0.6.4-2014-05-21

Published by barseghyanartur over 9 years ago

  • Softened dependencies and lowered the six package version requirement to
    1.4.0.
  • Documentation improvements.