| Crates.io | agent-parser-ro |
| lib.rs | agent-parser-ro |
| version | 0.1.1 |
| created_at | 2025-05-21 09:02:38.950829+00 |
| updated_at | 2025-05-21 10:03:02.187826+00 |
| description | A comprehensive user agent string parser that detects browser, operating system, and device type |
| homepage | |
| repository | https://github.com/kak-smko/agent-parser-ro |
| max_upload_size | |
| id | 1683123 |
| size | 39,705 |
A fast and comprehensive user agent string parser for Rust that detects:
Add this to your Cargo.toml:
[dependencies]
agent-parser-ro = "0.1"
use agent_parser_ro::{UserAgentParser, Browser, OperatingSystem, DeviceType};
let info = UserAgentParser::parse("Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1");
assert_eq!(info.os, OperatingSystem::IOS);
assert_eq!(info.browser, Browser::Safari);
assert_eq!(info.device_type, DeviceType::Mobile);
Contributions are welcome! Please open an issue or submit a PR for:
New browser/OS/device detection
Performance improvements
Bug fixes
Dual-licensed under MIT or Apache 2.0 at your option.