useragents

User Agent parser for nim.

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

Summary

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

Installation

nimble install useragents
choosenim install useragents
git clone https://github.com/treeform/useragents

OS Compatibility

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

Source

Repository https://github.com/treeform/useragents
Homepage https://github.com/treeform/useragents
Documentation View Documentation
Registry Source nimble_official

README

Useragent parser for nim.

nimble install useragents

Github Actions

API reference

This library has no dependencies other than the Nim standard libarary.

About

Module provides just one function to parse a user agent:

import useragents
echo parseUserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36")

UserAgent(
    browserName: "Chrome",
    browserMajorVersion: "61",
    browserMinorVersion: "0",
    browserPatchVersion: "3163",
    browserPatchMinorVersion: "",
    osName: "Mac OS X",
    osMajorVersion: "10",
    osMinorVersion: "12",
    osPatchVersion: "3",
    osPatchMinorVersion: "",
    deviceName: "Other",
    deviceBrand: "",
    deviceModel: ""
)

Provides 5,000 lines of regex and another 90,000 lines of tests to make sure event the most arcane user agents are parsed. Based on the work done by: https://github.com/ua-parser/uap-core