This might be what you need: https://github.com/MaxHorstmann/ArinWhois.NET
Install with pip:
I just tried to install with pip, and there is no package in PyPi.
The github repository is 4 years old, and hasn't been worked on since 2014.
So, you might explore the code to get some ideas.
There is also another package which is in PyPi, and can be installed with pip, named whois.
It's also old, but has versions for python 2 and 3.
link: https://pypi.python.org/pypi/whois/0.7
Install with pip:
Install-Package ArinWhoisit is a package for calling Arin whois service
I just tried to install with pip, and there is no package in PyPi.
The github repository is 4 years old, and hasn't been worked on since 2014.
So, you might explore the code to get some ideas.
There is also another package which is in PyPi, and can be installed with pip, named whois.
It's also old, but has versions for python 2 and 3.
link: https://pypi.python.org/pypi/whois/0.7