{"id":23897630,"url":"https://github.com/pixincreate/zparse","last_synced_at":"2026-05-17T01:36:14.174Z","repository":{"id":270256303,"uuid":"908320246","full_name":"pixincreate/zParse","owner":"pixincreate","description":"A zero-dependency JSON/TOML parser and converter that handles your data like a cybernetic octopus juggling bits through a quantum circus 🦀🎪✨","archived":false,"fork":false,"pushed_at":"2025-02-07T19:03:30.000Z","size":130,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T19:28:46.367Z","etag":null,"topics":["formatter","json-files","json-parser","json-schema","rust-lang","toml-files","toml-parser"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pixincreate.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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-12-25T18:14:52.000Z","updated_at":"2025-02-07T19:03:14.000Z","dependencies_parsed_at":"2024-12-29T19:28:37.973Z","dependency_job_id":"14846808-1373-4889-bb2c-51c2fd34cc3e","html_url":"https://github.com/pixincreate/zParse","commit_stats":null,"previous_names":["pixincreate/zparse"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixincreate%2FzParse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixincreate%2FzParse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixincreate%2FzParse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixincreate%2FzParse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixincreate","download_url":"https://codeload.github.com/pixincreate/zParse/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240286514,"owners_count":19777354,"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":["formatter","json-files","json-parser","json-schema","rust-lang","toml-files","toml-parser"],"created_at":"2025-01-04T17:17:00.256Z","updated_at":"2026-05-17T01:36:09.153Z","avatar_url":"https://github.com/pixincreate.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zParse\n\nA zero-dependency robust JSON/TOML parser and converter that handles your data like a cybernetic octopus juggling bits through a quantum circus 🦀🎪✨\n\n## Features\n\n- Parse JSON and TOML files with detailed error handling\n- Convert between JSON and TOML formats\n- Pretty printing with customizable formatting\n- Zero unsafe code\n- Comprehensive test coverage including property-based tests\n- Extensive fuzzing infrastructure\n- Fast and memory efficient\n- Security protections against DoS attacks\n- Detailed error messages with line/column information\n\n## Installation\n\nAdd to your Cargo.toml:\n\n```toml\n[dependencies]\nzparse = \"1.0.0\"\n```\n\n## Verifying Downloads\n\nFor security, zParse release binaries come with both SHA-256 checksums (`.sha256` files) and SSH signatures (`.sig` files). It is recommended to verify both before using downloaded binaries.\n\n### Verifying SSH Signatures\n\nSSH signatures cryptographically verify that the binary was signed by the zParse project maintainer's private key.\n\nTo verify the digital signatures of the downloads, follow [the steps here](https://github.com/pixincreate/pixincreate/blob/main/VERIFY_SSH_SIGNATURES.md).\n\n### Verifying SHA-256 Checksums\n\nSHA-256 checksums verify file integrity, ensuring the download wasn't corrupted or tampered with.\n\nTo verify the SHA256 checksums, use the following commands:\n\n- For Unix-like systems and Windows (Command Prompt):\n\n  ```bash\n  sha256sum -c \u003cfilename\u003e.sha256\n  ```\n\n- For Windows (PowerShell):\n\n  ```powershell\n  Get-FileHash \"target/package/zparse-\u003cplatform\u003e-\u003cplatform-arch\u003e.\u003cextension\u003e\" -Algorithm SHA256\n  ```\n\nIf the file is successfully verified, the output will be:\n\n```shell\ntarget/package/\u003cBINARY_NAME\u003e: OK\n```\n\n## Usage\n\n### Command Line\n\n```bash\n# Parse and display a file\nzparse --file input.json\n\n# Convert between formats\nzparse --file input.json --convert toml\nzparse --file config.toml --convert json\n\n# Convert and save to file\nzparse --file input.json --convert toml --output output.toml\n```\n\n### Library Usage\n\n#### Basic Parsing\n\n```rust\nuse zparse::{parse_file, utils::{parse_json, parse_toml}, Result, Value};\n\n// Parse a file with automatic format detection\nlet value = parse_file(\"config.json\")?;\n\n// Parse strings directly\nlet json_str = r#\"{\"name\": \"test\", \"value\": 42}\"#;\nlet json_value = parse_json(json_str)?;\n\nlet toml_str = r#\"\nname = \"test\"\nvalue = 42\n\"#;\nlet toml_value = parse_toml(toml_str)?;\n```\n\n#### Format Conversion\n\n```rust\nuse zparse::{converter::Converter, utils::{parse_json, format_toml}, Result};\n\n// Convert JSON to TOML\nlet json_str = r#\"{\"name\": \"test\", \"value\": 42, \"nested\": {\"key\": \"value\"}}\"#;\nlet json_value = parse_json(json_str)?;\nlet toml_value = Converter::json_to_toml(\u0026json_value)?;\n\n// Format as TOML string\nlet toml_str = format_toml(\u0026toml_value)?;\nprintln!(\"TOML output:\\n{}\", toml_str);\n```\n\n#### Accessing Data\n\n```rust\nuse zparse::{utils::parse_json, ValueExt, Result};\n\nlet json_str = r#\"{\"name\": \"test\", \"values\": [1, 2, 3], \"settings\": {\"enabled\": true}}\"#;\nlet value = parse_json(json_str)?;\n\n// Use ValueExt trait methods\nlet name = value.get_string(\"name\").unwrap_or_default();\nlet enabled = value.get_bool(\"settings.enabled\").unwrap_or(false);\n\n// Direct access\nif let Some(Value::Array(values)) = value.as_map().and_then(|m| m.get(\"values\")) {\n    for value in values {\n        println!(\"Value: {}\", value);\n    }\n}\n```\n\n#### Custom Formatting\n\n```rust\nuse zparse::{formatter::{FormatConfig, JsonFormatter, Formatter}, utils::parse_json, Result};\n\nlet json_str = r#\"{\"compact\": true, \"indentation\": 4}\"#;\nlet value = parse_json(json_str)?;\n\n// Custom formatting options\nlet config = FormatConfig {\n    indent_spaces: 4,\n    sort_keys: true,\n};\n\nlet formatter = JsonFormatter;\nlet formatted = formatter.format(\u0026value, \u0026config)?;\nprintln!(\"Custom formatted:\\n{}\", formatted);\n```\n\n### Error Handling\n\nThe library provides detailed error information:\n\n```rust\nuse zparse::{parse_file, Result};\n\nmatch parse_file(\"config.json\") {\n    Ok(value) =\u003e println!(\"Parsed successfully: {}\", value),\n    Err(e) =\u003e {\n        eprintln!(\"Error parsing file:\");\n        if let Some(loc) = e.location() {\n            eprintln!(\"  At line {}, column {}\", loc.line, loc.column);\n        }\n        eprintln!(\"  {}\", e);\n\n        // Check specific error types\n        match e.kind() {\n            ParseErrorKind::Syntax(_) =\u003e eprintln!(\"Syntax error in the file\"),\n            ParseErrorKind::Semantic(_) =\u003e eprintln!(\"Semantic error in the file\"),\n            _ =\u003e eprintln!(\"Other error type\"),\n        }\n    }\n}\n```\n\n## Security Features\n\nzParse includes built-in protection against:\n\n- Stack overflows from deeply nested structures\n- Memory exhaustion from large inputs\n- CPU denial of service from pathological inputs\n\nThese limits can be customized:\n\n```rust\nuse zparse::{parser::{json::JsonParser, config::ParserConfig}, Result};\n\nlet input = r#\"{\"key\": \"value\"}\"#;\nlet config = ParserConfig {\n    max_depth: 32,         // Maximum nesting depth\n    max_size: 1_048_576,   // Maximum input size (1MB)\n    max_string_length: 10_000, // Maximum string length\n    max_object_entries: 1_000, // Maximum entries in an object\n};\n\nlet parser = JsonParser::new(input)?.with_config(config);\nlet value = parser.parse()?;\n```\n\n## Contributing\n\nContributions welcome! Please read our [contributing guidelines](CONTRIBUTING.md).\n\nTo run tests and benchmarks:\n\n```bash\n# Run all tests\ncargo test\n\n# Run benchmarks\ncargo bench\n\n# Run fuzz testing (requires nightly)\ncargo +nightly fuzz run json_parser\ncargo +nightly fuzz run toml_parser\n```\n\n## License\n\nThis project is licensed under GPL-3.0. See [LICENSE](LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixincreate%2Fzparse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixincreate%2Fzparse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixincreate%2Fzparse/lists"}