Using Pywikibot you may use the MediaWiki API as follows:
import pywikibot
site = pywikibot('Wikipedia:en')
user = pyikibot.User(site, '193.224.28.2')
User is a class derived from pywikibot.Page which represents a user and there is a method to retrieve his contibutions. The method is contributions() which is a generator and yields pywikibot.Page (a Page object which can be used for further informations) , revid (the revision id), pywikibot.Timestamp (an object derived from datetime), comment (the edit summary). To get the last 5 Edits you may use:
contribs = list(user.contributions(total=5))
This retrieves entries like:
(Page('History of Croatia'), 282343057, Timestamp(2009, 4, 7, 14, 10, 7), '')
To get a range of ips you may use the corresponding site method usercontibs() but you have to upcast the content by yourself:
list(site.usercontribs(userprefix='193.224.28.', total=5))
For each entry you get a dict like this:
{'comment': '',
'ns': 0,
'pageid': 5574,
'parentid': 281875336,
'revid': 282343057,
'timestamp': '2009-04-07T14:10:07Z',
'title': 'History of Croatia',
'user': '193.224.28.2',
'userid': 0}
There are additional parameters for Site.usercontribs() method which are als usable for Page.contributions(). They can be used to filter the result, e.g. for a specific namespace or to retrieve only the topmost edit of pages. The documentation can be found here.