In [2]:
from owslib.csw import CatalogueServiceWeb
from owslib import fes
endpoint = 'http://geoport.whoi.edu/geoportal/csw'
csw = CatalogueServiceWeb(endpoint,timeout=60)

bbox = [-74.8738,40.2402,-73.468,41.0993]
filter = fes.BBox(bbox)
csw.getrecords2(constraints=[filter],maxrecords=5,esn='full')

In [3]:
csw.records


Out[3]:
{'NYOFS/fmrc/Aggregated_7_day_NYOFS_Fields_Forecast_best.ncd': <owslib.csw.CswRecord at 0x34af4d0>,
 'espresso_2009_da_averages': <owslib.csw.CswRecord at 0x34afe50>,
 'espresso_2009_da_history': <owslib.csw.CswRecord at 0x34b5190>,
 'roms/espresso/2013_da/avg_Best/ESPRESSO_Real-Time_v2_Averages_Best_Available_best.ncd': <owslib.csw.CswRecord at 0x34b5490>,
 'roms/espresso/2013_da/his_Best/ESPRESSO_Real-Time_v2_History_Best_Available_best.ncd': <owslib.csw.CswRecord at 0x34b56d0>}

In [2]:
from owslib.csw import CatalogueServiceWeb
csw = CatalogueServiceWeb('http://www.rndt.gov.it/RNDT/CSW?')
csw.getrecords(keywords=['test'], maxrecords=20)


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-a0fd93301da6> in <module>()
      1 from owslib.csw import CatalogueServiceWeb
      2 csw = CatalogueServiceWeb('http://www.rndt.gov.it/RNDT/CSW?')
----> 3 csw.getrecords(keywords=['test'], maxrecords='20')

/home/local/python27_epd/lib/python2.7/site-packages/owslib/csw.pyc in getrecords(self, qtype, keywords, typenames, propertyname, bbox, esn, sortby, outputschema, format, startposition, maxrecords, cql, xml, resulttype)
    228             # process search results attributes
    229             val = self._exml.find(util.nspath_eval('csw:SearchResults', namespaces)).attrib.get('numberOfRecordsMatched')
--> 230             self.results['matches'] = int(util.testXMLValue(val, True))
    231             val = self._exml.find(util.nspath_eval('csw:SearchResults', namespaces)).attrib.get('numberOfRecordsReturned')
    232             self.results['returned'] = int(util.testXMLValue(val, True))

TypeError: int() argument must be a string or a number, not 'NoneType'

In [ ]: