Skip to main content

A tool to generate images from code with different themes.

Project description

Because Your Code Deserves Art!

Ever wondered why your code looks so dull on a plain text editor? It’s time to bring some pizzazz to your programming! With fotetizar, you can transform your code into beautiful, themed images. Whether you want to share your code with flair or just need a cool screenshot for your portfolio, this tool’s got you covered.

Installation

You can easily install fotetizar from PyPI using pip:

pip install fotetizar

Usage

fotetizar can be used both in code and from the command line.

In Code

Here’s a quick example of how to use fotetizar programmatically:

from fotetizar import render_image

input_file = 'example_script.py'
theme = 'dracula'
font_path = 'path/to/custom/font.ttf'
mode = 'editor'

render_image(input_file, theme, font_path, mode)

This will generate an image of the code in example_script.py using the "dracula" theme and the specified font, in "editor" mode.

In Console

To use fotetizar from the command line, you can run the following command:

fotetizar example_script.py dracula --mode editor

This command generates an image of example_script.py using the "dracula" theme in "editor" mode.

Options / Arguments

Here are the available options and arguments for fotetizar:

  • input_file (required): The path to the input file you want to render. This should be a Python script or any text file containing code.

    • Example: example_script.py
  • theme (required): The color theme to use for rendering.

    • Available themes:
      • monokai
      • blackandwhite
      • solarized
      • gruvbox
      • nord
      • dracula
      • github
      • one_dark
      • atom
      • vscode
      • commodore64
    • Example: dracula
  • --font (optional): Path to a custom font file to use for rendering.

    • Example: path/to/custom/font.ttf
  • --mode (optional): The rendering mode, either "editor" or "console".

    • Example: editor

Example Outputs

Here are some examples of what fotetizar can do:

  1. Generate an image with the "dracula" theme and "editor" mode:

    fotetizar example_script.py dracula --mode editor
    
  2. Generate an image with a custom font and "console" mode:

    fotetizar example_script.py nord --font path/to/custom/font.ttf --mode console
    
  3. Use the "commodore64" theme with default settings:

    fotetizar example_script.py commodore64
    

Example Image Outputs

Here are some examples of the images generated by fotetizar:

atom theme in editor mode.

atom Theme in  editor Mode

console mode.

Console Mode

blackandwhite theme in editor mode.

 Theme in  Mode

dracula theme in editor mode.

 Theme in  Mode

github theme in editor mode.

 Theme in  Mode

gruvbox theme in editor mode.

 Theme in  Mode

monokai theme in editor mode.

 Theme in  Mode

nord theme in editor mode.

 Theme in  Mode

one_dark theme in editor mode.

 Theme in  Mode

solarized theme in editor mode.

 Theme in  Mode

vscode theme in editor mode.

 Theme in  Mode

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fotetizar-0.1.51.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fotetizar-0.1.51-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file fotetizar-0.1.51.tar.gz.

File metadata

  • Download URL: fotetizar-0.1.51.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.8.10 Linux/5.15.0-119-generic

File hashes

Hashes for fotetizar-0.1.51.tar.gz
Algorithm Hash digest
SHA256 2e0f438b36f2ef47f1d9b251c3567fff309c9dc6fe2e6f34cd0d497283b75a98
MD5 8b304c1b49c7f0d08a351f7b73bf347b
BLAKE2b-256 5ef4930e5f842c4b3ff938c4ebac2e1e91643451127b4a134629023046c30d7c

See more details on using hashes here.

File details

Details for the file fotetizar-0.1.51-py3-none-any.whl.

File metadata

  • Download URL: fotetizar-0.1.51-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.0 CPython/3.8.10 Linux/5.15.0-119-generic

File hashes

Hashes for fotetizar-0.1.51-py3-none-any.whl
Algorithm Hash digest
SHA256 a2adef88db3f6e944cb96bcb5a6e2448dea95c473d62ff720d9177a0558c8fb2
MD5 3c9feae6db1b1c0f2b83c5d8b1f874e0
BLAKE2b-256 97420ecc3be82e8c773cfe046655af3392566ac801ea5d95ff336d5dcc041c67

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page