Write meter readings to AEMO NEM12 (interval metering data) and NEM13 (accumulated metering data) data files
Project description
# nem-writer
[](https://travis-ci.org/aguinane/nem-writer) [](https://coveralls.io/github/aguinane/nem-writer?branch=master)
Write meter readings to AEMO NEM12 (interval metering data) and NEM13 (accumulated metering data) data files
# Accumulated Data (NEM13)
```python
from nemwriter import NEM13
m = NEM13(to_participant='123')
ch = m.add_reading(nmi='123',
nmi_configuration='E1B1B2',
register_id='1',
nmi_suffix='E1',
previous_read=412,
previous_read_date=datetime.datetime(2017,1,1),
previous_quality_method='A',
current_read=512,
current_read_date=datetime.datetime(2017,2,1),
current_quality_method='A',
quantity=100,
uom='kWh'
)
output = m.nem_output(file_name='output.csv')
```
Will output:
```
100,NEM13,201701010101,,123
250,123,E1B1B2,1,E1,,,E,412,201701010000,A,,,512,201702010000,A,,,100,kWh,,,
900
```
# Interval Data (NEM12)
```python
from nemwriter import NEM12
m = NEM12(to_participant='123')
readings = [
# read end, read value, quality method, event
[datetime.datetime(2004, 4, 18, 0, 30), 10.1, 'A', 'Power Outage Alarm'],
[datetime.datetime(2004, 4, 18, 1, 0), 11.2, 'A'],
[datetime.datetime(2004, 4, 18, 1, 30), 12.3, 'A'],
[datetime.datetime(2004, 4, 18, 2, 0), 13.4, 'A'],
]
ch = m.add_readings(nmi='123',
nmi_configuration='E1B1B2',
nmi_suffix='E1', uom='kWh',
interval_length=30,
readings=readings)
output = m.nem_output(file_name='output.csv')
```
Will output:
```
100,NEM12,201701010101,,123
200,123,E1B1B2,,E1,,,kWh,30,
300,20040418,10.1,11.2,12.3,13.4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,V,,,,
400,1,1,A,,Power Outage Alarm
400,2,48,A,,
900
```
[](https://travis-ci.org/aguinane/nem-writer) [](https://coveralls.io/github/aguinane/nem-writer?branch=master)
Write meter readings to AEMO NEM12 (interval metering data) and NEM13 (accumulated metering data) data files
# Accumulated Data (NEM13)
```python
from nemwriter import NEM13
m = NEM13(to_participant='123')
ch = m.add_reading(nmi='123',
nmi_configuration='E1B1B2',
register_id='1',
nmi_suffix='E1',
previous_read=412,
previous_read_date=datetime.datetime(2017,1,1),
previous_quality_method='A',
current_read=512,
current_read_date=datetime.datetime(2017,2,1),
current_quality_method='A',
quantity=100,
uom='kWh'
)
output = m.nem_output(file_name='output.csv')
```
Will output:
```
100,NEM13,201701010101,,123
250,123,E1B1B2,1,E1,,,E,412,201701010000,A,,,512,201702010000,A,,,100,kWh,,,
900
```
# Interval Data (NEM12)
```python
from nemwriter import NEM12
m = NEM12(to_participant='123')
readings = [
# read end, read value, quality method, event
[datetime.datetime(2004, 4, 18, 0, 30), 10.1, 'A', 'Power Outage Alarm'],
[datetime.datetime(2004, 4, 18, 1, 0), 11.2, 'A'],
[datetime.datetime(2004, 4, 18, 1, 30), 12.3, 'A'],
[datetime.datetime(2004, 4, 18, 2, 0), 13.4, 'A'],
]
ch = m.add_readings(nmi='123',
nmi_configuration='E1B1B2',
nmi_suffix='E1', uom='kWh',
interval_length=30,
readings=readings)
output = m.nem_output(file_name='output.csv')
```
Will output:
```
100,NEM12,201701010101,,123
200,123,E1B1B2,,E1,,,kWh,30,
300,20040418,10.1,11.2,12.3,13.4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,V,,,,
400,1,1,A,,Power Outage Alarm
400,2,48,A,,
900
```
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
nemwriter-0.1.0.tar.gz
(3.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nemwriter-0.1.0.tar.gz.
File metadata
- Download URL: nemwriter-0.1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a05fd76505e6a9d11e5a46d1b9f679c393d7e7476878cbb12f0430650e3afc2d
|
|
| MD5 |
78b8e8ac7f833b4acacd88e66ea213ef
|
|
| BLAKE2b-256 |
a366461912c87d401306e5fcc867f2f672b2118a7c64cbdf0741d6e008664907
|
File details
Details for the file nemwriter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nemwriter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f62486ce46d98bad1144883343fc3869b3f5149fbe6f4e19c02912d3cff1df14
|
|
| MD5 |
54a1bc9ca5dd682ceeb4fee91f421bf5
|
|
| BLAKE2b-256 |
01b95343024581e9c6e360619836fdfdc4ba322609a29a6f7257a931cf4449b4
|