Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.


Made in Ukraine Hatch project linting - Ruff code style - Black types - Mypy License - MIT

PyPI - Downloads

About

Dali (Dalí) - Powerful rendering of your source code.

It can render any* source code into an image.

Dali

Image: httpie source code (Dali v1.0.0-beta1)

arguments: window_controls=True, background='#576574'

Why Dali?

Dali is writen in Python language and has a high speed enough. Requires no network connection or specific operation system (Microsoft Windows has not been tested :upside_down_face:).

Dali uses Pygments for syntax highlighter and Pillow-SIMD for rendering. Pygments is used in GitHub on Jupyter Notebook pages & GitHub API pages.

You can use it in your project and create a great image of your code.

At the moment Dali is actively developed.

Examples

from file

from dali_renderer import Dali

instance = Dali("<path to save image>/image.png", window_controls=True, background='#576574')
instance.from_file("<path to source code file>")

from string

from dali_renderer import Dali

instance = Dali("<path to save image>/image.png", window_controls=True, background='#576574')
with open("<path to source code file>", 'r') as file:
   code = file.read()
instance.from_string(code)

Install

pip install dali_renderer
pip uninstall pillow
CC="cc -mavx2" pip install -U --force-reinstall pillow-simd

Features

Contributing

pip install hatch
git clone git@github.com:foozzi/Dali.git && cd ./Dali

Test

hatch run test

Lint

hatch run lint:typing # mypy

Formatting

hatch run lint:fmt # black, ruff

Build

hatch clean && hatch build

Release files for dali_renderer 1.0.0b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dali_renderer 1.0.0b2
File Size Uploaded
dali_renderer-1.0.0b2.tar.gz 448.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dali_renderer 1.0.0b2
File Interpreter ABI Platform
dali_renderer-1.0.0b2-py3-none-any.whl Python 3 none any Details

Total release size: 899.0 kB

Release files / dali_renderer-1.0.0b2.tar.gz

Download URL dali_renderer-1.0.0b2.tar.gz
Size 448.0 kB
Tags Source
SHA-256 checksum
How to use checksums
561238c711be6289d689bd8a74e58433cbca673a74dd6fd35925e746ed61d8cc
BLAKE2b-256 checksum
How to use checksums
031c3b125ef1a1766e61b9fff2e45ea34b2457d721b016e660266e121f8d5176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.3

Release files / dali_renderer-1.0.0b2-py3-none-any.whl

Download URL dali_renderer-1.0.0b2-py3-none-any.whl
Size 451.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2a0f11395901b42e9692331a153d6790cff691837b0a1f36a5a38f966a0f17f
BLAKE2b-256 checksum
How to use checksums
ef5a1252ce40a1a9c47f0e70a42dd11726589a5961e0ea65ff93cb712bd0caab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.23.3

Release history Release notifications | RSS feed

This release

1.0.0b2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page