Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
txemavs committed Mar 29, 2018
1 parent d6b981d commit 5741a8a
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 64 deletions.
57 changes: 9 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,22 @@ Adata Automation Framework

[![Documentation Status](https://readthedocs.org/projects/adata/badge/?version=latest)](http://adata.readthedocs.io/en/latest/?badge=latest)

**Adata** is a cross-platform python automation framework, focused on data, connections and "If This Then That" event handling.

The purpose of this application is to handle events with custom python scripts. The main interface is an interactive python console. It is based on a publisher/subscriber messaging pattern, so all the scripts can emit and listen to this event channels.
The purpose is to have a portable enviroment to quickly deploy custom python scripts anywhere, with the power of the WX Phoenix graphic user interface.

The application uses a twisted internet reactor with a graphical user interface, to create a portable application including a python interpreter and a set of frozen python packages, mainly:
Highlighs:

- The GUI and pubsub: WXPython 4 Phoenix
- Protocols: Twisted, Autobahn, Paho
- CMD2: Console commands
- CX_Freeze: to build the frozen portable enviroment
* A publisher / subscriber event handling system.
* A Twisted internet reactor ready to serve.
* Packages preinstalled in a portable frozen enviroment.

Adata uses the pub/sub channels to create "if this then that" automated tasks.

Any script can publish and be subscribed to a topic. You can be connected to MQTT or Websockets data streams, or create your own scheduled tasks to read databases or process files, and fire your events to a topic channel when something happens, so all the subscribed handlers get called.
You can deploy small services like a websocket server pushing data to "remote control" web applications, and connect MQTT devices, log to a database... it is python with some batteries.

Adata can run its own web server with websockets. This allows to push data to connected web pages acting both as live data display and remote event emmiters.
I needed a portable platform to maintain the Python scripts that I do for my clients that normally only have a bad Windows PC and a mobile.

Use examples:
- Use tablets as remote information display.
- Send and receive data from IoT devices.
- Check periodicaly databases and files.
- Scrap information from one or more pages.
- Render your custom web page.

The full frozen release also includes many other packages like Requests, LXML, BeautifoulSoup, Numpy, Matplotlib, Pandas, Selenium, SQL and Spreadsheet packages.

I needed a portable platform to maintain the Python scripts that I do for my clients that normally only have a Windows PC and a mobile.


The scripts
-------------

There are two folders to store python source code.

- scripts: The examples bundled
- modules: The private folder

Adata executes the script __auto__ at initialization, so you can run your modules to create GUI elements and start works.


Installation
------------
In Windows, you can simply download a frozen release and launch adata.exe.
If you are a developer:
- create your new python enviroment and activate it
- use pip to install the requires.txt package list
- clone this repository
- launch adata.py


Build
-----

If you want to use the cx_freezer to create your own portable enviroment, check and modify build.py to select packages and run:

<python> build.py build
[Read the docs...](http://adata.readthedocs.io/en/latest/?badge=latest)



21 changes: 19 additions & 2 deletions src/adata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,26 @@
https://github.com/txemavs/adata
Copyright (c) 2018 Txema Vicente Segura
MIT License
Installation
------------
In Windows, you can simply download a frozen release and launch adata.exe.
There is no pip install yet.
Build
-----
If you want to fork this:
- create your new python enviroment and activate it
- use pip to install the requires.txt package list
- clone this repository
- launch adata_run.py
If you want to use the cx_freezer to create your own portable enviroment, check and modify build.py to select packages and run:
<python> build.py build
'''
# Copyright (c) 2018 Txema Vicente Segura
Expand Down
11 changes: 10 additions & 1 deletion src/adata/tasks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#adata.tasks

'''
Threads
Threads and processes
Adata tasks can run on the main thread or spawn new threads. Any script can
publish and be subscribed to a pubsub topic.
You can be connected to MQTT or Websockets data streams, or create your own
scheduled tasks to read databases or process files, and fire your events to
a topic channel when something happens, so all the subscribed handlers do
their job.
TODO: Subprocesses
'''
Expand Down
7 changes: 4 additions & 3 deletions src/adata/window/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ def __init__(self, app):


def OnEcho(self, text, style="default", lf=True, marker=None, icon=None):
""" Handle a app.echo event at the main thread
Do not use **kwargs because the spec check
"""
''' Handle a app.echo event at the main thread
Do not use \*\*kwargs because the spec check
'''
wx.CallAfter(self.console.echo,
text = text,
style = style,
Expand Down
7 changes: 7 additions & 0 deletions src/build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
'''
CX_Freeze configuration and included packages.
I needed a portable platform to maintain the Python scripts that I
do for my clients that normally only have a bad Windows PC and a mobile.
Should work on any platform.
Tested on Windows 10 32 & 64bit. I had to use unofficial binaries.
'''

if __name__=='__main__':
Expand Down
26 changes: 16 additions & 10 deletions src/docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
Adata documentation
===================

**Adata** is a cross-platform python automation framework, focused on data, connections and event handling.
The purpose of this application is to handle events with custom python scripts. The main interface is an interactive python console with programmable commands and plug-in modules. It is based on a publisher/subscriber messaging pattern, so all the scripts can emit and listen to this event channels.

The purpose is to have a portable enviroment to quickly deploy custom python scripts anywhere, with the power of the WX Phoenix graphic user interface.
The application uses a Twisted internet reactor with a graphical user interface, to create a portable application including a python interpreter and a set of frozen python packages, mainly:

Highlighs:
- The GUI and pubsub: WXPython 4 Phoenix
- Protocols: Twisted, Autobahn, Paho
- CMD2: Console commands
- CX_Freeze: to build the frozen portable enviroment

* A publisher / subscriber event handling system.
* A Twisted internet reactor ready to serve.
* Packages preinstalled in a portable frozen enviroment.
Adata can run its own web server with websockets. This allows to push data to connected web pages acting both as live data display and remote event emmiters.

Use examples:
- Use tablets as remote information display.
- Send and receive data from IoT devices.
- Check periodicaly databases and files.
- Scrap information from one or more pages.
- Render your custom web page.

The full frozen release also includes many other packages like Requests, LXML, BeautifoulSoup, Numpy, Matplotlib, Pandas, Selenium, SQL and Spreadsheet packages.


Modules
-------


.. autosummary::
:toctree: api/
:template: package.rst
Expand All @@ -36,7 +44,7 @@ Modules
.. toctree::
:maxdepth: 2

api/modules
API <api/modules>


Related Documentation
Expand All @@ -47,5 +55,3 @@ Related Documentation
* `Twisted Internet <http://twisted.readthedocs.io/en/twisted-17.9.0/core/howto/internet-overview.html>`_
* `Websockets / WAMP - Autobahn <https://autobahn.readthedocs.io/en/latest/>`_
* `MQTT - Eclipse Paho <https://www.eclipse.org/paho/clients/python/docs/>`_


0 comments on commit 5741a8a

Please sign in to comment.