Metadata-Version: 2.1
Name: onlytld
Version: 0.0.3
Summary: 
Home-page: https://github.com/abersheeran/onlytld
License: Apache-2.0
Author: abersheeran
Author-email: me@abersheeran.com
Requires-Python: >=3.5,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Project-URL: Documentation, https://github.com/abersheeran/onlytld
Project-URL: Repository, https://github.com/abersheeran/onlytld
Description-Content-Type: text/markdown

# onlyTLD

Just only get TLD from domain. No other function. No non-standard library dependencies.

## How to use

In Python3.5+:

```python
from onlytld import get_tld

assert get_tld("chinese.cn") == "cn"
```

## Update TLD List

Refer to https://www.publicsuffix.org/list/, you can run `onlytld.data.fetch_list` regularly in the code or run` python -m onlytld.data` in crontab.

## Use yourself TLD List

Maybe this is useless, but I still set this function.

```python
from onlytld import set_datapath, get_tld

set_datapath(YOUR_FILE_PATH)

assert get_tld("chinese.cn") == "cn"
```

## Why this

There are many libraries in pypi that can get tld, such as [publicsuffix2](https://pypi.org/project/publicsuffix2/), [publicsuffixlist](https://pypi.org/project/publicsuffixlist/), [dnspy](https://pypi.org/project/dnspy/), but they have too many functions. I just need a repository that can get tld, and it is best not to have dependencies other than the non-standard library.

