Skip to main content

Save ranges from Excel documents as images

Project description

Save ranges from Excel documents as images

Requirements

  1. Python 2.7.x (TODO: add support for 3.x)

  2. pywin32

  3. Pillow >= 3.3.1

  4. Microsoft Excel (tested with Office 2013, on Windows 10)

Usage as python module

import excel2img

# Save as PNG the range of used cells in test.xlsx on page named "Sheet1"
excel2img.export_img("test.xlsx", "test.png", "Sheet1", None)

# Save as BMP the range B2:C15 in test.xlsx on page named "Sheet2"
excel2img.export_img("test.xlsx", "test.bmp", "", "Sheet2!B2:C15")

# Save as GIF the range "MyNamedRange"
excel2img.export_img("test.xlsx", "test.gif", "", "MyNamedRange")

Usage from command line

# Save as PNG the range of used cells in test.xlsx on first page
python excel2img.py test.xlsx test.png

# Save as PNG the range of used cells in test.xlsx on page "Sheet2"
python excel2img.py test.xlsx test.png -p Sheet2

# Save as PNG the range "MyNamedRange"
python excel2img.py test.xlsx test.png -r MyNamedRange

# More range syntax examples
python excel2img.py test.xlsx test.gif -r 'Sheet3!B5:C8'
python excel2img.py test.xlsx test.bmp -r 'Sheet4!SheetScopedNamedRange'

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

excel2img-0.5.zip (8.5 kB view details)

Uploaded Source

File details

Details for the file excel2img-0.5.zip.

File metadata

  • Download URL: excel2img-0.5.zip
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for excel2img-0.5.zip
Algorithm Hash digest
SHA256 6f9fd6bb6ef2a2655077f9d40c82235558941fa4cc37daf9368f3f4ad8610696
MD5 b0ea37c45d19463e8365e4d93213f224
BLAKE2b-256 0c1b8f79de9ee68b183398b78693cfba5fd4d3d56c8e8f964237ca2aad2090ed

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