{"id":13637275,"url":"https://github.com/igumnoff/shiva","last_synced_at":"2026-04-07T04:31:57.863Z","repository":{"id":228419273,"uuid":"773929645","full_name":"igumnoff/shiva","owner":"igumnoff","description":"Shiva library: Implementation in Rust of a parser and generator for documents of any type","archived":false,"fork":false,"pushed_at":"2024-11-07T04:24:57.000Z","size":53662,"stargazers_count":414,"open_issues_count":25,"forks_count":21,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-01-02T10:57:26.969Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.rs/shiva","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igumnoff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-18T16:39:01.000Z","updated_at":"2025-12-30T17:39:26.000Z","dependencies_parsed_at":"2024-03-23T12:20:22.300Z","dependency_job_id":"857ee387-1385-4414-89af-41299cbdc497","html_url":"https://github.com/igumnoff/shiva","commit_stats":null,"previous_names":["igumnoff/shiva"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/igumnoff/shiva","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igumnoff%2Fshiva","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igumnoff%2Fshiva/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igumnoff%2Fshiva/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igumnoff%2Fshiva/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igumnoff","download_url":"https://codeload.github.com/igumnoff/shiva/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igumnoff%2Fshiva/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31500397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-08-02T00:01:14.314Z","updated_at":"2026-04-07T04:31:57.843Z","avatar_url":"https://github.com/igumnoff.png","language":"Rust","funding_links":[],"categories":["Libraries","Rust"],"sub_categories":["Parsing"],"readme":"# Shiva\n\n![shiva](https://github.com/igumnoff/shiva/raw/HEAD/logo.png)\n\n**Shiva library: Implementation in Rust of a parser and generator for documents of any type**\n\n## Features\n- [x] Common Document Model (CDM) for all document types\n- [x] Parsers produce CDM\n- [x] Generators consume CDM\n\n## Common Document Model\n\n![Common Document Model](https://github.com/igumnoff/shiva/raw/HEAD/CDM.png)\n\n\n## Supported document types\n\n| Document type | Parse | Generate |\n|---------------|-------|----------|\n| Plain text    | +     | +        |\n| Markdown      | +     | +        |\n| HTML          | +     | +        |\n| PDF           | +     | +        |\n| JSON          | +     | +        |\n| XML           | +     | +        |\n| CSV           | +     | +        |\n| RTF           | +     | +        |\n| DOCX          | +     | +        |\n| XLS           | +     | -        |\n| XLSX          | +     | +        |\n| ODS           | +     | +        |\n| Typst         | -     | +        |\n\n\n## Parse document features\n\n| Document type | Header | Paragraph | List | Table | Image | Hyperlink | PageHeader | PageFooter |\n|---------------|--------|-----------|------|-------|-------|-----------|------------|------------|\n| Plain text    | -      | +         | -    | -     | -     | -         | -          | -          |\n| Markdown      | +      | +         | +    | +     | +     | +         | -          | -          |\n| HTML          | +      | +         | +    | +     | +     | +         | -          | -          |\n| PDF           | -      | +         | +    | -     | -     | -         | -          | -          |\n| DOCX          | +      | +         | +    | +     | -     | +         | -          | -          |\n| RTF           | +      | +         | +    | +     | -     | +         | +          | +          |\n| JSON          | +      | +         | +    | +     | -     | +         | +          | +          |\n| XML           | +      | +         | +    | +     | +     | +         | +          | +          |\n| CSV           | -      | -         | -    | +     | -     | -         | -          | -          |\n| XLS           | -      | -         | -    | +     | -     | -         | -          | -          |\n| XLSX          | -      | -         | -    | +     | -     | -         | -          | -          |\n| ODS           | -      | -         | -    | +     | -     | -         | -          | -          |\n\n## Generate document features\n\n| Document type | Header | Paragraph | List | Table | Image | Hyperlink | PageHeader | PageFooter |\n|---------------|--------|-----------|------|-------|-------|-----------|------------|------------|\n| Plain text    | +      | +         | +    | +     | -     | +         | +          | +          |\n| Markdown      | +      | +         | +    | +     | +     | +         | +          | +          |\n| HTML          | +      | +         | +    | +     | +     | +         | -          | -          |\n| PDF           | +      | +         | +    | +     | +     | +         | +          | +          |\n| DOCX          | +      | +         | +    | +     | +     | +         | -          | -          |\n| RTF           | +      | +         | +    | +     | +     | +         | -          | -          |\n| JSON          | +      | +         | +    | +     | -     | +         | +          | +          |\n| XML           | +      | +         | +    | +     | +     | +         | +          | +          |\n| CSV           | -      | -         | -    | +     | -     | -         | -          | -          |\n| XLSX          | -      | -         | -    | +     | -     | -         | -          | -          |\n| ODS           | -      | -         | -    | +     | -     | -         | -          | -          |\n| Typst         | +      | +         | +    | +     | +     | +         | +          | +          |\n\n\n\n## Usage Shiva library\n\nCargo.toml\n```toml\n[dependencies]\nshiva = {  version = \"1.4.9\", features = [\"html\", \"markdown\", \"text\", \"pdf\", \"json\", \n    \"csv\", \"rtf\", \"docx\", \"xml\", \"xls\", \"xlsx\", \"ods\", \"typst\"] }\n```\n\nmain.rs\n```rust\nfn main() {\n    let input_vec = std::fs::read(\"input.html\").unwrap();\n    let input_bytes = bytes::Bytes::from(input_vec);\n    let document = shiva::html::Transformer::parse(\u0026input_bytes).unwrap();\n    let output_bytes = shiva::markdown::Transformer::generate(\u0026document).unwrap();\n    std::fs::write(\"out.md\", output_bytes).unwrap();\n}\n```\n\n\n## Shiva CLI \u0026 Server\n### Build executable Shiva CLI and Shiva Server\n```bash\ngit clone https://github.com/igumnoff/shiva.git\ncd shiva/cli\ncargo build --release\n```\n### Run executable Shiva CLI\n```bash\ncd ./target/release/\n./shiva README.md README.html\n```\n\n### Run Shiva Server\n```bash\ncd ./target/release/\n./shiva-server --port=8080 --host=127.0.0.1\n```\n\n## Who uses Shiva\n- [Metatron library: Implementation in Rust of a report generation](https://github.com/igumnoff/metatron)\n\n\n## Contributing\nI would love to see contributions from the community. If you experience bugs, feel free to open an issue. If you would like to implement a new feature or bug fix, please follow the steps:\n\n1. Do fork \n2. Add comment to the [issue](https://github.com/igumnoff/shiva/issues) that you are going to work on it\n3. Create pull request\n\n\nIf you would like add new document type, you need to implement the following traits:\n\n### Required: shiva::core::TransformerTrait\n```rust\npub trait TransformerTrait {\n    fn parse(document: \u0026Bytes) -\u003e anyhow::Result\u003cDocument\u003e;\n    fn generate(document: \u0026Document) -\u003e anyhow::Result\u003cBytes\u003e;\n}\n\n```\n\n\n### Optional: shiva::core::TransformerWithImageLoaderSaverTrait (If images store outside of document for example: HTML, Markdown)\n\n```rust\npub trait TransformerWithImageLoaderSaverTrait {\n    fn parse_with_loader\u003cF\u003e(document: \u0026Bytes,  image_loader: F) -\u003e anyhow::Result\u003cDocument\u003e\n        where F: Fn(\u0026str) -\u003e anyhow::Result\u003cBytes\u003e;\n    fn generate_with_saver\u003cF\u003e(document: \u0026Document,  image_saver: F) -\u003e anyhow::Result\u003cBytes\u003e\n        where F: Fn(\u0026Bytes, \u0026str) -\u003e anyhow::Result\u003c()\u003e;\n}\n```\n\n\n#### License\n\n\u003csup\u003e\nLicensed under either of \u003ca href=\"LICENSE-APACHE\"\u003eApache License, Version\n2.0\u003c/a\u003e or \u003ca href=\"LICENSE-MIT\"\u003eMIT license\u003c/a\u003e at your option.\n\u003c/sup\u003e\n\n\u003cbr\u003e\n\n\u003csub\u003e\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in Shiva by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\u003c/sub\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figumnoff%2Fshiva","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figumnoff%2Fshiva","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figumnoff%2Fshiva/lists"}