npri-tools / npri

A Python package providing easy-to-use code that returns recently reported emissions from facilities, socio-economic information for places, emissions records for specific companies and industries, and emissions trends over time
GNU General Public License v3.0
0 stars 0 forks source link

add more operators to Filters #9

Open ericnost opened 9 months ago

ericnost commented 9 months ago

https://github.com/npri-tools/npri/blob/ec5ffe632878c6d64141c7659887159b3ff9e36b/npri/npri.py#L176

Especially for strings.

Example - searching for oil and gas sectors using npri.Industries like:

og = npri.Industries(value=["oil", "gas"])
og.data

will return "toilet preparation manufacturing" because "oil" is in "toilet"

This could be removed with something like:

og.filters(attribute = "NAICSTitleEn", operator = "!=", value = "Toilet preparation manufacturing")
ericnost commented 8 months ago

May not fix. Currently have dropped the Filters class. Filtering can be done through adding more parameters to API calls?