{"id":18494417,"url":"https://github.com/macchina-cli/libmacchina","last_synced_at":"2025-05-16T12:10:23.260Z","repository":{"id":38088480,"uuid":"350501949","full_name":"Macchina-CLI/libmacchina","owner":"Macchina-CLI","description":"A library providing access to all sorts of system information.","archived":false,"fork":false,"pushed_at":"2025-02-01T20:39:16.000Z","size":699,"stargazers_count":76,"open_issues_count":22,"forks_count":20,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-10T12:15:43.217Z","etag":null,"topics":["cross-platform","fetch","library","system-information"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/libmacchina","language":"Rust","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/Macchina-CLI.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2021-03-22T22:01:40.000Z","updated_at":"2025-04-26T04:05:35.000Z","dependencies_parsed_at":"2023-12-20T10:43:36.995Z","dependency_job_id":"c0fc23e3-cdea-447c-8c91-1ad59894a29d","html_url":"https://github.com/Macchina-CLI/libmacchina","commit_stats":{"total_commits":384,"total_committers":18,"mean_commits":"21.333333333333332","dds":"0.28645833333333337","last_synced_commit":"13a481250842b8ed5b33e977e230809712aedfd7"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macchina-CLI%2Flibmacchina","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macchina-CLI%2Flibmacchina/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macchina-CLI%2Flibmacchina/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Macchina-CLI%2Flibmacchina/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Macchina-CLI","download_url":"https://codeload.github.com/Macchina-CLI/libmacchina/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254527100,"owners_count":22085919,"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","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":["cross-platform","fetch","library","system-information"],"created_at":"2024-11-06T13:19:37.838Z","updated_at":"2025-05-16T12:10:23.220Z","avatar_url":"https://github.com/Macchina-CLI.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003elibmacchina\u003c/h1\u003e\n\nA library providing access to all sorts of system information.\n\nLinux • macOS • Windows • NetBSD • FreeBSD • Android • OpenWrt\n\n\u003ca href=\"https://crates.io/crates/libmacchina\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/v/libmacchina\" alt=\"version\" /\u003e\n\u003c/a\u003e\n\n\u003ca href=\"https://docs.rs/crate/libmacchina/\"\u003e\n    \u003cimg src=\"https://docs.rs/libmacchina/badge.svg\" alt=\"docs\" /\u003e\n\u003c/a\u003e\n\n\u003c/div\u003e\n\n### Disclaimer\n\n_libmacchina_ utilizes **unsafe** code in the form of calls to system libraries\nthat haven't been natively implemented in Rust, we do this for performance\nreasons.\n\n### Usage\n\nAdd the following to your project's _Cargo.toml_ file:\n\n```toml\nlibmacchina = \"7\"\n```\n\n### Notes\n\nOn distributions like openSUSE that use the `ndb` RPM database format, `librpm`\n(which is usually provided by the `rpm-devel` package) is required for the RPM\npackage count readout to work.\n\n### Examples\n\n```rust\n// Let's import two of the several available types.\nuse libmacchina::{GeneralReadout, MemoryReadout};\n\nfn main() {\n    // Let's import the GeneralReadout trait so we\n    // can fetch some general information about the host.\n    use libmacchina::traits::GeneralReadout as _;\n\n    let general_readout = GeneralReadout::new();\n\n    // There are many more metrics we can query\n    // i.e. username, distribution, terminal, shell, etc.\n    let cpu_cores = general_readout.cpu_cores().unwrap(); // 8 [logical cores]\n    let cpu = general_readout.cpu_model_name().unwrap();  // Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz\n    let uptime = general_readout.uptime().unwrap();       // 1500 [in seconds]\n\n    // Now we'll import the MemoryReadout trait to get an\n    // idea of what the host's memory usage looks like.\n    use libmacchina::traits::MemoryReadout as _;\n\n    let memory_readout = MemoryReadout::new();\n\n    let total_mem = memory_readout.total(); // 20242204 [in kB]\n    let used_mem = memory_readout.used();   // 3894880 [in kB]\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacchina-cli%2Flibmacchina","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacchina-cli%2Flibmacchina","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacchina-cli%2Flibmacchina/lists"}