Sign inSign up

andmos/bikesharetestscript

By andmos

•Updated over 5 years ago

Test Script for BikeshareClient dotnet library.

Image
0

358

andmos/bikesharetestscript repository overview

⁠BikeshareClient

Dotnet client for the General Bikeshare Feed Specification (GBFS⁠). Mainly used against Urban Infrastructure Partner⁠, with Trondheim City Bike⁠ and Bergen City Bike⁠.

For all available GBFS systems, see the system overview from the GBFS project⁠.

Supports the required fields in the GBFS standard for now.


// Create the client from a GBFS API URL.
IBikeshareClient client = new Client("http://gbfs.urbansharing.com/trondheim/gbfs.json");

// Or with an existing HTTPClient
IBikeshareClient client = new Client("http://gbfs.urbansharing.com/trondheim/gbfs.json", httpClient);

// All available stations, containing name, id, lat, long, address and capacity
var stations = await client.GetStationsAsync();

// All stations status, containing number of bikes and docks available, is renting, is returning etc.
var statuses = await client.GetStationsStatusAsync();

A simple dotnet-script⁠ test script for the client can be seen here⁠.

Simple build:

docker run --rm -it -v $(pwd):/app mcr.microsoft.com/dotnet/sdk:5.0 dotnet pack app/src/BikeshareClient -o /app

Run test script:

docker run --rm -it -v $(pwd)/src/TestScript/:/scripts  andmos/dotnet-script main.csx "Skansen"

Build Status

codecov

NuGet

Dependabot Status

GBFS⁠ is a standard backed by the North American Bike Share Association (NABSA⁠).

Tag summary

Content type

Image

Digest

Size

416.3 MB

Last updated

over 5 years ago

docker pull andmos/bikesharetestscript