{"id":48061625,"url":"https://github.com/bojarlab/glycorender","last_synced_at":"2026-04-04T14:33:14.460Z","repository":{"id":284185865,"uuid":"954108622","full_name":"BojarLab/glycorender","owner":"BojarLab","description":"Bespoke renderer for GlycoDraw .svg into .pdf/.png","archived":false,"fork":false,"pushed_at":"2026-02-05T14:07:01.000Z","size":372,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-05T22:45:16.273Z","etag":null,"topics":["glycans","glycoinformatics","pdf","renderer","svg"],"latest_commit_sha":null,"homepage":"","language":"Python","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/BojarLab.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-24T15:18:04.000Z","updated_at":"2026-02-05T14:06:26.000Z","dependencies_parsed_at":"2025-04-16T14:56:55.213Z","dependency_job_id":null,"html_url":"https://github.com/BojarLab/glycorender","commit_stats":null,"previous_names":["bojarlab/glycorender"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/BojarLab/glycorender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BojarLab%2Fglycorender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BojarLab%2Fglycorender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BojarLab%2Fglycorender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BojarLab%2Fglycorender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BojarLab","download_url":"https://codeload.github.com/BojarLab/glycorender/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BojarLab%2Fglycorender/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31402783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: 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":["glycans","glycoinformatics","pdf","renderer","svg"],"created_at":"2026-04-04T14:33:13.786Z","updated_at":"2026-04-04T14:33:14.442Z","avatar_url":"https://github.com/BojarLab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"glycorender_logo.png\" alt=\"glycorender Logo\" width=\"400\"/\u003e\n\u003c/p\u003e\n\n# glycorender\n\nA bespoke SVG to PDF/PNG renderer for the GlycoDraw platform, specialized in accurately rendering glycan structures with support for chemical notations and path-based text positioning.\n\n[![PyPI version](https://img.shields.io/pypi/v/glycorender.svg)](https://pypi.org/project/glycorender/)\n[![Python Version](https://img.shields.io/pypi/pyversions/glycorender.svg)](https://pypi.org/project/glycorender/)\n[![License](https://img.shields.io/github/license/BojarLab/glycorender.svg)](LICENSE)\n\n## Features\n\n- Accurate SVG to PDF and PNG conversion for glycan structures\n- Support for text on paths with proper positioning and orientation\n- Special handling for monosaccharide properties like \"Df\" with proper styling\n- Gradient fills for circles and shapes\n- Precise connection path rendering between glycan elements\n- Support for various SVG path commands\n\n## Installation\n\n```bash\npip install glycorender\n```\n\n## Quick Start\n\n```python\nfrom glycorender import convert_svg_to_pdf, convert_svg_to_png\n\n# Convert SVG file to PDF\nwith open('glycan_structure.svg', 'r') as f:\n    svg_data = f.read()\n    \nconvert_svg_to_pdf(svg_data, 'output.pdf')\n\n# Convert SVG file to PNG\nconvert_svg_to_png(svg_data, 'output.png')\n\n# Or directly from SVG data\nsvg_data = \"\"\"...\"\"\"\nconvert_svg_to_pdf(svg_data, 'output.pdf')\nconvert_svg_to_png(svg_data, 'output.png')\n```\n\n## Use Cases\n\nGlycoRender is specifically designed for:\n\n- Converting glycan structure diagrams from GlycoDraw to publication-quality PDFs or PNGs\n- Preserving the exact layout and styling of complex carbohydrate representations\n- Ensuring chemical notations are properly formatted in the output\n- Maintaining the correct connections between monosaccharide units\n\n## API Reference\n\n### `convert_svg_to_pdf(svg_data, pdf_file_path)`\n\nConverts SVG data to a PDF file.\n\nParameters:\n- `svg_data` (str or bytes): SVG content either as a string or bytes\n- `pdf_file_path` (str): Path where the output PDF should be saved\n\n### `convert_svg_to_png(svg_data, png_file_path)`\n\nConverts SVG data to a PNG file.\n\nParameters:\n- `svg_data` (str or bytes): SVG content either as a string or bytes\n- `png_file_path` (str): Path where the output PNG should be saved\n\n## Supported SVG Elements\n\n- `\u003cpath\u003e`: Full support for path commands (M, L, H, V, Z, etc.)\n- `\u003ccircle\u003e`: Support for basic circles and gradient-filled circles\n- `\u003crect\u003e`: Support for rectangles with stroke and fill\n- `\u003ctext\u003e` and `\u003ctextPath\u003e`: Support for text placement along paths with proper orientation\n- `\u003cdefs\u003e`: Support for path and gradient definitions\n- `\u003cradialGradient\u003e`: Support for radial gradients with stops\n\n## Dependencies\n\n- ReportLab: For PDF generation\n- PyMuPDF: For PNG conversion\n- Pillow: For PNG metadata injection\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbojarlab%2Fglycorender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbojarlab%2Fglycorender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbojarlab%2Fglycorender/lists"}