#-----------------------------------------------------------------------------# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.# All rights reserved.## The full license is in the file LICENSE.txt, distributed with this software.#-----------------------------------------------------------------------------''' Bokeh is a Python library for creating interactive visualizations for modernweb browsers.Bokeh helps you build beautiful graphics, ranging from simple plots to complexdashboards with streaming datasets. With Bokeh, you can create JavaScript-poweredvisualizations without writing any JavaScript yourself.Most of the functionality of Bokeh is accessed through submodules such as|bokeh.plotting| and |bokeh.models|.For full documentation, please visit https://docs.bokeh.org----The top-level ``bokeh`` module itself contains a few useful functions andattributes:.. attribute:: __version__ :annotation: = currently installed version of Bokeh.. autofunction:: bokeh.license'''#-----------------------------------------------------------------------------# Boilerplate#-----------------------------------------------------------------------------from__future__importannotationsimportlogging# isort:skiplog=logging.getLogger(__name__)#-----------------------------------------------------------------------------# Imports#-----------------------------------------------------------------------------# Standard library importsimportimportlib.metadata#-----------------------------------------------------------------------------# Globals and constants#-----------------------------------------------------------------------------__all__=('__version__','license','sampledata',)__version__=importlib.metadata.version("bokeh")#-----------------------------------------------------------------------------# General API#-----------------------------------------------------------------------------
[docs]deflicense():''' Print the Bokeh license to the console. Returns: None '''frompathlibimportPathwithopen(Path(__file__).parent/'LICENSE.txt')aslic:print(lic.read())
#-----------------------------------------------------------------------------# Dev API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Private API#-----------------------------------------------------------------------------#-----------------------------------------------------------------------------# Code#-----------------------------------------------------------------------------delimportlib.metadata# expose sample data modulefrom.importsampledata;sampledata# configure Bokeh loggerfrom.utilimportlogconfig# isort:skipdellogconfig# Configure warnings to always show nice mssages, despite Python's active# efforts to hide them from users.importwarnings# isort:skipfrom.util.warningsimportBokehDeprecationWarning,BokehUserWarning# isort:skipwarnings.simplefilter('always',BokehDeprecationWarning)warnings.simplefilter('always',BokehUserWarning)original_formatwarning=warnings.formatwarningdef_formatwarning(message,category,filename,lineno,line=None):from.util.warningsimportBokehDeprecationWarning,BokehUserWarningifcategorynotin(BokehDeprecationWarning,BokehUserWarning):returnoriginal_formatwarning(message,category,filename,lineno,line)return"%s: %s\n"%(category.__name__,message)warnings.formatwarning=_formatwarningdel_formatwarningdelBokehDeprecationWarning,BokehUserWarningdelwarnings