Skip to content

Commit

Permalink
start build dashboard server and client, will update readme meantime
Browse files Browse the repository at this point in the history
  • Loading branch information
litaotao committed Oct 6, 2015
1 parent ef59563 commit e0225f3
Show file tree
Hide file tree
Showing 28 changed files with 147 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# build directory

build
dist
IPython_Dashboard.egg-info

# pyc files
*.pyc
*.pyo


5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
recursive-include dashboard/template *
recursive-include dashboard/static *
include *.in
include *.md
include *.txt
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,19 @@ An stand alone, light-weight web server for building, sharing graphs in created

# To do

- edit box in a mask
- hover tips
- clean up code before merging to master
- template
- edit box in a mask
- hover tips
- clean up code before merging to master

- server
- docstring
- unittest
- travis ci
- pep 8

- issues
- import dashboard ...


# Related Projects
Expand Down
9 changes: 9 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


# redis
redis_host = 'localhost'
redis_port = 6379
redis_db = 0



27 changes: 27 additions & 0 deletions dashboard/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-

# built-in package

# third-parth package
import redis
from flask import Flask

# user-defined package
import config

'''
dashboard server setup
'''
app = Flask(__name__)




'''
dashboard common services setup
'''
r = redis.Redis(host=config.redis_host, port=config.redis_port, db=config.redis_db)


# import modules
import client, server
1 change: 1 addition & 0 deletions dashboard/client/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import sender
27 changes: 27 additions & 0 deletions dashboard/client/sender.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-

# built-in package

# third-parth package

# user-defined package
from dashboard import r


def sender(obj, key, value=""):
"""Send an object to storage[redis]. key is the obj name,
value is the serialized object[a dict most of the time]
Args:
obj: unserialized-obj need persistent in storage, currently using redis.
the object maybe [pandas.DataFrame, matplotlib.plt.plot, dict];
key: option, key to store in storage;
value: option, value to store in storage;
"""
# persistent key and value
value = value if value else obj.to_dict()

return r.set(key, value)



9 changes: 9 additions & 0 deletions dashboard/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


# redis
redis_host = 'localhost'
redis_port = 6379
redis_db = 0



Empty file added dashboard/server/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added dashboard/tests/__init__.py
Empty file.
Empty file added requirements.txt
Empty file.
5 changes: 5 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-

from dashboard import app

app.run(debug=True, port=9090)
40 changes: 40 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-

import os
import io
from setuptools import find_packages, setup


setup(
name="IPython-Dashboard",
version='0.1.0',
author="Taotao Li",
author_email="[email protected]",
url="http://litaotao.github.io",
license="BSD",
packages=find_packages(),
package_dir={"dashboard": "dashboard"},
include_package_data=True,
description="An stand alone, light-weight web server for building, sharing graphs in created in ipython. Let ipython do what it focus, let this do what everyone needs for building a interactive, collaborated and real-time streaming dashboards.",
long_description=io.open("README.md", encoding='utf8').read(),
install_requires=io.open("requirements.txt", encoding='utf8').read(),
classifiers=['Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3'],
zip_safe=False,
entry_points={
'console_scripts': [
]
}
)

0 comments on commit e0225f3

Please sign in to comment.