get_native_names

FactsService.get_native_names(building_id, native_name=None, is_active=True, result_format='pandas')

Return the native names for a building.

API documentation: http://facts.prod.ecorithm.com/api/v1/#/Native-Names/native_names_get

Args:

building_id (str): Building id to get facts for.

Example: 1

Kwargs:

native_name (string): Filter on this native_name

Example: ‘native-name-1’

is_active (boolean): Return the active / in-active native-names

Example: True

result_format (str): Output format type. (Pandas, tuple, csv, json)

Example: ‘pandas’

Returns:

(DataFrame or list or csv or json depending on the requested result format).

DataFrame Example:

index   native_name_id     native_name   native_name   expecting_data         origin       trend_period      last_updated
=====  ================   ============  ============  ================   ==============  ================  ====================
0            192          'name-1'        'name-1'          True            'CLIENT'        300 seconds    2017-12-19T20:36:36Z

1            304          'name-2'        'name-2'          False          'ECORITHM'       300 seconds    2017-12-19T20:36:36Z

Json Example:

{'data': [{'expecting_data': True,
   'last_updated': '2017-12-19T20:36:36Z',
   'native_name': 'UCSB/275/VAV_301/NAE11/N2-2.275-VAV-301.ZN-T',
   'native_name_id': 88826,
   'origin': 'CLIENT',
   'trend_period': '300 seconds',
   'trend_type': 'INTERVAL'},
  {'expecting_data': True,
   'last_updated': '2017-12-19T20:36:36Z',
   'native_name': 'UCSB/275/VAV_301/NAE11/N2-2.275-VAV-301.ACLG-SET',
   'native_name_id': 88827,
   'origin': 'CLIENT',
   'trend_period': '300 seconds',
   'trend_type': 'INTERVAL'}
   }

Csv Example:

'native_name_id,native_name,expecting_data,
origin,trend_type,trend_period,last_updated


88826,UCSB/275/VAV_301/NAE11/N2-2.275-VAV-301.ZN-T,
True,CLIENT,INTERVAL,300 seconds,2017-12-19T20:36:36Z,

88827,UCSB/275/VAV_301/NAE11/N2-2.275-VAV-301.ACLG-SET,True,
CLIENT,INTERVAL,300 seconds,2017-12-19T20:36:36Z'

Tuple Example:

[response_tuple(native_name_id=88826,
                native_name='UCSB/275/VAV_301/NAE11/N2-2.275-VAV-301.ZN-T',
                expecting_data=True, origin='CLIENT',
                trend_type='INTERVAL',
                trend_period='300 seconds',
                last_updated='2017-12-19T20:36:36Z'),
 response_tuple(native_name_id=88827,
                native_name='UCSB/275/VAV_301/NAE11/N2-2.275-VAV-301.ACLG-SET',
                expecting_data=True, origin='CLIENT',
                trend_type='INTERVAL',
                trend_period='300 seconds',
                last_updated='2017-12-19T20:36:36Z')

Note

And invalid api request will return back the raw api response.

Example:

{“message”: {“NoData”: “No data for provided parameters”}}

Example Usage:

>>> from eco_connect import FactsService
>>> facts_service = FactsService()
>>> facts_service.get_native_names(building_id=26,
                                   result_format='json')
        {'data': [{'expecting_data': True,
           'last_updated': '2017-12-19T20:36:36Z',
           'native_name': 'UCSB/275/VAV_301/NAE11/N2-2.275-VAV-301.ZN-T',
           'native_name_id': 88826,
           'origin': 'CLIENT',
           'trend_period': '300 seconds',
           'trend_type': 'INTERVAL'},
          {'expecting_data': True,
           'last_updated': '2017-12-19T20:36:36Z',
           'native_name': 'UCSB/275/VAV_301/NAE11/N2-2.275-VAV-301.ACLG-SET',
           'native_name_id': 88827,
           'origin': 'CLIENT',
           'trend_period': '300 seconds',
           'trend_type': 'INTERVAL'}
           }