Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sir-photch/powerliftingsharp

C# Wrapper for OpenPowerlifting API
https://github.com/sir-photch/powerliftingsharp

csharp dotnet powerlifting wrapper

Last synced: about 1 month ago
JSON representation

C# Wrapper for OpenPowerlifting API

Awesome Lists containing this project

README

        


PowerliftingSharp

# Lightweight! C# Wrapper for OpenPowerlifting API

Built with .NET 6.0 and available on [nuget](https://www.nuget.org/packages/PowerliftingSharp/)

Currently, querying unique identifiers of athletes and returning their recorded data is supported.
Feel free to fork this repo or open an issue if you miss a feature!

## How to get started

```csharp
using PowerliftingSharp;
using PowerliftingSharp.Types;

using PLClient client = new();

string nameToBeFound = "Andrey Malanichev";

(string foundName, string identifier)? query = await client.QueryName(nameToBeFound);

if (query is null || query.Value.foundName != nameToBeFound)
return;

Athlete? andrey;
try
{
andrey = await client.GetAthleteByIdentifierAsync(query.Value.identifier);
}
catch (Exception e)
{
// request was not successful, or, an internal error has occurred.
}
```

For reference, see [OPL data service](https://openpowerlifting.gitlab.io/opl-csv/) and the official [Gitlab repo](https://gitlab.com/openpowerlifting/opl-data).