diff --git a/CHANGELOG.md b/CHANGELOG.md index a1a4ac934f5..d7528f53949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,17 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] -## [2.0.3] - 2017-03-06 +## [2.0.5] - 2017-03-07 +## Fixed +- `import plotly` was broken in `2.0.3` and `2.0.2` because the new `dashboard_objs` wasn't included in our `setup.py`'s "`packages`". Now it is and `import plotly` and the other features introduced in `2.0.3` and `2.0.2` should work. + +## [2.0.4] - 2017-03-07 [YANKED] +Note: This release's installation was broken. It has been removed from PyPI +## Added +- Added `dashboard_objs` to top level import. + +## [2.0.3] - 2017-03-06 [YANKED] +Note: This release's installation was broken. It has been removed from PyPI ## Added - Dashboards can now be created using the API and uploaded to Plotly. Use `import plotly.dashboard_objs` to create a `Dashboard` object. You can learn more about `Dashboard` objects by running `help(plotly.dashboard_objs)` and `help(plotly.plotly.plotly.dashboard_ops)` for uploading and retrieving dashboards from the cloud. diff --git a/circle.yml b/circle.yml index 29fb8d4fa11..0703e482f2c 100644 --- a/circle.yml +++ b/circle.yml @@ -58,3 +58,13 @@ test: # since optional requirements is part of the test suite, we don't need to # worry about testing that it *can* be imported in this case. - $(! python -c "import plotly.figure_factory") + + # test the distribution and a basic import + - rm -rf dist/ && + python setup.py sdist && + mkdir test_install && + cd test_install && + virtualenv venv && + source venv/bin/activate && + pip install ../dist/* && + python -c "import plotly" diff --git a/dist/plotly-0.5.6.tar.gz b/dist/plotly-0.5.6.tar.gz deleted file mode 100644 index 5a28a56112f..00000000000 Binary files a/dist/plotly-0.5.6.tar.gz and /dev/null differ diff --git a/dist/plotly-0.5.8 2/PKG-INFO b/dist/plotly-0.5.8 2/PKG-INFO deleted file mode 100644 index d7698c8ebd6..00000000000 --- a/dist/plotly-0.5.8 2/PKG-INFO +++ /dev/null @@ -1,39 +0,0 @@ -Metadata-Version: 1.1 -Name: plotly -Version: 0.5.8 -Summary: Python plotting library for collaborative, interactive, web-based, publication-quality graphs. -Home-page: https://plot.ly/api/python -Author: Chris P -Author-email: chris@plot.ly -License: MIT -Description: The Plotly Python Plotting Library lets you make collaborative, interactive, publication-quality graphs. - - Main features for plotting are: - - - Complete control over every aspect or your graph, including colors, size, font, layout, and styling. - - Plotly can make line charts, scatter plots, histograms, 2D histograms, box plots, heatmaps, and error bars. Plotly also supports log axes, and date axes. - - Data and graphs are always together. - - Easily add data to plots, or stream your data in from elsewhere--the web or your Raspberry Pi. - - A styling GUI. It is convenient to start off by making your graph with Python code, then style it how you want in the GUI. Thus, if you want to explore a different layout, graph type, or edit something, you can do so with the GUI instead editing code. The means it’s fast and easy to find out “how would this look if it were a [graph type]”? - - Save custom themes from graphs, then apply themes to new data. That way, you won’t need to re-make graphs with a similar styling again and again. - - That means no more emailing data and spreadsheets around, having to download graphs or take static screenshots and put them in a deck or email you can’t access anymore. You can simply send a Plotly URL to your team, or share your project with them so you can edit together. - - Plotly also has a deep Python Integration: - - - Works with IPython (see https://github.com/plotly/IPython-plotly). - - Interactivity with Python shell (NumPy supported) on https://plot.ly. - - Extensive options for sharing and collaboration: - - - API graphing returns a URL that can easily be shared (e.g., https://plot.ly/~bchartoff/344/), and all graphs can be downloaded, exported, embedded, and shared for collaboration. - - Keep graphs private, share publicly with a URL, or share with your team. - - Invite others to collaborate with you and edit together. - - Plotly sharing supports comments, so others can both comment on the graph and graph right where it lives - - Embed graphs as an iframe--here’s an example in the Washington Post (wapo.st/10i6mhs)--or download graphs for articles, and include the URL in your graph. That way, others can go online to access your interactive graph and data. - -Platform: UNKNOWN -Classifier: Development Status :: 4 - Beta -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Topic :: Scientific/Engineering :: Visualization diff --git a/dist/plotly-0.5.8 2/README.txt b/dist/plotly-0.5.8 2/README.txt deleted file mode 100644 index 9d6e5d0ab2e..00000000000 --- a/dist/plotly-0.5.8 2/README.txt +++ /dev/null @@ -1,25 +0,0 @@ -The Plotly Python Plotting Library lets you make collaborative, interactive, publication-quality graphs. - -Main features for plotting are: - -- Complete control over every aspect or your graph, including colors, size, font, layout, and styling. -- Plotly can make line charts, scatter plots, histograms, 2D histograms, box plots, heatmaps, and error bars. Plotly also supports log axes, and date axes. -- Data and graphs are always together. -- Easily add data to plots, or stream your data in from elsewhere--the web or your Raspberry Pi. -- A styling GUI. It is convenient to start off by making your graph with Python code, then style it how you want in the GUI. Thus, if you want to explore a different layout, graph type, or edit something, you can do so with the GUI instead editing code. The means it’s fast and easy to find out “how would this look if it were a [graph type]”? -- Save custom themes from graphs, then apply themes to new data. That way, you won’t need to re-make graphs with a similar styling again and again. - -That means no more emailing data and spreadsheets around, having to download graphs or take static screenshots and put them in a deck or email you can’t access anymore. You can simply send a Plotly URL to your team, or share your project with them so you can edit together. - -Plotly also has a deep Python Integration: - -- Works with IPython (see https://github.com/plotly/IPython-plotly). -- Interactivity with Python shell (NumPy supported) on https://plot.ly. - -Extensive options for sharing and collaboration: - -- API graphing returns a URL that can easily be shared (e.g., https://plot.ly/~bchartoff/344/), and all graphs can be downloaded, exported, embedded, and shared for collaboration. -- Keep graphs private, share publicly with a URL, or share with your team. -- Invite others to collaborate with you and edit together. -- Plotly sharing supports comments, so others can both comment on the graph and graph right where it lives -- Embed graphs as an iframe--here’s an example in the Washington Post (wapo.st/10i6mhs)--or download graphs for articles, and include the URL in your graph. That way, others can go online to access your interactive graph and data. diff --git a/dist/plotly-0.5.8 2/plotly/__init__.py b/dist/plotly-0.5.8 2/plotly/__init__.py deleted file mode 100644 index d3856d4aaf3..00000000000 --- a/dist/plotly-0.5.8 2/plotly/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .version import __version__ -from .plotly import signup -from .plotly import plotly \ No newline at end of file diff --git a/dist/plotly-0.5.8 2/plotly/plotly.py b/dist/plotly-0.5.8 2/plotly/plotly.py deleted file mode 100644 index a14b7059031..00000000000 --- a/dist/plotly-0.5.8 2/plotly/plotly.py +++ /dev/null @@ -1,237 +0,0 @@ -import requests -import json -import warnings - -from .version import __version__ - -def signup(un, email): - ''' Remote signup to plot.ly and plot.ly API - Returns: - :param r with r['tmp_pw']: Temporary password to access your plot.ly acount - :param r['api_key']: A key to use the API with - - Full docs and examples at https://plot.ly/API - :un: username - :email: email address - ''' - payload = {'version': __version__, 'un': un, 'email': email, 'platform':'Python'} - r = requests.post('https://plot.ly/apimkacct', data=payload) - r.raise_for_status() - r = json.loads(r.text) - if 'error' in r and r['error'] != '': - print(r['error']) - if 'warning' in r and r['warning'] != '': - warnings.warn(r['warning']) - if 'message' in r and r['message'] != '': - print(r['message']) - - return r - -class plotly: - def __init__(self, username_or_email=None, key=None,verbose=True): - ''' plotly constructor. Supply username or email and api key. - ''' - self.un = username_or_email - self.key = key - self.__filename = None - self.__fileopt = None - self.verbose = verbose - self.open = True - - def ion(self): - self.open = True - def ioff(self): - self.open = False - - def iplot(self, *args, **kwargs): - ''' for use in ipython notebooks ''' - res = self.__callplot(*args, **kwargs) - width = kwargs.get('width', 600) - height = kwargs.get('height', 450) - s = '' %\ - (height+50, "/".join(map(str, [res['url'], width, height])), width+50) - try: - # see, if we are in the SageMath Cloud - from sage_salvus import html - return html(s, hide=False) - except: - pass - try: - from IPython.display import HTML - return HTML(s) - except: - return s - - def plot(self, *args, **kwargs): - res = self.__callplot(*args, **kwargs) - if 'error' in res and res['error'] == '' and self.open: - from webbrowser import open as wbopen - wbopen(res['url']) - return res - - def __callplot(self, *args, **kwargs): - ''' Make a plot in plotly. - Two interfaces: - 1 - ploty.plot(x1, y1[,x2,y2,...],**kwargs) - where x1, y1, .... are lists, numpy arrays - 2 - plot.plot([data1[, data2, ...], **kwargs) - where data1 is a dict that is at least - {'x': x1, 'y': y1} but can contain more styling and sharing options. - kwargs accepts: - filename - fileopt - style - layout - See https://plot.ly/API for details. - Returns: - :param r with r['url']: A URL that displays the generated plot - :param r['filename']: The filename of the plot in your plotly account. - ''' - - un = kwargs['un'] if 'un' in kwargs else self.un - key = kwargs['key'] if 'key' in kwargs else self.key - if not un or not key: - raise Exception('Not Signed in') - - if not 'filename' in kwargs: - kwargs['filename'] = self.__filename - if not 'fileopt' in kwargs: - kwargs['fileopt'] = self.__fileopt - - origin = 'plot' - r = self.__makecall(args, un, key, origin, kwargs) - return r - - def layout(self, *args, **kwargs): - ''' Style the layout of a Plotly plot. - ploty.layout(layout,**kwargs) - :param layout - a dict that customizes the style of the layout, - the axes, and the legend. - :param kwargs - accepts: - filename - See https://plot.ly/API for details. - Returns: - :param r with r['url']: A URL that displays the generated plot - :param r['filename']: The filename of the plot in your plotly account. - ''' - - un = kwargs['un'] if 'un' in kwargs.keys() else self.un - key = kwargs['un'] if 'key' in kwargs.keys() else self.key - if not un or not key: - raise Exception('Not Signed in') - if not 'filename' in kwargs.keys(): - kwargs['filename'] = self.__filename - if not 'fileopt' in kwargs.keys(): - kwargs['fileopt'] = self.__fileopt - - origin = 'layout' - r = self.__makecall(args, un, key, origin, kwargs) - return r - - def style(self, *args, **kwargs): - ''' Style the data traces of a Plotly plot. - ploty.style([data1,[,data2,...],**kwargs) - :param data1 - a dict that customizes the style of the i'th trace - :param kwargs - accepts: - filename - See https://plot.ly/API for details. - Returns: - :param r with r['url']: A URL that displays the generated plot - :param r['filename']: The filename of the plot in your plotly account. - ''' - - un = kwargs['un'] if 'un' in kwargs.keys() else self.un - key = kwargs['un'] if 'key' in kwargs.keys() else self.key - if not un or not key: - raise Exception('Not Signed in') - if not 'filename' in kwargs.keys(): - kwargs['filename'] = self.__filename - if not 'fileopt' in kwargs.keys(): - kwargs['fileopt'] = self.__fileopt - - origin = 'style' - r = self.__makecall(args, un, key, origin, kwargs) - return r - - class __plotlyJSONEncoder(json.JSONEncoder): - def numpyJSONEncoder(self, obj): - try: - import numpy - if type(obj).__module__.split('.')[0] == numpy.__name__: - l = obj.tolist() - d = self.datetimeJSONEncoder(l) - return d if d is not None else l - except: - pass - return None - def datetimeJSONEncoder(self, obj): - # if datetime or iterable of datetimes, convert to a string that plotly understands - # format as %Y-%m-%d %H:%M:%S.%f, %Y-%m-%d %H:%M:%S, or %Y-%m-%d depending on what non-zero resolution was provided - import datetime - try: - if isinstance(obj,(datetime.datetime, datetime.date)): - if obj.microsecond != 0: - return obj.strftime('%Y-%m-%d %H:%M:%S.%f') - elif obj.second != 0 or obj.minute != 0 or obj.hour != 0: - return obj.strftime('%Y-%m-%d %H:%M:%S') - else: - return obj.strftime('%Y-%m-%d') - elif isinstance(obj[0],(datetime.datetime, datetime.date)): - return [o.strftime('%Y-%m-%d %H:%M:%S.%f') if o.microsecond != 0 else - o.strftime('%Y-%m-%d %H:%M:%S') if o.second != 0 or o.minute != 0 or o.hour != 0 else - o.strftime('%Y-%m-%d') - for o in obj] - except: - pass - return None - def pandasJSONEncoder(self, obj): - try: - import pandas - if isinstance(obj, pandas.Series): - return obj.tolist() - except: - pass - return None - def sageJSONEncoder(self, obj): - try: - from sage.all import RR, ZZ - if obj in RR: - return float(obj) - elif obj in ZZ: - return int(obj) - except: - pass - return None - def default(self, obj): - try: - return json.dumps(obj) - except TypeError as e: - encoders = (self.datetimeJSONEncoder, self.numpyJSONEncoder, self.pandasJSONEncoder, self.sageJSONEncoder) - for encoder in encoders: - s = encoder(obj) - if s is not None: - return s - raise e - return json.JSONEncoder.default(self,obj) - - def __makecall(self, args, un, key, origin, kwargs): - platform = 'Python' - - args = json.dumps(args, cls=self.__plotlyJSONEncoder) - kwargs = json.dumps(kwargs, cls=self.__plotlyJSONEncoder) - url = 'https://plot.ly/clientresp' - payload = {'platform': platform, 'version': __version__, 'args': args, 'un': un, 'key': key, 'origin': origin, 'kwargs': kwargs} - r = requests.post(url, data=payload) - r.raise_for_status() - r = json.loads(r.text) - if 'error' in r and r['error'] != '': - print(r['error']) - if 'warning' in r and r['warning'] != '': - warnings.warn(r['warning']) - if 'message' in r and r['message'] != '' and self.verbose: - print(r['message']) - - return r - - - diff --git a/dist/plotly-0.5.8 2/plotly/version.py b/dist/plotly-0.5.8 2/plotly/version.py deleted file mode 100644 index 91201fc63f4..00000000000 --- a/dist/plotly-0.5.8 2/plotly/version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = '0.5.8' diff --git a/dist/plotly-0.5.8 2/setup.cfg b/dist/plotly-0.5.8 2/setup.cfg deleted file mode 100644 index 861a9f55426..00000000000 --- a/dist/plotly-0.5.8 2/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[egg_info] -tag_build = -tag_date = 0 -tag_svn_revision = 0 - diff --git a/dist/plotly-0.5.8 2/setup.py b/dist/plotly-0.5.8 2/setup.py deleted file mode 100644 index b4fe1a8be4c..00000000000 --- a/dist/plotly-0.5.8 2/setup.py +++ /dev/null @@ -1,26 +0,0 @@ -from setuptools import setup -exec(open('plotly/version.py').read()) -def readme(): - with open('README.txt') as f: - return f.read() - -setup(name='plotly', - version=__version__, - author='Chris P', - author_email='chris@plot.ly', - maintainer='Chris P', - maintainer_email='chris@plot.ly', - url='https://plot.ly/api/python', - description='Python plotting library for collaborative, interactive, web-based, publication-quality graphs.', - long_description=readme(), - classifiers=['Development Status :: 4 - Beta', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Topic :: Scientific/Engineering :: Visualization', - ], - license='MIT', - packages=['plotly'], - install_requires=[ - 'requests' - ], - zip_safe=False) diff --git a/dist/plotly-0.5.8/PKG-INFO b/dist/plotly-0.5.8/PKG-INFO deleted file mode 100644 index d7698c8ebd6..00000000000 --- a/dist/plotly-0.5.8/PKG-INFO +++ /dev/null @@ -1,39 +0,0 @@ -Metadata-Version: 1.1 -Name: plotly -Version: 0.5.8 -Summary: Python plotting library for collaborative, interactive, web-based, publication-quality graphs. -Home-page: https://plot.ly/api/python -Author: Chris P -Author-email: chris@plot.ly -License: MIT -Description: The Plotly Python Plotting Library lets you make collaborative, interactive, publication-quality graphs. - - Main features for plotting are: - - - Complete control over every aspect or your graph, including colors, size, font, layout, and styling. - - Plotly can make line charts, scatter plots, histograms, 2D histograms, box plots, heatmaps, and error bars. Plotly also supports log axes, and date axes. - - Data and graphs are always together. - - Easily add data to plots, or stream your data in from elsewhere--the web or your Raspberry Pi. - - A styling GUI. It is convenient to start off by making your graph with Python code, then style it how you want in the GUI. Thus, if you want to explore a different layout, graph type, or edit something, you can do so with the GUI instead editing code. The means it’s fast and easy to find out “how would this look if it were a [graph type]”? - - Save custom themes from graphs, then apply themes to new data. That way, you won’t need to re-make graphs with a similar styling again and again. - - That means no more emailing data and spreadsheets around, having to download graphs or take static screenshots and put them in a deck or email you can’t access anymore. You can simply send a Plotly URL to your team, or share your project with them so you can edit together. - - Plotly also has a deep Python Integration: - - - Works with IPython (see https://github.com/plotly/IPython-plotly). - - Interactivity with Python shell (NumPy supported) on https://plot.ly. - - Extensive options for sharing and collaboration: - - - API graphing returns a URL that can easily be shared (e.g., https://plot.ly/~bchartoff/344/), and all graphs can be downloaded, exported, embedded, and shared for collaboration. - - Keep graphs private, share publicly with a URL, or share with your team. - - Invite others to collaborate with you and edit together. - - Plotly sharing supports comments, so others can both comment on the graph and graph right where it lives - - Embed graphs as an iframe--here’s an example in the Washington Post (wapo.st/10i6mhs)--or download graphs for articles, and include the URL in your graph. That way, others can go online to access your interactive graph and data. - -Platform: UNKNOWN -Classifier: Development Status :: 4 - Beta -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Topic :: Scientific/Engineering :: Visualization diff --git a/dist/plotly-0.5.8/plotly/__init__.py b/dist/plotly-0.5.8/plotly/__init__.py deleted file mode 100644 index d3856d4aaf3..00000000000 --- a/dist/plotly-0.5.8/plotly/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .version import __version__ -from .plotly import signup -from .plotly import plotly \ No newline at end of file diff --git a/dist/plotly-0.5.8/plotly/plotly.py b/dist/plotly-0.5.8/plotly/plotly.py deleted file mode 100644 index a14b7059031..00000000000 --- a/dist/plotly-0.5.8/plotly/plotly.py +++ /dev/null @@ -1,237 +0,0 @@ -import requests -import json -import warnings - -from .version import __version__ - -def signup(un, email): - ''' Remote signup to plot.ly and plot.ly API - Returns: - :param r with r['tmp_pw']: Temporary password to access your plot.ly acount - :param r['api_key']: A key to use the API with - - Full docs and examples at https://plot.ly/API - :un: username - :email: email address - ''' - payload = {'version': __version__, 'un': un, 'email': email, 'platform':'Python'} - r = requests.post('https://plot.ly/apimkacct', data=payload) - r.raise_for_status() - r = json.loads(r.text) - if 'error' in r and r['error'] != '': - print(r['error']) - if 'warning' in r and r['warning'] != '': - warnings.warn(r['warning']) - if 'message' in r and r['message'] != '': - print(r['message']) - - return r - -class plotly: - def __init__(self, username_or_email=None, key=None,verbose=True): - ''' plotly constructor. Supply username or email and api key. - ''' - self.un = username_or_email - self.key = key - self.__filename = None - self.__fileopt = None - self.verbose = verbose - self.open = True - - def ion(self): - self.open = True - def ioff(self): - self.open = False - - def iplot(self, *args, **kwargs): - ''' for use in ipython notebooks ''' - res = self.__callplot(*args, **kwargs) - width = kwargs.get('width', 600) - height = kwargs.get('height', 450) - s = '' %\ - (height+50, "/".join(map(str, [res['url'], width, height])), width+50) - try: - # see, if we are in the SageMath Cloud - from sage_salvus import html - return html(s, hide=False) - except: - pass - try: - from IPython.display import HTML - return HTML(s) - except: - return s - - def plot(self, *args, **kwargs): - res = self.__callplot(*args, **kwargs) - if 'error' in res and res['error'] == '' and self.open: - from webbrowser import open as wbopen - wbopen(res['url']) - return res - - def __callplot(self, *args, **kwargs): - ''' Make a plot in plotly. - Two interfaces: - 1 - ploty.plot(x1, y1[,x2,y2,...],**kwargs) - where x1, y1, .... are lists, numpy arrays - 2 - plot.plot([data1[, data2, ...], **kwargs) - where data1 is a dict that is at least - {'x': x1, 'y': y1} but can contain more styling and sharing options. - kwargs accepts: - filename - fileopt - style - layout - See https://plot.ly/API for details. - Returns: - :param r with r['url']: A URL that displays the generated plot - :param r['filename']: The filename of the plot in your plotly account. - ''' - - un = kwargs['un'] if 'un' in kwargs else self.un - key = kwargs['key'] if 'key' in kwargs else self.key - if not un or not key: - raise Exception('Not Signed in') - - if not 'filename' in kwargs: - kwargs['filename'] = self.__filename - if not 'fileopt' in kwargs: - kwargs['fileopt'] = self.__fileopt - - origin = 'plot' - r = self.__makecall(args, un, key, origin, kwargs) - return r - - def layout(self, *args, **kwargs): - ''' Style the layout of a Plotly plot. - ploty.layout(layout,**kwargs) - :param layout - a dict that customizes the style of the layout, - the axes, and the legend. - :param kwargs - accepts: - filename - See https://plot.ly/API for details. - Returns: - :param r with r['url']: A URL that displays the generated plot - :param r['filename']: The filename of the plot in your plotly account. - ''' - - un = kwargs['un'] if 'un' in kwargs.keys() else self.un - key = kwargs['un'] if 'key' in kwargs.keys() else self.key - if not un or not key: - raise Exception('Not Signed in') - if not 'filename' in kwargs.keys(): - kwargs['filename'] = self.__filename - if not 'fileopt' in kwargs.keys(): - kwargs['fileopt'] = self.__fileopt - - origin = 'layout' - r = self.__makecall(args, un, key, origin, kwargs) - return r - - def style(self, *args, **kwargs): - ''' Style the data traces of a Plotly plot. - ploty.style([data1,[,data2,...],**kwargs) - :param data1 - a dict that customizes the style of the i'th trace - :param kwargs - accepts: - filename - See https://plot.ly/API for details. - Returns: - :param r with r['url']: A URL that displays the generated plot - :param r['filename']: The filename of the plot in your plotly account. - ''' - - un = kwargs['un'] if 'un' in kwargs.keys() else self.un - key = kwargs['un'] if 'key' in kwargs.keys() else self.key - if not un or not key: - raise Exception('Not Signed in') - if not 'filename' in kwargs.keys(): - kwargs['filename'] = self.__filename - if not 'fileopt' in kwargs.keys(): - kwargs['fileopt'] = self.__fileopt - - origin = 'style' - r = self.__makecall(args, un, key, origin, kwargs) - return r - - class __plotlyJSONEncoder(json.JSONEncoder): - def numpyJSONEncoder(self, obj): - try: - import numpy - if type(obj).__module__.split('.')[0] == numpy.__name__: - l = obj.tolist() - d = self.datetimeJSONEncoder(l) - return d if d is not None else l - except: - pass - return None - def datetimeJSONEncoder(self, obj): - # if datetime or iterable of datetimes, convert to a string that plotly understands - # format as %Y-%m-%d %H:%M:%S.%f, %Y-%m-%d %H:%M:%S, or %Y-%m-%d depending on what non-zero resolution was provided - import datetime - try: - if isinstance(obj,(datetime.datetime, datetime.date)): - if obj.microsecond != 0: - return obj.strftime('%Y-%m-%d %H:%M:%S.%f') - elif obj.second != 0 or obj.minute != 0 or obj.hour != 0: - return obj.strftime('%Y-%m-%d %H:%M:%S') - else: - return obj.strftime('%Y-%m-%d') - elif isinstance(obj[0],(datetime.datetime, datetime.date)): - return [o.strftime('%Y-%m-%d %H:%M:%S.%f') if o.microsecond != 0 else - o.strftime('%Y-%m-%d %H:%M:%S') if o.second != 0 or o.minute != 0 or o.hour != 0 else - o.strftime('%Y-%m-%d') - for o in obj] - except: - pass - return None - def pandasJSONEncoder(self, obj): - try: - import pandas - if isinstance(obj, pandas.Series): - return obj.tolist() - except: - pass - return None - def sageJSONEncoder(self, obj): - try: - from sage.all import RR, ZZ - if obj in RR: - return float(obj) - elif obj in ZZ: - return int(obj) - except: - pass - return None - def default(self, obj): - try: - return json.dumps(obj) - except TypeError as e: - encoders = (self.datetimeJSONEncoder, self.numpyJSONEncoder, self.pandasJSONEncoder, self.sageJSONEncoder) - for encoder in encoders: - s = encoder(obj) - if s is not None: - return s - raise e - return json.JSONEncoder.default(self,obj) - - def __makecall(self, args, un, key, origin, kwargs): - platform = 'Python' - - args = json.dumps(args, cls=self.__plotlyJSONEncoder) - kwargs = json.dumps(kwargs, cls=self.__plotlyJSONEncoder) - url = 'https://plot.ly/clientresp' - payload = {'platform': platform, 'version': __version__, 'args': args, 'un': un, 'key': key, 'origin': origin, 'kwargs': kwargs} - r = requests.post(url, data=payload) - r.raise_for_status() - r = json.loads(r.text) - if 'error' in r and r['error'] != '': - print(r['error']) - if 'warning' in r and r['warning'] != '': - warnings.warn(r['warning']) - if 'message' in r and r['message'] != '' and self.verbose: - print(r['message']) - - return r - - - diff --git a/dist/plotly-0.5.8/plotly/version.py b/dist/plotly-0.5.8/plotly/version.py deleted file mode 100644 index 91201fc63f4..00000000000 --- a/dist/plotly-0.5.8/plotly/version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = '0.5.8' diff --git a/dist/plotly-0.5.8/setup.cfg b/dist/plotly-0.5.8/setup.cfg deleted file mode 100644 index 861a9f55426..00000000000 --- a/dist/plotly-0.5.8/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[egg_info] -tag_build = -tag_date = 0 -tag_svn_revision = 0 - diff --git a/dist/plotly-0.5.8/setup.py b/dist/plotly-0.5.8/setup.py deleted file mode 100644 index e3e2be20138..00000000000 --- a/dist/plotly-0.5.8/setup.py +++ /dev/null @@ -1,26 +0,0 @@ -from setuptools import setup -exec(open('plotly/version.py').read()) -def readme(): - with open('plotly/pypi_description.txt') as f: - return f.read() - -setup(name='plotly', - version=__version__, - author='Chris P', - author_email='chris@plot.ly', - maintainer='Chris P', - maintainer_email='chris@plot.ly', - url='https://plot.ly/api/python', - description='Python plotting library for collaborative, interactive, web-based, publication-quality graphs.', - long_description=readme(), - classifiers=['Development Status :: 4 - Beta', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Topic :: Scientific/Engineering :: Visualization', - ], - license='MIT', - packages=['plotly'], - install_requires=[ - 'requests' - ], - zip_safe=False) diff --git a/dist/plotly-0.5.9/PKG-INFO b/dist/plotly-0.5.9/PKG-INFO deleted file mode 100644 index 6cce6dd83fb..00000000000 --- a/dist/plotly-0.5.9/PKG-INFO +++ /dev/null @@ -1,39 +0,0 @@ -Metadata-Version: 1.1 -Name: plotly -Version: 0.5.9 -Summary: Python plotting library for collaborative, interactive, web-based, publication-quality graphs. -Home-page: https://plot.ly/api/python -Author: Chris P -Author-email: chris@plot.ly -License: MIT -Description: The Plotly Python Plotting Library lets you make collaborative, interactive, publication-quality graphs. - - Main features for plotting are: - - - Complete control over every aspect or your graph, including colors, size, font, layout, and styling. - - Plotly can make line charts, scatter plots, histograms, 2D histograms, box plots, heatmaps, and error bars. Plotly also supports log axes, and date axes. - - Data and graphs are always together. - - Easily add data to plots, or stream your data in from elsewhere--the web or your Raspberry Pi. - - A styling GUI. It is convenient to start off by making your graph with Python code, then style it how you want in the GUI. Thus, if you want to explore a different layout, graph type, or edit something, you can do so with the GUI instead editing code. The means it’s fast and easy to find out “how would this look if it were a [graph type]”? - - Save custom themes from graphs, then apply themes to new data. That way, you won’t need to re-make graphs with a similar styling again and again. - - That means no more emailing data and spreadsheets around, having to download graphs or take static screenshots and put them in a deck or email you can’t access anymore. You can simply send a Plotly URL to your team, or share your project with them so you can edit together. - - Plotly also has a deep Python Integration: - - - Works with IPython (see https://github.com/plotly/IPython-plotly). - - Interactivity with Python shell (NumPy supported) on https://plot.ly. - - Extensive options for sharing and collaboration: - - - API graphing returns a URL that can easily be shared (e.g., https://plot.ly/~bchartoff/344/), and all graphs can be downloaded, exported, embedded, and shared for collaboration. - - Keep graphs private, share publicly with a URL, or share with your team. - - Invite others to collaborate with you and edit together. - - Plotly sharing supports comments, so others can both comment on the graph and graph right where it lives - - Embed graphs as an iframe--here’s an example in the Washington Post (wapo.st/10i6mhs)--or download graphs for articles, and include the URL in your graph. That way, others can go online to access your interactive graph and data. - -Platform: UNKNOWN -Classifier: Development Status :: 4 - Beta -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Topic :: Scientific/Engineering :: Visualization diff --git a/dist/plotly-0.5.9/README.txt b/dist/plotly-0.5.9/README.txt deleted file mode 100644 index 9d6e5d0ab2e..00000000000 --- a/dist/plotly-0.5.9/README.txt +++ /dev/null @@ -1,25 +0,0 @@ -The Plotly Python Plotting Library lets you make collaborative, interactive, publication-quality graphs. - -Main features for plotting are: - -- Complete control over every aspect or your graph, including colors, size, font, layout, and styling. -- Plotly can make line charts, scatter plots, histograms, 2D histograms, box plots, heatmaps, and error bars. Plotly also supports log axes, and date axes. -- Data and graphs are always together. -- Easily add data to plots, or stream your data in from elsewhere--the web or your Raspberry Pi. -- A styling GUI. It is convenient to start off by making your graph with Python code, then style it how you want in the GUI. Thus, if you want to explore a different layout, graph type, or edit something, you can do so with the GUI instead editing code. The means it’s fast and easy to find out “how would this look if it were a [graph type]”? -- Save custom themes from graphs, then apply themes to new data. That way, you won’t need to re-make graphs with a similar styling again and again. - -That means no more emailing data and spreadsheets around, having to download graphs or take static screenshots and put them in a deck or email you can’t access anymore. You can simply send a Plotly URL to your team, or share your project with them so you can edit together. - -Plotly also has a deep Python Integration: - -- Works with IPython (see https://github.com/plotly/IPython-plotly). -- Interactivity with Python shell (NumPy supported) on https://plot.ly. - -Extensive options for sharing and collaboration: - -- API graphing returns a URL that can easily be shared (e.g., https://plot.ly/~bchartoff/344/), and all graphs can be downloaded, exported, embedded, and shared for collaboration. -- Keep graphs private, share publicly with a URL, or share with your team. -- Invite others to collaborate with you and edit together. -- Plotly sharing supports comments, so others can both comment on the graph and graph right where it lives -- Embed graphs as an iframe--here’s an example in the Washington Post (wapo.st/10i6mhs)--or download graphs for articles, and include the URL in your graph. That way, others can go online to access your interactive graph and data. diff --git a/dist/plotly-0.5.9/plotly/__init__.py b/dist/plotly-0.5.9/plotly/__init__.py deleted file mode 100644 index d3856d4aaf3..00000000000 --- a/dist/plotly-0.5.9/plotly/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .version import __version__ -from .plotly import signup -from .plotly import plotly \ No newline at end of file diff --git a/dist/plotly-0.5.9/plotly/plotly.py b/dist/plotly-0.5.9/plotly/plotly.py deleted file mode 100644 index a14b7059031..00000000000 --- a/dist/plotly-0.5.9/plotly/plotly.py +++ /dev/null @@ -1,237 +0,0 @@ -import requests -import json -import warnings - -from .version import __version__ - -def signup(un, email): - ''' Remote signup to plot.ly and plot.ly API - Returns: - :param r with r['tmp_pw']: Temporary password to access your plot.ly acount - :param r['api_key']: A key to use the API with - - Full docs and examples at https://plot.ly/API - :un: username - :email: email address - ''' - payload = {'version': __version__, 'un': un, 'email': email, 'platform':'Python'} - r = requests.post('https://plot.ly/apimkacct', data=payload) - r.raise_for_status() - r = json.loads(r.text) - if 'error' in r and r['error'] != '': - print(r['error']) - if 'warning' in r and r['warning'] != '': - warnings.warn(r['warning']) - if 'message' in r and r['message'] != '': - print(r['message']) - - return r - -class plotly: - def __init__(self, username_or_email=None, key=None,verbose=True): - ''' plotly constructor. Supply username or email and api key. - ''' - self.un = username_or_email - self.key = key - self.__filename = None - self.__fileopt = None - self.verbose = verbose - self.open = True - - def ion(self): - self.open = True - def ioff(self): - self.open = False - - def iplot(self, *args, **kwargs): - ''' for use in ipython notebooks ''' - res = self.__callplot(*args, **kwargs) - width = kwargs.get('width', 600) - height = kwargs.get('height', 450) - s = '' %\ - (height+50, "/".join(map(str, [res['url'], width, height])), width+50) - try: - # see, if we are in the SageMath Cloud - from sage_salvus import html - return html(s, hide=False) - except: - pass - try: - from IPython.display import HTML - return HTML(s) - except: - return s - - def plot(self, *args, **kwargs): - res = self.__callplot(*args, **kwargs) - if 'error' in res and res['error'] == '' and self.open: - from webbrowser import open as wbopen - wbopen(res['url']) - return res - - def __callplot(self, *args, **kwargs): - ''' Make a plot in plotly. - Two interfaces: - 1 - ploty.plot(x1, y1[,x2,y2,...],**kwargs) - where x1, y1, .... are lists, numpy arrays - 2 - plot.plot([data1[, data2, ...], **kwargs) - where data1 is a dict that is at least - {'x': x1, 'y': y1} but can contain more styling and sharing options. - kwargs accepts: - filename - fileopt - style - layout - See https://plot.ly/API for details. - Returns: - :param r with r['url']: A URL that displays the generated plot - :param r['filename']: The filename of the plot in your plotly account. - ''' - - un = kwargs['un'] if 'un' in kwargs else self.un - key = kwargs['key'] if 'key' in kwargs else self.key - if not un or not key: - raise Exception('Not Signed in') - - if not 'filename' in kwargs: - kwargs['filename'] = self.__filename - if not 'fileopt' in kwargs: - kwargs['fileopt'] = self.__fileopt - - origin = 'plot' - r = self.__makecall(args, un, key, origin, kwargs) - return r - - def layout(self, *args, **kwargs): - ''' Style the layout of a Plotly plot. - ploty.layout(layout,**kwargs) - :param layout - a dict that customizes the style of the layout, - the axes, and the legend. - :param kwargs - accepts: - filename - See https://plot.ly/API for details. - Returns: - :param r with r['url']: A URL that displays the generated plot - :param r['filename']: The filename of the plot in your plotly account. - ''' - - un = kwargs['un'] if 'un' in kwargs.keys() else self.un - key = kwargs['un'] if 'key' in kwargs.keys() else self.key - if not un or not key: - raise Exception('Not Signed in') - if not 'filename' in kwargs.keys(): - kwargs['filename'] = self.__filename - if not 'fileopt' in kwargs.keys(): - kwargs['fileopt'] = self.__fileopt - - origin = 'layout' - r = self.__makecall(args, un, key, origin, kwargs) - return r - - def style(self, *args, **kwargs): - ''' Style the data traces of a Plotly plot. - ploty.style([data1,[,data2,...],**kwargs) - :param data1 - a dict that customizes the style of the i'th trace - :param kwargs - accepts: - filename - See https://plot.ly/API for details. - Returns: - :param r with r['url']: A URL that displays the generated plot - :param r['filename']: The filename of the plot in your plotly account. - ''' - - un = kwargs['un'] if 'un' in kwargs.keys() else self.un - key = kwargs['un'] if 'key' in kwargs.keys() else self.key - if not un or not key: - raise Exception('Not Signed in') - if not 'filename' in kwargs.keys(): - kwargs['filename'] = self.__filename - if not 'fileopt' in kwargs.keys(): - kwargs['fileopt'] = self.__fileopt - - origin = 'style' - r = self.__makecall(args, un, key, origin, kwargs) - return r - - class __plotlyJSONEncoder(json.JSONEncoder): - def numpyJSONEncoder(self, obj): - try: - import numpy - if type(obj).__module__.split('.')[0] == numpy.__name__: - l = obj.tolist() - d = self.datetimeJSONEncoder(l) - return d if d is not None else l - except: - pass - return None - def datetimeJSONEncoder(self, obj): - # if datetime or iterable of datetimes, convert to a string that plotly understands - # format as %Y-%m-%d %H:%M:%S.%f, %Y-%m-%d %H:%M:%S, or %Y-%m-%d depending on what non-zero resolution was provided - import datetime - try: - if isinstance(obj,(datetime.datetime, datetime.date)): - if obj.microsecond != 0: - return obj.strftime('%Y-%m-%d %H:%M:%S.%f') - elif obj.second != 0 or obj.minute != 0 or obj.hour != 0: - return obj.strftime('%Y-%m-%d %H:%M:%S') - else: - return obj.strftime('%Y-%m-%d') - elif isinstance(obj[0],(datetime.datetime, datetime.date)): - return [o.strftime('%Y-%m-%d %H:%M:%S.%f') if o.microsecond != 0 else - o.strftime('%Y-%m-%d %H:%M:%S') if o.second != 0 or o.minute != 0 or o.hour != 0 else - o.strftime('%Y-%m-%d') - for o in obj] - except: - pass - return None - def pandasJSONEncoder(self, obj): - try: - import pandas - if isinstance(obj, pandas.Series): - return obj.tolist() - except: - pass - return None - def sageJSONEncoder(self, obj): - try: - from sage.all import RR, ZZ - if obj in RR: - return float(obj) - elif obj in ZZ: - return int(obj) - except: - pass - return None - def default(self, obj): - try: - return json.dumps(obj) - except TypeError as e: - encoders = (self.datetimeJSONEncoder, self.numpyJSONEncoder, self.pandasJSONEncoder, self.sageJSONEncoder) - for encoder in encoders: - s = encoder(obj) - if s is not None: - return s - raise e - return json.JSONEncoder.default(self,obj) - - def __makecall(self, args, un, key, origin, kwargs): - platform = 'Python' - - args = json.dumps(args, cls=self.__plotlyJSONEncoder) - kwargs = json.dumps(kwargs, cls=self.__plotlyJSONEncoder) - url = 'https://plot.ly/clientresp' - payload = {'platform': platform, 'version': __version__, 'args': args, 'un': un, 'key': key, 'origin': origin, 'kwargs': kwargs} - r = requests.post(url, data=payload) - r.raise_for_status() - r = json.loads(r.text) - if 'error' in r and r['error'] != '': - print(r['error']) - if 'warning' in r and r['warning'] != '': - warnings.warn(r['warning']) - if 'message' in r and r['message'] != '' and self.verbose: - print(r['message']) - - return r - - - diff --git a/dist/plotly-0.5.9/plotly/version.py b/dist/plotly-0.5.9/plotly/version.py deleted file mode 100644 index eaddd125960..00000000000 --- a/dist/plotly-0.5.9/plotly/version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = '0.5.9' diff --git a/dist/plotly-0.5.9/setup.cfg b/dist/plotly-0.5.9/setup.cfg deleted file mode 100644 index 861a9f55426..00000000000 --- a/dist/plotly-0.5.9/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[egg_info] -tag_build = -tag_date = 0 -tag_svn_revision = 0 - diff --git a/dist/plotly-0.5.9/setup.py b/dist/plotly-0.5.9/setup.py deleted file mode 100644 index b4fe1a8be4c..00000000000 --- a/dist/plotly-0.5.9/setup.py +++ /dev/null @@ -1,26 +0,0 @@ -from setuptools import setup -exec(open('plotly/version.py').read()) -def readme(): - with open('README.txt') as f: - return f.read() - -setup(name='plotly', - version=__version__, - author='Chris P', - author_email='chris@plot.ly', - maintainer='Chris P', - maintainer_email='chris@plot.ly', - url='https://plot.ly/api/python', - description='Python plotting library for collaborative, interactive, web-based, publication-quality graphs.', - long_description=readme(), - classifiers=['Development Status :: 4 - Beta', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Topic :: Scientific/Engineering :: Visualization', - ], - license='MIT', - packages=['plotly'], - install_requires=[ - 'requests' - ], - zip_safe=False) diff --git a/plotly/version.py b/plotly/version.py index f593cd5bd5c..4c354e07079 100644 --- a/plotly/version.py +++ b/plotly/version.py @@ -1 +1 @@ -__version__ = '2.0.4' +__version__ = '2.0.5' diff --git a/setup.py b/setup.py index 8ffa8d7ac57..b0c326d5c30 100644 --- a/setup.py +++ b/setup.py @@ -34,6 +34,7 @@ def readme(): 'plotly/api', 'plotly/api/v1', 'plotly/api/v2', + 'plotly/dashboard_objs', 'plotly/plotly', 'plotly/plotly/chunked_requests', 'plotly/figure_factory', diff --git a/test/vv/lib/python2.7/site-packages/plotly/version.py b/test/vv/lib/python2.7/site-packages/plotly/version.py new file mode 100644 index 00000000000..f593cd5bd5c --- /dev/null +++ b/test/vv/lib/python2.7/site-packages/plotly/version.py @@ -0,0 +1 @@ +__version__ = '2.0.4'