You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using bokeh 0.13.0 with python 3.6 to auto-generate charts in AWS lambda periodically to send to Slack.
In order to achieve this I want to use bokeh.io.export_png() to export the generated chart to a PNG.
However, the AWS lambda environment is mostly read-only, and I would like to have direct access to the underlying image object used to save the '(png|svg)' so that I could write directly to a BytesIO() object instead of writing/reading to/from disk.
Currently, I've done a quick hack to allow this:
def export_png(obj, filename=None, height=None, width=None, webdriver=None, as_image=False):
image = get_screenshot_as_png(obj, height=height, width=width, driver=webdriver)
if filename is None:
filename = default_filename("png")
if as_image:
return image
else:
image.save(filename)
return abspath(filename)
The text was updated successfully, but these errors were encountered:
I'm using bokeh 0.13.0 with python 3.6 to auto-generate charts in AWS lambda periodically to send to Slack.
In order to achieve this I want to use
bokeh.io.export_png()
to export the generated chart to a PNG.However, the AWS lambda environment is mostly read-only, and I would like to have direct access to the underlying
image object
used to save the '(png|svg)' so that I could write directly to aBytesIO()
object instead of writing/reading to/from disk.Currently, I've done a quick hack to allow this:
The text was updated successfully, but these errors were encountered: