nimhq

HQ Trivia API wrapper for Nim

Pure Nim score 30/100 · tests present · docs generated

Summary

Latest Version Unknown
License MIT
CI Status Passing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install nimhq
choosenim install nimhq
git clone https://github.com/sillibird/nimhq

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
nimhq - - - - - - -

Source

Repository https://github.com/sillibird/nimhq
Homepage https://github.com/sillibird/nimhq
Documentation View Documentation
Registry Source nimble_official

README

nimhq

nimhq is a HQ Trivia API wrapper written in nim.

Usage

Install the package with nimble

nimble install nimhq

To use nimhq, you must import both nimhq and json

import nimhq, json

When compiling, you must define a conditional symbol of SSL, to enable SSL support. For example:

nim c -d:SSL -r file.nim

Example Usage

Creating a new hqClient to interface with the API

let client = hqClient(loginToken="ac4321NGx06pCFVHZEfSmD4k5caYE3NbR8utLrvduGJPYGTpkoctVdMGukC5VMFF")

Displaying the schedule

echo client.schedule()

Changing a username

discard(client.changeUsername("ExampleUsername123"))

A note on Nim Limitations

This wrapper was originally inteded to use types, which, for example, would have changed echo client["accessToken"] to echo client.accessToken. While that would be much more preferred, Nim does not currently support types than can vary, as parts of the HQ Trivia API change the type of data they return. As such, using JsonNode's was the best possible solution, despite being the less desirable one. If Nim adds support for this in the future, usage of types may be revisited.

License

MIT