Python and C library for source extraction and photometry