{"id":33380588,"url":"https://github.com/tilman151/pypst","last_synced_at":"2026-04-08T19:31:49.323Z","repository":{"id":252420444,"uuid":"840392408","full_name":"tilman151/pypst","owner":"tilman151","description":"Declarative Typst in Python with Pandas data frame support.","archived":false,"fork":false,"pushed_at":"2025-12-28T23:16:54.000Z","size":1630,"stargazers_count":45,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-31T16:45:58.338Z","etag":null,"topics":["pandas","pdf-generation","python","typst"],"latest_commit_sha":null,"homepage":"https://krokotsch.eu/pypst/","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/tilman151.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-09T15:48:01.000Z","updated_at":"2025-12-30T09:28:32.000Z","dependencies_parsed_at":"2024-08-15T09:24:54.936Z","dependency_job_id":null,"html_url":"https://github.com/tilman151/pypst","commit_stats":null,"previous_names":["tilman151/pypst"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/tilman151/pypst","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilman151%2Fpypst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilman151%2Fpypst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilman151%2Fpypst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilman151%2Fpypst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tilman151","download_url":"https://codeload.github.com/tilman151/pypst/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tilman151%2Fpypst/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31571600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"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":["pandas","pdf-generation","python","typst"],"created_at":"2025-11-23T03:00:27.314Z","updated_at":"2026-04-08T19:31:49.313Z","avatar_url":"https://github.com/tilman151.png","language":"Python","funding_links":[],"categories":["Integrations \u0026 Tools"],"sub_categories":["Programming"],"readme":"# Pypst\n\nDeclarative Typst in Python with Pandas data frame support.\n\nPypst helps you dynamically generate [Typst](https://typst.app) code directly in Python. No manual string manipulation required.\nIt has two major use cases:\n\n- Generating full Typst documents to be rendered as PDFs\n- Generating and styling Typst tables from Pandas data frames to be included in another Typst document\n\nPypst produces human-readable Typst code that you can modify and extend.\nIt will not compile Typst code for you, but you can either use the [Typst compiler](https://github.com/typst/typst/releases) to do so in the command line or install the [Typst Python package](https://pypi.org/project/typst/).\n\n![Example script and output](docs/examples/example.png)\n\n## Installation\n\nPypst is available on PyPI and can be installed via pip.\n\n```bash\npip install pypst\n```\n\nTo use the table functionality, `pandas` is needed.\nInstall Pypsts like this instead:\n\n```bash\npip install pypst[pandas]\n```\n\n## Usage\n\nPypst contains classes that represent Typst elements.\nYou can create a Typst document by instantiating these classes and nesting them as needed.\n\n```pycon\n\u003e\u003e\u003e import pypst\n\u003e\u003e\u003e heading = pypst.Heading(\"My Heading\", level=1)\n\u003e\u003e\u003e itemize = pypst.Itemize([\"First item\", \"Second item\", \"Third item\"])\n\n```\n\nEach of these classes has a `render` method that returns the Typst code as a string.\n\n```pycon\n\u003e\u003e\u003e print(heading.render())\n= My Heading\n\u003e\u003e\u003e print(itemize.render())\n- First item\n- Second item\n- Third item\n\n```\n\nIf you want to combine multiple elements into a single document, you can use the `Document` class.\nYou can even add imports for other Typst files or packages.\n\n```pycon\n\u003e\u003e\u003e document = pypst.Document([heading, itemize])\n\u003e\u003e\u003e document.add_import(\"utils.typ\")\n\u003e\u003e\u003e print(document.render())\n#import \"utils.typ\"\n\u003cBLANKLINE\u003e\n= My Heading\n\u003cBLANKLINE\u003e\n- First item\n- Second item\n- Third item\n\n```\n\nThe output of the `render` method can be written to a `.typ` file for compilation.\nThe [documentation](https://krokotsch.eu/pypst) contains more extensive tutorials on generating [documents](https://krokotsch.eu/pypst/usage) and generating [tables from Pandas data frames](https://krokotsch.eu/pypst/pandas).\n\n## Limitations\n\nPypst is not a Typst compiler.\nIt doesn't check for syntax errors or compile Typst code into PDFs.\nPypst interprets any string as a Typst literal, so `stroke = \"1pt\"` will be rendered as `stroke: 1pt`.\nIf you want to pass a string literal, you need to wrap it in quotes, for example, `caption = '\"My Caption\"'`.\nWhen Pypst encounters a string wrapped in quotes without need, it will automatically remove them.\nFor a content block, you can wrap the string in brackets instead, for example, `caption = \"[My content]\"`.\n\n## Roadmap\n\nIf there is time and people are interested, I would like to add the following features:\n\n- [x] Complete table attributes (for example, `fill` is missing)\n- [ ] Support automatic formating for common workflows, like automatically merging multi-level columns with mean and standard deviation\n- [x] Add more Typst elements (like headings or lists) to make building more complex documents easier\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftilman151%2Fpypst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftilman151%2Fpypst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftilman151%2Fpypst/lists"}