Skip to content

Commit 175c794

Browse files
committed
Fix broken install, #35762466
1 parent 3a73a3e commit 175c794

23 files changed

+985
-2
lines changed
File renamed without changes.

dist/plotly-0.5.8 2/PKG-INFO

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Metadata-Version: 1.1
2+
Name: plotly
3+
Version: 0.5.8
4+
Summary: Python plotting library for collaborative, interactive, web-based, publication-quality graphs.
5+
Home-page: https://plot.ly/api/python
6+
Author: Chris P
7+
Author-email: [email protected]
8+
License: MIT
9+
Description: The Plotly Python Plotting Library lets you make collaborative, interactive, publication-quality graphs.
10+
11+
Main features for plotting are:
12+
13+
- Complete control over every aspect or your graph, including colors, size, font, layout, and styling.
14+
- Plotly can make line charts, scatter plots, histograms, 2D histograms, box plots, heatmaps, and error bars. Plotly also supports log axes, and date axes.
15+
- Data and graphs are always together.
16+
- Easily add data to plots, or stream your data in from elsewhere--the web or your Raspberry Pi.
17+
- 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]”?
18+
- 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.
19+
20+
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.
21+
22+
Plotly also has a deep Python Integration:
23+
24+
- Works with IPython (see https://github.com/plotly/IPython-plotly).
25+
- Interactivity with Python shell (NumPy supported) on https://plot.ly.
26+
27+
Extensive options for sharing and collaboration:
28+
29+
- 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.
30+
- Keep graphs private, share publicly with a URL, or share with your team.
31+
- Invite others to collaborate with you and edit together.
32+
- Plotly sharing supports comments, so others can both comment on the graph and graph right where it lives
33+
- 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.
34+
35+
Platform: UNKNOWN
36+
Classifier: Development Status :: 4 - Beta
37+
Classifier: Programming Language :: Python :: 2.7
38+
Classifier: Programming Language :: Python :: 3.3
39+
Classifier: Topic :: Scientific/Engineering :: Visualization

dist/plotly-0.5.8 2/README.txt

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
The Plotly Python Plotting Library lets you make collaborative, interactive, publication-quality graphs.
2+
3+
Main features for plotting are:
4+
5+
- Complete control over every aspect or your graph, including colors, size, font, layout, and styling.
6+
- Plotly can make line charts, scatter plots, histograms, 2D histograms, box plots, heatmaps, and error bars. Plotly also supports log axes, and date axes.
7+
- Data and graphs are always together.
8+
- Easily add data to plots, or stream your data in from elsewhere--the web or your Raspberry Pi.
9+
- 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]”?
10+
- 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.
11+
12+
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.
13+
14+
Plotly also has a deep Python Integration:
15+
16+
- Works with IPython (see https://github.com/plotly/IPython-plotly).
17+
- Interactivity with Python shell (NumPy supported) on https://plot.ly.
18+
19+
Extensive options for sharing and collaboration:
20+
21+
- 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.
22+
- Keep graphs private, share publicly with a URL, or share with your team.
23+
- Invite others to collaborate with you and edit together.
24+
- Plotly sharing supports comments, so others can both comment on the graph and graph right where it lives
25+
- 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.
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .version import __version__
2+
from .plotly import signup
3+
from .plotly import plotly

dist/plotly-0.5.8 2/plotly/plotly.py

+237
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,237 @@
1+
import requests
2+
import json
3+
import warnings
4+
5+
from .version import __version__
6+
7+
def signup(un, email):
8+
''' Remote signup to plot.ly and plot.ly API
9+
Returns:
10+
:param r with r['tmp_pw']: Temporary password to access your plot.ly acount
11+
:param r['api_key']: A key to use the API with
12+
13+
Full docs and examples at https://plot.ly/API
14+
:un: <string> username
15+
:email: <string> email address
16+
'''
17+
payload = {'version': __version__, 'un': un, 'email': email, 'platform':'Python'}
18+
r = requests.post('https://plot.ly/apimkacct', data=payload)
19+
r.raise_for_status()
20+
r = json.loads(r.text)
21+
if 'error' in r and r['error'] != '':
22+
print(r['error'])
23+
if 'warning' in r and r['warning'] != '':
24+
warnings.warn(r['warning'])
25+
if 'message' in r and r['message'] != '':
26+
print(r['message'])
27+
28+
return r
29+
30+
class plotly:
31+
def __init__(self, username_or_email=None, key=None,verbose=True):
32+
''' plotly constructor. Supply username or email and api key.
33+
'''
34+
self.un = username_or_email
35+
self.key = key
36+
self.__filename = None
37+
self.__fileopt = None
38+
self.verbose = verbose
39+
self.open = True
40+
41+
def ion(self):
42+
self.open = True
43+
def ioff(self):
44+
self.open = False
45+
46+
def iplot(self, *args, **kwargs):
47+
''' for use in ipython notebooks '''
48+
res = self.__callplot(*args, **kwargs)
49+
width = kwargs.get('width', 600)
50+
height = kwargs.get('height', 450)
51+
s = '<iframe height="%s" id="igraph" scrolling="no" seamless="seamless" src="%s" width="%s"></iframe>' %\
52+
(height+50, "/".join(map(str, [res['url'], width, height])), width+50)
53+
try:
54+
# see, if we are in the SageMath Cloud
55+
from sage_salvus import html
56+
return html(s, hide=False)
57+
except:
58+
pass
59+
try:
60+
from IPython.display import HTML
61+
return HTML(s)
62+
except:
63+
return s
64+
65+
def plot(self, *args, **kwargs):
66+
res = self.__callplot(*args, **kwargs)
67+
if 'error' in res and res['error'] == '' and self.open:
68+
from webbrowser import open as wbopen
69+
wbopen(res['url'])
70+
return res
71+
72+
def __callplot(self, *args, **kwargs):
73+
''' Make a plot in plotly.
74+
Two interfaces:
75+
1 - ploty.plot(x1, y1[,x2,y2,...],**kwargs)
76+
where x1, y1, .... are lists, numpy arrays
77+
2 - plot.plot([data1[, data2, ...], **kwargs)
78+
where data1 is a dict that is at least
79+
{'x': x1, 'y': y1} but can contain more styling and sharing options.
80+
kwargs accepts:
81+
filename
82+
fileopt
83+
style
84+
layout
85+
See https://plot.ly/API for details.
86+
Returns:
87+
:param r with r['url']: A URL that displays the generated plot
88+
:param r['filename']: The filename of the plot in your plotly account.
89+
'''
90+
91+
un = kwargs['un'] if 'un' in kwargs else self.un
92+
key = kwargs['key'] if 'key' in kwargs else self.key
93+
if not un or not key:
94+
raise Exception('Not Signed in')
95+
96+
if not 'filename' in kwargs:
97+
kwargs['filename'] = self.__filename
98+
if not 'fileopt' in kwargs:
99+
kwargs['fileopt'] = self.__fileopt
100+
101+
origin = 'plot'
102+
r = self.__makecall(args, un, key, origin, kwargs)
103+
return r
104+
105+
def layout(self, *args, **kwargs):
106+
''' Style the layout of a Plotly plot.
107+
ploty.layout(layout,**kwargs)
108+
:param layout - a dict that customizes the style of the layout,
109+
the axes, and the legend.
110+
:param kwargs - accepts:
111+
filename
112+
See https://plot.ly/API for details.
113+
Returns:
114+
:param r with r['url']: A URL that displays the generated plot
115+
:param r['filename']: The filename of the plot in your plotly account.
116+
'''
117+
118+
un = kwargs['un'] if 'un' in kwargs.keys() else self.un
119+
key = kwargs['un'] if 'key' in kwargs.keys() else self.key
120+
if not un or not key:
121+
raise Exception('Not Signed in')
122+
if not 'filename' in kwargs.keys():
123+
kwargs['filename'] = self.__filename
124+
if not 'fileopt' in kwargs.keys():
125+
kwargs['fileopt'] = self.__fileopt
126+
127+
origin = 'layout'
128+
r = self.__makecall(args, un, key, origin, kwargs)
129+
return r
130+
131+
def style(self, *args, **kwargs):
132+
''' Style the data traces of a Plotly plot.
133+
ploty.style([data1,[,data2,...],**kwargs)
134+
:param data1 - a dict that customizes the style of the i'th trace
135+
:param kwargs - accepts:
136+
filename
137+
See https://plot.ly/API for details.
138+
Returns:
139+
:param r with r['url']: A URL that displays the generated plot
140+
:param r['filename']: The filename of the plot in your plotly account.
141+
'''
142+
143+
un = kwargs['un'] if 'un' in kwargs.keys() else self.un
144+
key = kwargs['un'] if 'key' in kwargs.keys() else self.key
145+
if not un or not key:
146+
raise Exception('Not Signed in')
147+
if not 'filename' in kwargs.keys():
148+
kwargs['filename'] = self.__filename
149+
if not 'fileopt' in kwargs.keys():
150+
kwargs['fileopt'] = self.__fileopt
151+
152+
origin = 'style'
153+
r = self.__makecall(args, un, key, origin, kwargs)
154+
return r
155+
156+
class __plotlyJSONEncoder(json.JSONEncoder):
157+
def numpyJSONEncoder(self, obj):
158+
try:
159+
import numpy
160+
if type(obj).__module__.split('.')[0] == numpy.__name__:
161+
l = obj.tolist()
162+
d = self.datetimeJSONEncoder(l)
163+
return d if d is not None else l
164+
except:
165+
pass
166+
return None
167+
def datetimeJSONEncoder(self, obj):
168+
# if datetime or iterable of datetimes, convert to a string that plotly understands
169+
# 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
170+
import datetime
171+
try:
172+
if isinstance(obj,(datetime.datetime, datetime.date)):
173+
if obj.microsecond != 0:
174+
return obj.strftime('%Y-%m-%d %H:%M:%S.%f')
175+
elif obj.second != 0 or obj.minute != 0 or obj.hour != 0:
176+
return obj.strftime('%Y-%m-%d %H:%M:%S')
177+
else:
178+
return obj.strftime('%Y-%m-%d')
179+
elif isinstance(obj[0],(datetime.datetime, datetime.date)):
180+
return [o.strftime('%Y-%m-%d %H:%M:%S.%f') if o.microsecond != 0 else
181+
o.strftime('%Y-%m-%d %H:%M:%S') if o.second != 0 or o.minute != 0 or o.hour != 0 else
182+
o.strftime('%Y-%m-%d')
183+
for o in obj]
184+
except:
185+
pass
186+
return None
187+
def pandasJSONEncoder(self, obj):
188+
try:
189+
import pandas
190+
if isinstance(obj, pandas.Series):
191+
return obj.tolist()
192+
except:
193+
pass
194+
return None
195+
def sageJSONEncoder(self, obj):
196+
try:
197+
from sage.all import RR, ZZ
198+
if obj in RR:
199+
return float(obj)
200+
elif obj in ZZ:
201+
return int(obj)
202+
except:
203+
pass
204+
return None
205+
def default(self, obj):
206+
try:
207+
return json.dumps(obj)
208+
except TypeError as e:
209+
encoders = (self.datetimeJSONEncoder, self.numpyJSONEncoder, self.pandasJSONEncoder, self.sageJSONEncoder)
210+
for encoder in encoders:
211+
s = encoder(obj)
212+
if s is not None:
213+
return s
214+
raise e
215+
return json.JSONEncoder.default(self,obj)
216+
217+
def __makecall(self, args, un, key, origin, kwargs):
218+
platform = 'Python'
219+
220+
args = json.dumps(args, cls=self.__plotlyJSONEncoder)
221+
kwargs = json.dumps(kwargs, cls=self.__plotlyJSONEncoder)
222+
url = 'https://plot.ly/clientresp'
223+
payload = {'platform': platform, 'version': __version__, 'args': args, 'un': un, 'key': key, 'origin': origin, 'kwargs': kwargs}
224+
r = requests.post(url, data=payload)
225+
r.raise_for_status()
226+
r = json.loads(r.text)
227+
if 'error' in r and r['error'] != '':
228+
print(r['error'])
229+
if 'warning' in r and r['warning'] != '':
230+
warnings.warn(r['warning'])
231+
if 'message' in r and r['message'] != '' and self.verbose:
232+
print(r['message'])
233+
234+
return r
235+
236+
237+

dist/plotly-0.5.8 2/plotly/version.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '0.5.8'

dist/plotly-0.5.8 2/setup.cfg

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[egg_info]
2+
tag_build =
3+
tag_date = 0
4+
tag_svn_revision = 0
5+

dist/plotly-0.5.8 2/setup.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from setuptools import setup
2+
exec(open('plotly/version.py').read())
3+
def readme():
4+
with open('README.txt') as f:
5+
return f.read()
6+
7+
setup(name='plotly',
8+
version=__version__,
9+
author='Chris P',
10+
author_email='[email protected]',
11+
maintainer='Chris P',
12+
maintainer_email='[email protected]',
13+
url='https://plot.ly/api/python',
14+
description='Python plotting library for collaborative, interactive, web-based, publication-quality graphs.',
15+
long_description=readme(),
16+
classifiers=['Development Status :: 4 - Beta',
17+
'Programming Language :: Python :: 2.7',
18+
'Programming Language :: Python :: 3.3',
19+
'Topic :: Scientific/Engineering :: Visualization',
20+
],
21+
license='MIT',
22+
packages=['plotly'],
23+
install_requires=[
24+
'requests'
25+
],
26+
zip_safe=False)

dist/plotly-0.5.8/PKG-INFO

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Metadata-Version: 1.1
2+
Name: plotly
3+
Version: 0.5.8
4+
Summary: Python plotting library for collaborative, interactive, web-based, publication-quality graphs.
5+
Home-page: https://plot.ly/api/python
6+
Author: Chris P
7+
Author-email: [email protected]
8+
License: MIT
9+
Description: The Plotly Python Plotting Library lets you make collaborative, interactive, publication-quality graphs.
10+
11+
Main features for plotting are:
12+
13+
- Complete control over every aspect or your graph, including colors, size, font, layout, and styling.
14+
- Plotly can make line charts, scatter plots, histograms, 2D histograms, box plots, heatmaps, and error bars. Plotly also supports log axes, and date axes.
15+
- Data and graphs are always together.
16+
- Easily add data to plots, or stream your data in from elsewhere--the web or your Raspberry Pi.
17+
- 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]”?
18+
- 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.
19+
20+
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.
21+
22+
Plotly also has a deep Python Integration:
23+
24+
- Works with IPython (see https://github.com/plotly/IPython-plotly).
25+
- Interactivity with Python shell (NumPy supported) on https://plot.ly.
26+
27+
Extensive options for sharing and collaboration:
28+
29+
- 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.
30+
- Keep graphs private, share publicly with a URL, or share with your team.
31+
- Invite others to collaborate with you and edit together.
32+
- Plotly sharing supports comments, so others can both comment on the graph and graph right where it lives
33+
- 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.
34+
35+
Platform: UNKNOWN
36+
Classifier: Development Status :: 4 - Beta
37+
Classifier: Programming Language :: Python :: 2.7
38+
Classifier: Programming Language :: Python :: 3.3
39+
Classifier: Topic :: Scientific/Engineering :: Visualization

dist/plotly-0.5.8/plotly/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .version import __version__
2+
from .plotly import signup
3+
from .plotly import plotly

0 commit comments

Comments
 (0)