Metadata-Version: 2.4
Name: hidroconta
Version: 3.0.0
Summary: DMeter360 REST API Wrapper for Python, provided by Hidroconta S.A.U.
Author: JavierL
Author-email: javier.lopez@hidroconta.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: pandas>=1.3.5
Requires-Dist: requests>=2.26.0
Requires-Dist: datetime>=5.5
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# HIDROCONTA - REST API Wrapper

This project aims to allow an easy access to Hidroconta's DMeter360 REST API by wrapping its methods in an intuitive Python interface.

The library also allows the management of huge data processing by integrating pandas.

https://pypi.org/project/hidroconta/

```
Current version: 3.0.0 (31/03/2026)
```
```
More information can be requested by contacting javier.lopez@hidroconta.com
```
Versions history:
```
# 1.6.0:
# Added historical type FlowHist
# Added historical type CustomHist to add a custom subtype and subcode

# 1.6.1
# Fixed FlowHist, named FlowlHist in 1.6.0

# 1.7.0
# Added IrisCounterGlobalHist to types 

# 1.7.1
# Fixed error in get_criteria

# 1.8.0
# Fixed history consumption endpoint to work with legacy values

# 2.0.0
# Added Nautilus+ compatibility

# 3.0.0
# Refactoring to use a modern OOP approach
# Allowing API Key login method as well as validation of MFA codes

### Version 3.0.0 is not retrocompatible with previous versions
```

The API allows the management of large amounts of data using the Pandas library, provided that the following directive is used in method calls:
```
# Pandas = True returns a pandas dataframe instead a json
```

Object creation example:
```
with demeter.DemeterClient(endpoints.Server.MAIN) as demeter_client:
    demeter_client.login(api_key='YOUR_API_KEY')
```
A basic method calling example:
```
    # Search
    df = demeter_client.search(text='SAT', element_types=[tp.Element.COUNTER, tp.Element.ANALOG_INPUT, tp.Element.RTU], status=tp.Status.ENABLED, pandas=True)
    print(df)

    # Get historics
    df = demeter_client.get_historics(start_date=datetime.datetime.now(), end_date=datetime.datetime.now(), element_ids=[1000], subtype=tp.AnalogInputHist.subtype, subcode=[tp.AnalogInputHist.subcode], pandas=True)
    print(df)

    # Get
    df = demeter_client.get_rtus(element_id=17512, pandas=True)
    print(df)
```
Exception treatment example:
```
    # Exception treatment
    try:
        df = demeter_client.get_rtus(element_id=17512, pandas=True)
    except demeter.DemeterStatusCodeException as status_code:
        print('Error {}'.format(status_code))

```
