osu-sharp-riley 2024.9.17

dotnet add package osu-sharp-riley --version 2024.9.17
                    
NuGet\Install-Package osu-sharp-riley -Version 2024.9.17
                    
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="osu-sharp-riley" Version="2024.9.17" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="osu-sharp-riley" Version="2024.9.17" />
                    
Directory.Packages.props
<PackageReference Include="osu-sharp-riley" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add osu-sharp-riley --version 2024.9.17
                    
#r "nuget: osu-sharp-riley, 2024.9.17"
                    
#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.
#:package osu-sharp-riley@2024.9.17
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=osu-sharp-riley&version=2024.9.17
                    
Install as a Cake Addin
#tool nuget:?package=osu-sharp-riley&version=2024.9.17
                    
Install as a Cake Tool

<div align="center">

osu-sharp

License: GPL v3 Latest Release

A comprehensive, well documented API wrapper for the public scope of the osu! API v2.<br/> This wrapper <ins>currently only supports client credential authorization</ins>.<br/>

Getting StartedEndpoints<br/> </div>

<div align="center"> <i>Made with ❤️ by minisbett</i> </div>

Getting Started

The methods for accessing the API can be found in the OsuApiClient class. When creating an instance, you will need to specify the client ID and client secret, as found in your osu! settings.
Authorization using an OAuth flow or user credentials is not supported yet, but is planned for the future.

Below, you can find a simple example on how to authorize using client credentials and request info about a beatmapset.

// Create the client.
OsuApiClient client = new OsuApiClient(clientId, clientSecret);

// Optional. Requests an access token using the specified client credentials.
// This action is automatically performed whenever calling an API endpoint.
await client.EnsureAccessTokenAsync();

// Get Sotarks' Harumachi Clover.
BeatmapSetExtended? set = await client.GetBeatmapSetAsync(842412);

Every model and every endpoint method is well documented, containing both references to the API documentation and osu-web source code, as well as notes found in the API documentation. If you believe you've found an inconsistency, for example due to changes to the API, please let me know in the GitHub Issues.

Asynchronous Enumerables for pagination

For API endpoints that have cursor-based pagination (as opposed to being able to specify a page), osu-sharp provides an IAsyncEnumerable allowing you to treat the data received from the endpoint as an enumerable. It automatically performs further pagination requests as necessary, making working with it very easy and straight-forward. Below, you can find an example.

// Create the client.
OsuApiClient client = new OsuApiClient(clientId, clientSecret);

// Get the async enumerable for beatmap packs.
IAsyncEnumerable<BeatmapPack> packs = client.GetBeatmapPacksAsync();

// Enumerate over all beatmap packs and output their tag.
await foreach (BeatmapPack pack in packs)
  Console.WriteLine(pack.Tag);

Normal & Extended models

The osu! API v2 splits it's models for beatmaps, beatmapsets and users into two sizes: the normal size (Beatmap, BeatmapSet, User), and their extended version, containing more fields with information (BeatmapExtended, BeatmapSetExtended, UserExtended). It is advised to utilize the API documentation when using the API wrapper, to make sure you get the necessary information you require.

Below, you can find the osu! API v2 documentation for each model:
BeatmapBeatmapExtended
BeatmapSetBeatmapSetExtended
UserUserExtended

Features

Below, you can find a list of all endpoints available on the osu! API v2, as well as a checkmark on those that have been implemented.

Beatmap Packs (100% 2/2)
  [✓] /beatmaps/packs
  [✓] /beatmaps/packs/{tag}

Beatmaps (100% 7/7)
  [✓] /beatmaps
  [✓] /beatmaps/lookup
  [✓] /beatmaps/{beatmap}
  [✓] /beatmaps/{beatmap}/attributes
  [✓] /beatmaps/{beatmap}/scores
  [✓] /beatmaps/{beatmap}/scores/users/{user}
  [✓] /beatmaps/{beatmap}/scores/users/{user}/all

Beatmap Sets (100% 2/2)
  [✓] /beatmapsets/lookup
  [✓] /beatmapsets/{beatmapset}

Changelogs (100% 3/3)
  [✓] /changelog
  [✓] /changelog/{buildOrStream}
  [✓] /changelog/{stream}/{build}

Comments (100% 2/2)
  [✓] /comments
  [✓] /comments/{comment}

Events (100% 1/1)
  [✓] /events

Home (0% 0/1)
  [ ] /search

Multiplayer (0% 0/1)
  [ ] /rooms/{room}/playlist/{playlist}/scores

News (100% 2/2)
  [✓] /news
  [✓] /news/{news}

Ranking (33% 1/3)
  [✓] /rankings/kudosu
  [ ] /rankings/{mode}/{type}
  [ ] /spotlights

Users (100% 6/6)
  [✓] /users
  [✓] /users/{user}/{mode?}
  [✓] /users/{user}/kudosu
  [✓] /users/{user}/scores/{type}
  [✓] /users/{user}/beatmapsets/{type}
  [✓] /users/{user}/recent_activity

Wiki (100% 1/1)
  [✓] /wiki/{locale}/{path}

Undocumented (0% 0/?)
  To be added
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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
2024.9.17 187 9/17/2024