A small wrapper for dnspython to return SRV records for a given host, protocol, and domain name as a list of namedtuples.
srvlookup is available on the Python Package Index. Simply:
pip install srvlookup
>>> import srvlookup
>>> srvlookup.lookup('api', 'memcached')
[SRV(host='192.169.1.100', port=11211, priority=1, weight=0, host='memcache1.local'),
SRV(host='192.168.1.102', port=11211, priority=1, weight=0, host='memcache2.local'),
SRV(host='192.168.1.120', port=11211, priority=1, weight=0, host='memcache3.local'),
SRV(host='192.168.1.126', port=11211, priority=1, weight=0, host='memcache4.local')]
>>>
python setup.py nosetests