AoCAPI 1.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package AoCAPI --version 1.0.5
NuGet\Install-Package AoCAPI -Version 1.0.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AoCAPI" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AoCAPI --version 1.0.5
#r "nuget: AoCAPI, 1.0.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AoCAPI as a Cake Addin
#addin nuget:?package=AoCAPI&version=1.0.5

// Install AoCAPI as a Cake Tool
#tool nuget:?package=AoCAPI&version=1.0.5

A simple NuGet package to handle personal Advent Of Code data

Documentation

Adding to .NET project

Add dependencies to project

dotnet add package AoCAPI

Use in project

using AoC.API;

Variable Initialization

var client = new APIHandler("session cookie");

How to obtain session cookie

Features

Get input files

GetInputText

string GetInputText(int year, int day)
string GetInputText(string input, Regex pattern)

INFO: The Regex overload needs to have the group containing the year named "year" and the group containing the day named "day".

How to name Regex groups

Usage
string input = client.GetInputText(2015, 1); // input file (raw text) from year 2015, day 1
string input = client.GetInputText("2015 day01", new Regex(@"(?<year>\d{4}) day(?<day>\d{2})")); // input file (raw text) from year 2015, day 1

GetInputLines

string[] GetInputLines(int year, int day)
string[] GetInputText(string input, Regex pattern)

INFO: The Regex overload needs to have the group containing the year named "year" and the group containing the day named "day".

How to name Regex groups

Usage
string[] input = client.GetInputLines(2015, 1); // input file (raw lines) from year 2015, day 1
string[] input = client.GetInputLines("2015 day01", new Regex(@"(?<year>\d{4}) day(?<day>\d{2})")); // input file (raw lines) from year 2015, day 1

Get achieved stars

Method parameters and return value

Dictionary<int, int> GetStars()

Usage

Dictionary<int, int> stars = client.GetStars(); // user's achieved stars by year

credits to: Max - markdown info icons Monday Morning Haskell - documentation on how to obtaining session cookie Developer.Mozilla - documentation on how to name Regex groups

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.2.10 83 4/26/2024
2.2.9 84 4/21/2024
2.2.8 116 4/7/2024
2.2.7 473 12/9/2023
2.2.6 387 12/4/2023
2.2.5 376 12/4/2023
2.1.5 378 12/3/2023
2.1.4 380 12/3/2023
2.1.3 395 12/2/2023
2.0.3 412 11/10/2023
2.0.2 402 9/15/2023
2.0.1 429 9/6/2023
2.0.0 394 9/6/2023
1.0.5 441 7/30/2023
1.0.4 443 7/29/2023
1.0.3 438 7/29/2023
1.0.2 426 7/29/2023
1.0.1 450 7/29/2023
1.0.0 450 7/29/2023