Python client for Enedis SGE web-service
Project description
lowatt-enedis
A command-line tool and Python library to access Enedis SGE SOAP web-services, provided by LOWATT.
Disclaimer: this package is NOT affiliated to Enedis, but provided by Lowatt in case it could be useful to other users of the SGE web-services provided by Enedis.
Licensing
It is published under the terms of the GPL 3 license.
Installation
pip install lowatt-enedis
Command line usage
See lowatt-enedis --help
for CLI usage. You'll be able to call the services
controlled using options and see the SOAP response. You can take a look at
doc/homologation.md
for a sample session to go through Enedis'homologation
process.
Some flags are required by all or most of the commands so they can be configured once by their respective environment variables.
Option | Environment variable |
---|---|
--cert-file |
ENEDIS_CERT_FILE |
--key-file |
ENEDIS_KEY_FILE |
--login |
ENEDIS_LOGIN |
--contrat |
ENEDIS_CONTRAT |
Python library usage
Here is a sample code to access to the ConsultationMesuresDetaillees
from
Python code :
import datetime
import lowatt_enedis
import lowatt_enedis.services
config = {
'login': 'you@example.com',
'certificateFile': 'fullchain.pem',
'keyFile': 'privkey.pem',
'prm': '30000123456789',
}
# get client for the 'details' service using appropriate client
# certificate and key
client = lowatt_enedis.get_client(
lowatt_enedis.COMMAND_SERVICE['details'][0],
config['certificateFile'], config['keyFile'],
)
# actually call the web to get values for the past week
resp = lowatt_enedis.services.point_detailed_measures(client, {
'login': config['login'],
'prm': config['prm'],
'type': 'COURBE',
'courbe_type': 'PA',
'corrigee': True,
'from': datetime.date.today() - datetime.timedelta(days=7),
'to': datetime.date.today(),
})
# get a list of (UTC timestamp, value(W))
data = lowatt_enedis.services.measures_resp2py(resp)
Contributions
Contribution are welcome through the Github repository.
Feel free to contact for more info by writing at info@lowatt.fr.
Sponsors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lowatt_enedis-3.1.0.tar.gz
.
File metadata
- Download URL: lowatt_enedis-3.1.0.tar.gz
- Upload date:
- Size: 139.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3652846ec6cf91f9e34e7d557a95f0ad3077670d9e41a41a88b89e0f6afe2c18 |
|
MD5 | 386640f7e9f751f6ccb3c5ad23ae1046 |
|
BLAKE2b-256 | 9a60eb46fe70dc2f87190d4650c57c6dbc890d71e401c976e6a59b8ff4cb21b2 |
File details
Details for the file lowatt_enedis-3.1.0-py3-none-any.whl
.
File metadata
- Download URL: lowatt_enedis-3.1.0-py3-none-any.whl
- Upload date:
- Size: 154.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e325518073bb375cabbaabe7d203a2094f3b9af9f1cc48d76f14c9720365a16 |
|
MD5 | 9455810eeee40a4420c362c4cc6f4203 |
|
BLAKE2b-256 | badbe47b99f8018aebb94538a1389b90aadc41a1c94a1e40299a61df988a12f1 |