{"id":20431458,"url":"https://github.com/devyatsu/new-pkl","last_synced_at":"2025-10-26T05:03:54.575Z","repository":{"id":245357887,"uuid":"818020602","full_name":"DevYatsu/new-pkl","owner":"DevYatsu","description":"A rust crate to work with pkl files data efficiently!","archived":false,"fork":false,"pushed_at":"2024-06-27T00:35:21.000Z","size":160,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T07:50:57.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://crates.io/crates/new-pkl","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/DevYatsu.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}},"created_at":"2024-06-20T23:49:46.000Z","updated_at":"2024-06-27T00:30:24.000Z","dependencies_parsed_at":"2025-02-24T07:44:42.886Z","dependency_job_id":"c432a9d6-aae4-477a-a7a8-342d4170477b","html_url":"https://github.com/DevYatsu/new-pkl","commit_stats":null,"previous_names":["devyatsu/new-pkl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DevYatsu/new-pkl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevYatsu%2Fnew-pkl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevYatsu%2Fnew-pkl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevYatsu%2Fnew-pkl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevYatsu%2Fnew-pkl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevYatsu","download_url":"https://codeload.github.com/DevYatsu/new-pkl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevYatsu%2Fnew-pkl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259610457,"owners_count":22884269,"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":[],"created_at":"2024-11-15T08:11:55.747Z","updated_at":"2025-10-26T05:03:54.524Z","avatar_url":"https://github.com/DevYatsu.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# new-pkl\n\nFastest pkl-parsing crate out there!\n\n## Features\n\n- Parse Pkl string into a structured representation (hashmap) in rust\n- Parse Pkl string into an AST\n- Support for strings, integers (decimal, octal, hex, binary), floats, boolean and multiline strings\n- Support for nested objects, amends declaration, amends expression and chained amends declaration\n- Support for classical identifiers, $identifiers, _identifiers and illegal identifiers\n- Support for class instance\n- Support for Duration and Datasize\n\n## Installation\n\nWhen in your rust project, simply run: `cargo add new-pkl`\n\n## Usage\n\nHere's an example of how to parse a PKL string and retrieve values from the context:\n\n```rust\nuse new_pkl::{Pkl, PklResult, PklValue};\n\nfn main() -\u003e PklResult\u003c()\u003e {\n    let source = r#\"\n    bool_var = true\n    int_var = 42\n    float_var = 3.14\n    string_var = \"hello\"\n    object_var {\n        key1 = \"value1\"\n        key2 = 2\n    }\n    \"#;\n\n    let mut pkl = Pkl::new();\n    pkl.parse(source)?;\n\n    println!(\"{:?}\", pkl.get(\"int_var\")); // Ok(PklValue::Int(100))\n\n    // Get values\n    println!(\"{:?}\", pkl.get_bool(\"bool_var\")); // Ok(true)\n    println!(\"{:?}\", pkl.get_int(\"int_var\")); // Ok(42)\n    println!(\"{:?}\", pkl.get_float(\"float_var\")); // Ok(3.14)\n    println!(\"{:?}\", pkl.get_string(\"string_var\")); // Ok(\"hello\")\n    println!(\"{:?}\", pkl.get_object(\"object_var\")); // Ok(HashMap with key1 and key2)\n\n    // Modify values\n    pkl.set(\"int_var\", PklValue::Int(100));\n\n    // Remove values\n    pkl.remove(\"float_var\");\n    println!(\"{:?}\", pkl.get_float(\"float_var\")); // Err(\"Variable `float_var` not found\")\n\n    // Or just generate an ast\n    let mut pkl = Pkl::new();\n    // the ast contains the start and end indexes of each value and statement\n    let ast = pkl.generate_ast(source)?;\n\n    Ok(())\n}\n```\n\n### LICENSE\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevyatsu%2Fnew-pkl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevyatsu%2Fnew-pkl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevyatsu%2Fnew-pkl/lists"}