Is there a spectrum sensing library?
There's a whole load of spectral estimation libraries available for GNU Radio. I'm personally fond of gr-specest, the GNU Radio spectral estimation toolbox. 

It does a lot popular algorithms, inluding Cyclostationary spectrum estimators, ESPRIT, MUSIC, Welch, etc.

For "energy detection" and "matched filtering", you wouldn't need any add-on library – GNU Radio already comes with the necessary blocks (here: complex to magnitude square, and FIR filters) in highly optimized versions.

GNU Radio is written in C++, but you can connect blocks using Python, if you prefer so, and write your own blocks in either python or C++.

I'd recommend going through the official GNU Radio Tutorials, as they will pretty quickly give you a feeling how you can implement the sensing for a CE with GR.

In fact, if you search  for (Cognitive Radio) AND (GNU Radio) on IEEExplore, you'll find quite some papers (634 at the time of writing). It might be a good idea to investigate those since 2014 to get a feeling for the state of the art.