Depending on how you want to expose it you could use a client library that accesses something like ElasticSearch, or mongodb, or Redis. They are document or key/value-based and would have flexible storage for the data.
Or you could have a really simple service exposing an API using some micro Web framework like flask or bottle.
If you want to have the freedom to modify the back end without impacting your running apps too much then the service route gives you that separation where all of the logic is in the service and not the client.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CACt6Gr%3D1_cOL%3D6zkRdU0L5yAqdfHgqmM%3DLZ-5XmszKj08yyueg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Hi Eduardo,
I’ve got nothing in the pre-packaged arena to recommend, but if your looking to roll your own system, read on.
- accepts data and that you could retrieve it later in block.
Before having a server that can accept data, have you considered how to transmit your data? For instance, if you’re looking at rolling your own system, then one of the pattern you could use is called PUB/SUB, for publish/subscribe. I.e. your methods/functions publishes data and then something is out there listening. Also called producer and consumer.
Once the consumer has collected data, say in a mongodb database or in a simple text file, you can provide access to this datastore via a web interface, command-line or pyqt gui. Depending on your use, it may be helpful to think of keeping the production and consumption of your data separate; the opposite being finding a pre-packaged web-server and designing your messages for it specifically.
If separate, say in a text-file, retrieving the data is a mere open(path, 'r'), this is then equally applicable to both your web-server, and tools.
The production of message could look something like this:
___________
| |
| start |--> publish "A: starting MyTool"
|___________|
|
_____v_____
| |
| meth1 |--> publish "A: running MyCommand"
|___________|
|
_____v_____
| |
| meth2 |--> publish "A: wrapping up MyTool"
|___________|
Each message potentially transmitting dates and user and machine stats etc. You’d then have a consumer, listening for anything tagged “A”.
__________
| |
("A"--| listen |
|__________|
The important thing to note being that producing messages is a non-blocking operation and that there mustn’t be a consumer/listener at the other end; that is optional.
give response to calls with simple arguments
For this, there is the REQ/REP pattern, for request/reply, in which you could either send a message, synchonously, and await an arbitrary response:
>>> unpacked_message = {'status': 'ok', 'command': 'givz_cat'}
>>> packed_message = json.dumps(unpacked_message)
>>> socket.send(packed_message)
>>> packed_reply = socket.recv()
# Blocks here
>>> unpacked_reply = json.loads(packed_reply)
>>> process(reply)
Or you could go for something like the RPC pattern which mimics calling upon procedures as though they were local:
>>> reply = myobj.givz_cat()
>>> process(reply)
Each perform similar tasks (i.e. the bundling and serialising of commands) whereas an RPC masks it under a familiar, higher-level interface.
And finally, to make any of this possible, you can either roll your own low-level messaging mechanism, which in the case of REQ/REP isn’t that big of a deal (with e.g. socket module) depending on your aspirations, but for PUB/SUB would make life slightly more difficult. For this or both, I would suggest a MOM, or Message-Oriented Middleware, such as ZeroMQ. Whichever you choose, there are tutorials and use-cases in the ZeroMQ guide.
Hope it helps.
Best,
Marcus
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBC0NrHqYbkNDm%2BDHTnxeYtRUpafv70tKqT9ZSqqgrDOA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CACt6GrnQKYtjvamUZW_aopazG%3DJTBbOxV31kuUndCczBgfeTKA%40mail.gmail.com.
Looks cools. I couldn't tell at a glance if it was fully paid service or if the Pypi package is a self hosting open source version.
For something a bit more generic that let's you visualize basically anything in your custom data you can also check out Kibana:
http://www.elasticsearch.org/overview/kibana/
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAtaygYqhAQV9RfYVXbEqcWE%2BctCuNicsdw%2Bb2vMmiPOw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0FU-Vue0pYUAwgQ8ZKb0bim%2BQoA3MhJ-6XycWXPLZc7w%40mail.gmail.com.
I don't see this as heavy handed at all (unless you are paying for something). It is relatively simple to spin up an instance of elastic and start throwing arbitrary data at it.
We have people here at the studio in different departments that use both Kibana and Grafana (graphite) to visualize data that we are chucking into elastic. Once you have it set up you are just making different graphs and aggregations. Or making a query to say "give me all messages for application foo between this date range and with 'warning' in the message"
It would probably be more work to use a basic logging system and then have to use your own tools to parse and visualize the data.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAJ7DUfCvEJQiR_rBcfrQJYTapmfqEJ%3D-cENgFmDmom8A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1nSn%2BY4vSO4gBt7Ntd8U%3D9c0w2XN78rmbjxgvfYv%3DOhg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBRBPc04Pt5RhhHX4Kkpez3Z4XH5gJK_C2te3Qhsxxf%3Dw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CACt6Grk76rT7rnODi60qHjMMvZ8Km9WbaWJbSuhGeqJbjSuvFg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CACt6Grk76rT7rnODi60qHjMMvZ8Km9WbaWJbSuhGeqJbjSuvFg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODzjMtSC22skeZ_i%3DpJ6hHNY-kMQGN7RBWiDLdCp5d_sg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CACt6GrkxbZczKdVKCGtjy%3DaY20tkReg0JXnYC4rrvGSXdY--xw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCrduVgBV7hcs2ZVwt8AjicCFNAmQY4HL3KxZG8Kgbj_A%40mail.gmail.com.
Hi
How about setting up a MySQL server and create a create- or write-only user that your tools can use? Many hosting solutions provide MySQL out of the box. You don't risk unwanted personell from reading your data unless they get a hold of your admin-password or site admin details. Also you can use MySQL workbench or phpmyadmin to view your data without writing your own tools. The drawback? You have to learn sql to add data to the database or make queries. This can get a bit tricky if you want to make detailed queries. Also, in contrast to mongodb and elastic, it's not document based and entities must follow a strict schema. Sorry if you already know everything about SQL databases, without implying that I do. Just throwing it in here.
/Nils
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CACt6Grm0Ong%3DRFc_sSTqUqP_ruVfqZWoye%2B46NeH0ucvhbZ0VA%40mail.gmail.com.