Definitions of what constitutes sunrise/sunset can vary. For example, in ephem "rising and setting are defined as the moments when the upper limb of the body touches the horizon (that is, when the body’s alt plus radius equals zero)" [PyEphem Quick Reference].
#!/usr/bin/env python
import datetime
import ephem # to install, run `pip install pyephem`
o = ephem.Observer()
o.lat, o.long, o.date = '34:3', '-118:15', datetime.datetime.utcnow()
sun = ephem.Sun(o)
print "Los Angeles"
print "sunrise:", o.next_rising(sun), "UTC"
print "sunset:",o.next_setting(sun), "UTC"
Output
Los Angeles, CA
sunrise: 2010/3/30 13:42:43 UTC
sunset: 2010/3/30 02:11:50 UTC
If it is open-source library then you could fix it instead of creating a new one with new bugs.