From f2b67c6f70904a8142c54768caaf8e9cf58c118a Mon Sep 17 00:00:00 2001 From: Akhan Zhakiyanov Date: Fri, 13 Sep 2024 22:50:00 +0800 Subject: [PATCH] feat: add getting started section --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index a822888..d13e306 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,40 @@ # AEMO.MDFF [![Build](https://github.com/ahanoff/aemo-mdff-net/actions/workflows/build.yaml/badge.svg)](https://github.com/ahanoff/aemo-mdff-net/actions/workflows/build.yaml) +![NuGet Version](https://img.shields.io/nuget/vpre/AEMO.MDFF) +![NuGet Downloads](https://img.shields.io/nuget/dt/AEMO.MDFF) +![GitHub License](https://img.shields.io/github/license/ahanoff/aemo-mdff-net) Parser for Australian Energy Market Operator (AEMO) Meter Data File Format (MDFF) specification +## Getting started + +Install Nuget package + +```shell +dotnet add package AEMO.MDFF +``` + +Use Nem12Reader to parse csv file + +```csharp +using AEMO.MDFF.NEM12; + +var nem12Reader = new Nem12Reader(); +await using var fs = new FileStream("nem12.csv", FileMode.Open, FileAccess.Read); +await foreach (var r in nem12Reader.ReadAsync(fs, CancellationToken.None)) +{ + switch (r) + { + case HeaderRecord { VersionHeader: var vh }: + Console.WriteLine(vh); + break; + case NMIDataDetailsRecord { NextScheduledReadDate: var nsrd }: + Console.WriteLine(nsrd.ToLongDateString()); + break; + } +} +``` ## References