mirror of
https://github.com/treeform/useragents
synced 2026-01-14 16:51:35 +00:00
No description
| .github/workflows | ||
| build | ||
| nimcache | ||
| tests | ||
| useragents | ||
| .gitignore | ||
| LICENSE | ||
| README.md | ||
| useragents.nim | ||
| useragents.nimble | ||
Useragent parser for nim.
nimble install useragents
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