{"id":20207924,"url":"https://github.com/thearchitector/styled-prose","last_synced_at":"2026-05-10T13:20:55.175Z","repository":{"id":210831816,"uuid":"726922325","full_name":"thearchitector/styled-prose","owner":"thearchitector","description":"Generate images and thumbnails based on bitmap transformations of rendered prose","archived":false,"fork":false,"pushed_at":"2023-12-18T04:08:14.000Z","size":989,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-15T06:48:29.525Z","etag":null,"topics":["art","fonts","image","pdf","pdf2image","pillow","prose","render","text","tgf","the-glass-files","typography","writing"],"latest_commit_sha":null,"homepage":"https://styledprose.thearchitector.dev/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thearchitector.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}},"created_at":"2023-12-03T19:40:59.000Z","updated_at":"2023-12-28T01:18:17.000Z","dependencies_parsed_at":"2024-11-14T05:33:26.086Z","dependency_job_id":"4d53a16b-24a8-4765-aa85-4322433387a1","html_url":"https://github.com/thearchitector/styled-prose","commit_stats":null,"previous_names":["thearchitector/styled-prose"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearchitector%2Fstyled-prose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearchitector%2Fstyled-prose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearchitector%2Fstyled-prose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thearchitector%2Fstyled-prose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thearchitector","download_url":"https://codeload.github.com/thearchitector/styled-prose/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241644558,"owners_count":19996179,"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":["art","fonts","image","pdf","pdf2image","pillow","prose","render","text","tgf","the-glass-files","typography","writing"],"created_at":"2024-11-14T05:33:18.394Z","updated_at":"2025-11-11T20:35:14.149Z","avatar_url":"https://github.com/thearchitector.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# styled-prose\n\n![GitHub Workflow Status](https://raster.shields.io/github/actions/workflow/status/thearchitector/styled-prose/ci.yaml?label=tests\u0026style=flat-square)\n![PyPI - Downloads](https://raster.shields.io/pypi/dw/styled-prose?style=flat-square)\n![GitHub](https://raster.shields.io/github/license/thearchitector/styled-prose?style=flat-square)\n\nGenerate images and thumbnails based on bitmap transformations of rendered prose.\n\nDocumentation: \u003chttps://styledprose.thearchitector.dev\u003e.\n\nTested support on Python 3.8, 3.9, 3.10, 3.11, and 3.12.\n\n```sh\n$ pdm add styled-prose\n# or\n$ pip install --user styled-prose\n```\n\n## Example\n\nThe following stylesheet is a super simple example that overrides the `default` style's font size and family.\n\n```toml\n# stylesheet.toml\n\n[[fonts]]\nfont_name = \"EB Garamond\"\nfrom_google_fonts = true\n\n[[styles]]\nname = \"default\"\nfont_size = 14\nfont_name = \"EB Garamond\"\n```\n\nUsing that stylesheet, and some basic prose, you can generate an image. The requested font family `EB Garamond` and its license are downloaded from Google Fonts and cached automatically; subsequent generations use those cached fonts.\n\n```python\nfrom PIL import Image\nfrom styled_prose import StyledProseGenerator\n\ntext: str = \"\"\"\nThis is normal.\n\n\u003ci\u003eThis is italicized.\u003c/i\u003e\n\n\u003cb\u003eThis is bold.\u003c/b\u003e\n\n\u003ci\u003e\u003cb\u003eThis is bold and italicized.\u003c/b\u003e\u003c/i\u003e\n\n\u003cu\u003eThis is underlined.\u003c/u\u003e\n\n\u003cstrike\u003eThis is struck from the record.\u003c/strike\u003e\n\"\"\"\nrandom.seed(771999)\n\ngenerator: StyledProseGenerator = StyledProseGenerator(\"stylesheet.toml\")\nimg: Image.Image = generator.create_jpg(\n    text,\n    angle=-2.5, # optional; an angle by which to rotate the image\n    thumbnail=(210, 210), # optional; the dimensions of a random thumbnail\n)\n\nimg.save(\"prose.jpg\", quality=95)\n```\n\nThis above code produces the following image:\n\n![example rendering](/docs/simple.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthearchitector%2Fstyled-prose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthearchitector%2Fstyled-prose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthearchitector%2Fstyled-prose/lists"}