Python Forum

Full Version: data push from logger to server
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

Newb question here...

I'm trying to figure out how to push data from an electrical meter that is capable of sending XML to a server thru HTML POST.

I have a python script that Im interested in trying that can parse the XML to CSV, but for starters on the server end do I need to setup the server as an HTML server? Any recommendations on what to use? Like Appache or something similar setting up the server to accept the data push from the device to a server URL?

Thanks


my code here
Any web framework can accept xml as a post. To get started quickly, check out Flask: http://flask.pocoo.org/
Introducing apache/nginx depends on what your goals are. If this is exposed to the internet, then maybe. If it's just running locally at your home/business and isn't accessible outside the intranet, that might not be needed.

If you want to put a little more work into the server end of it, Twisted is also a good networking library: http://twistedmatrix.com/trac/
Quote:but for starters on the server end do I need to setup the server as an HTML server?
You can test all out locally Flask as posted over has a build in web-server.
Here a demo.
python app.py in browser http://127.0.0.1:5000/.
So getting a value from XML when push a button(call a Python function on the server side).

If you all new to this and web-development stuff with Python there is a learning process.
When it comes deploy,here some stuff that i like.
Gunicorn with Nginx(better than and easier than Apache) on host Digital Ocean.
There are host like PythonAnywhere and AWS Lambda Zappa,
they do all server side setup for you.