$ pip freeze | grep validators
validators==0.12.2
$ python
Python 3.6.5 (default, Jun 16 2018, 01:20:19)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import validators
>>> validators.domain("""example.com
... """)
True