Skype with Python

Create the virtualenv

virtualenv skype_venv -p /usr/bin/python2.7 --system-site-packages

Note that I am specyfying the python2 interpreter, and using the system site packages (the python libraries already installed).

Install the Skype4Py library

You can install it with pip.

source skype_venv/bin/activate
pip install Skype4Py

Note that this library allows us to control Skype client application. It means that you will need to have a skype client installed with which you will interact using python.


Use the library

Open your skype client and launch a python prompt

>>> import Skype4Py
>>> skype = Skype4Py.Skype()
>>> skype.Attach()

At this point, the Skype client will ask for authorization:

Skype4Py authorisation

And now, you can for example get the list of all your contacts:

>>> print 'Your full name:', skype.CurrentUser.FullName
>>> print 'Your contacts:'
>>> for user in skype.Friends:
        print '    ', user.FullName

To go further:


Comments powered by Disqus