Skip to main content

Takes pictures of code!

Project description


This package takes pictures of source code

Example code:

from sshot import shot
from PIL import Image
code='''
print('Hello World!')
'''
image=shot(code,lang='python')
Image.fromarray(image).save('code.png')

The code above will create something like:

Use in command line:

sshot -i test.py -l python -o code.png

It is also supported to set the background image of code, like:

from sshot import shot
from PIL import Image
from sshot.background import Background
import numpy as np
code='''
print('Hello World!')
'''
bg=np.array(Image.open('bg.png'))
image=shot(code,lang='python',background=Background(bg))
Image.fromarray(image).save('code.png')

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

sourceshot-1.0.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

sourceshot-1.0.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file sourceshot-1.0.0.tar.gz.

File metadata

  • Download URL: sourceshot-1.0.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.0

File hashes

Hashes for sourceshot-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a3e9b6b855e793eb12465f801773ca563269fca9365cdcc6df525dc60f0652ee
MD5 52eacbdc135578fe9cb32b20145d310e
BLAKE2b-256 49c1b307ad294cfb0ad5800d9573f03f2d84c764a055b86355fde900bffc9a46

See more details on using hashes here.

File details

Details for the file sourceshot-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: sourceshot-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.0

File hashes

Hashes for sourceshot-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 984b8cab783d282d894d360c9147f16d3c705d7ab2367b219ffdaff3821a14b9
MD5 9a70dfd08fd8303c7d524095cbe8cd96
BLAKE2b-256 be8c4e3e7544120bf99ff6e00bde953d96c147b7eeb0c48b5ab22965108238a3

See more details on using hashes here.

Supported by

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