{"id":30277012,"url":"https://github.com/trymirai/swift-sensors","last_synced_at":"2025-12-11T22:50:52.669Z","repository":{"id":283569152,"uuid":"950956980","full_name":"trymirai/swift-sensors","owner":"trymirai","description":"A Swift package that uses IOKit private APIs and exposes system sensor data including thermal, voltage, current, memory, etc.","archived":false,"fork":false,"pushed_at":"2025-03-20T22:46:17.000Z","size":1274,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-11-18T10:03:52.871Z","etag":null,"topics":["battery-monitoring","cpu-monitoring","diagnostics","iokit","ios","memory-monitoring","performance-monitoring","sensors","swift","system-monitoring","thermal-monitoring"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trymirai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-19T00:13:27.000Z","updated_at":"2025-08-07T12:31:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"0c16c206-2060-4a12-bb28-3acd79729df8","html_url":"https://github.com/trymirai/swift-sensors","commit_stats":null,"previous_names":["getmirai/swift-sensors","trymirai/swift-sensors"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/trymirai/swift-sensors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trymirai%2Fswift-sensors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trymirai%2Fswift-sensors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trymirai%2Fswift-sensors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trymirai%2Fswift-sensors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trymirai","download_url":"https://codeload.github.com/trymirai/swift-sensors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trymirai%2Fswift-sensors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27672062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-11T02:00:11.302Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["battery-monitoring","cpu-monitoring","diagnostics","iokit","ios","memory-monitoring","performance-monitoring","sensors","swift","system-monitoring","thermal-monitoring"],"created_at":"2025-08-16T11:11:51.409Z","updated_at":"2025-12-11T22:50:52.628Z","avatar_url":"https://github.com/trymirai.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftSensors\n\n[![Platform Compatibility](https://img.shields.io/badge/Platforms-iOS-brightgreen)](https://swift.org/platforms/)\n[![Swift Version](https://img.shields.io/badge/Swift-6.0-orange)](https://swift.org)\n\u003ca href=\"https://notebooklm.google.com/notebook/5851ef05-463e-4d30-bd9b-01f7668e8f8f/audio\"\u003e\u003cimg src=\"https://img.shields.io/badge/Listen-Podcast-red\" alt=\"Listen to our Podcast\"\u003e\u003c/a\u003e\n\u003ca href=\"https://docsend.com/view/x87pcxrnqutb9k2q\"\u003e\u003cimg src=\"https://img.shields.io/badge/View-Our%20Deck-green\" alt=\"View our Deck\"\u003e\u003c/a\u003e\n\u003ca href=\"mailto:dima@getmirai.co,Alexey@getmirai.co?subject=Interested%20in%20Mirai\"\u003e\u003cimg src=\"https://img.shields.io/badge/Contact%20Us-Email-blue\" alt=\"Contact Us\"\u003e\u003c/a\u003e\n\nA Swift package for accessing real device sensor readings, including thermal, voltage, current, memory, CPU, and disk statistics.\n\n\u003cp align=\"left\"\u003e\n    \u003cimg src=\"Media/swift_sensors.png\", width=\"260\"\u003e\n\u003c/p\u003e\n\n## Features\n\n- Access thermal, voltage, current sensors readings\n- Memory usage statistics\n- CPU usage statistics\n- Disk space information\n- System information\n- Battery information\n- Formatted output for human-readable display\n\n## Installation\n\n### Swift Package Manager\n\nAdd the following to your `Package.swift` file:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/getmirai/swift-sensors.git\", from: \"0.0.1\")\n]\n```\n\n## Usage\n\n```swift\nimport SwiftSensors\n\n// Get an instance of the sensor manager\nlet sensors = SwiftSensors.shared\n\n// Get thermal sensor readings\nlet thermalReadings = await sensors.getThermalSensorReadings()\nfor reading in thermalReadings {\n    print(\"\\(reading.name): \\(SensorFormatter.shared.formatTemperature(reading.temperature))\")\n}\n\n// Get voltage sensor readings\nlet voltageReadings = await sensors.getVoltageSensorReadings()\nfor reading in voltageReadings {\n    print(\"\\(reading.name): \\(reading.voltage)V\")\n}\n\n// Get current sensor readings\nlet currentReadings = await sensors.getCurrentSensorReadings()\nfor reading in currentReadings {\n    print(\"\\(reading.name): \\(reading.current)A\")\n}\n\n// Get memory statistics\nlet memoryStats = await sensors.getMemoryStats()\nprint(\"Memory Usage: \\(await sensors.getFormattedMemoryUsage())\")\n\n// Get CPU statistics\nlet cpuStats = await sensors.getCPUStats()\nprint(\"CPU Usage: \\(await sensors.getFormattedCPUUsage())\")\n\n// Get disk statistics\nlet diskStats = await sensors.getDiskStats()\nprint(\"Disk Usage: \\(await sensors.getFormattedDiskUsage())\")\n\n// Get thermal state\nlet thermalState = await sensors.getThermalState()\nprint(\"Thermal State: \\(thermalState.rawValue)\")\n\n// Get system uptime\nprint(\"System Uptime: \\(await sensors.getFormattedUptime())\")\n```\n\n## Note on Private APIs\n\nThis package uses private APIs to access internal device sensors including thermal, voltage, and current readings. While this works well for development and diagnostic purposes, be aware that using private APIs may not be acceptable for App Store submissions.\n\n## License\n\nThis project is available under the MIT license. See the [LICENSE](LICENSE) file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrymirai%2Fswift-sensors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrymirai%2Fswift-sensors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrymirai%2Fswift-sensors/lists"}