ESB for Python? [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
At work we're debating choosing an off-the-shelf full-stack ESB (Enterprise Service Bus -- http://en.wikipedia.org/wiki/Enterprise_service_bus ) versus rolling our own around an AMQP system such as RabbitMQ.
Part of the concern is that our ecosystem is PHP moving as fast as possible to Python, and what APIs we already have all pass messages in JSON. The search space on ESBs and 'SOA solutions' is really, really polluted; either that or this just isn't a Python Thing(tm). Thus I ask here: it seems that all full-stack ESB solutions that we've considered are primarily focused on integrating SOAP-based components. That seems like a lot of double wrapping and unwrapping of messages that we may not want to do. Also, we'd really like to write our service-to-ESB adapters in Python if we can.
I should note here that the PHP/Python ecosystem is internal -- many of our clients are fairly hidebound organizations using big monolithic enterpriseware with which our apps integrate. They would be happy with SOAP, XML-RPC etc for our customer-facing APIs. We've already had requests. So, at the border, we may end up eventually providing both JSON-based and SOAP-based services; just not internally.
tl;dr: Does anybody have a favored full-stack ESB for use with Python apps? What about a non-favored one that you've worked with (and how terrible was it, anyway)? Do you think that wrapping something like RabbitMQ is a better idea for a PHP/Python ecosystem?

It really is a big question, more like a couple of questions in one, if I may. So please excuse me if I misunderstood you.
An ESB is, by definition, not really coupled to your choice of language in implementing your applications. So no matter if your apps that you want to connect in a SOA manner are written in PHP or Python, you should be able to expose them in a SOA. JSON on the other hand is a bit of an off choice in the SOA world and this choice is really important.
Many of the COTS ESBs offer some level of REST support. Mule, ServiceMix, WSO2, JBoss are some open source ones. If you prefer to go with a commercial vendor I believe Tibco and Oracle have either out-of-the-box support or can be implemented with a bit of coding.
Your choice of using any of the message brokers such as RabbitMQ or AMQP is really about the transport - which is once again not really directly related. Then again, if your goal is to add messaging among your applications it is a valid question which I cannot really answer.
If you can write your main motivation for your interest in an ESB it would be helpful for a better answer.
HTH

Wow...that's quite the question, and there's no way that I can answer it fully...but since you asked here's the proverbial 2 cents:
RabbitMQ is pretty good. I'm using it for real-time messaging in a multi-agent system that implements caching on a scientific computing grid. One of the nice features of RabbitMQ is that you can push arbitrary (including binary) messages, which might be a nice feature for performance. (Perhaps using the serialization / deserialization from the Hessian protocol?)
My only concern with RabbitMQ would be the continued support of the python libraries for AMQP. The current libraries are functional, I've used them...but they haven't been around long, and I'm not sure how big the community is that's interested in and supporting such work. That said, it seems like RabbitMQ (AMQP, and messaging in general) are becoming a hotter topic as of late, and hopefully that would broaden the base that's working on the python - AMQP interface libraries.

Related

Django and Node – how does it work? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
In order to make an web application with RESTful capabilities I have read and watched tons of articles and videos and I still do not get a complete picture of how it works. And which I should chose. Every other answer is the not helpful ”it depends”. I have boiled it down to a first choice between Django and Node. But nowhere I find the whole ”picture” of how the pieces works together and which modules are needed. Therefore I have tried to put all into a rough illustration. Note that I am a complete newbie on this.
I develop an ERP application with accounting modules. Basically it is mainly about CRUD besides viewing diagrams, printing and storing documents. So this is the ”it depends”
The only thing I have managed to make decisions about is to use nginx, Postgresql and Debian 8 as tools/os. These are the fixed stars.
My questions are not really the common Django vs Node.js and it is not just an opinion I want:
Is the picture below correct? Any comments?
Is there any further components that will be needed? To get started?
You have a lot of questions - and on StackOverflow there should be one question that can be answered without generating a lot of debate or have opinions rather than facts.
As such, I think your question might be closed as "too broad"; however I think it deserves an answer.
I am not going to say "it depends", although that's really all it boils down to - but here is my attempt to explain it.
nodejs is a runtime. It is an environment which allows you to develop code on the server using javascript. In order to do anything useful with nodejs, beyond "hello world"; you'll need to use a framework, and there are tons of those around and various stacks have been developed by the community to tie in all the components together. An example of such a stack is MEAN, which is MongoDB for the database, Express for the framework, Angular to assist with the front-end, and Node to run it all.
django is a framework - it is not a runtime. This means that it is one step removed from the node world. The runtime for django is Python. django also is not a "stack" like MEAN, you can develop your own stack on top of it - but since django is a "batteries included" framework, you only really need to add a database to it - it includes everything else you need.
REST is just a way of designing web-services. Its not a language, or a platform or a library. Its a set of rules that describe a way to design APIs such that they take advantage of the semantic verbs of HTTP.
You can use any library and programming language to develop a RESTful service. All you really need is two things [a] a library to communicate over HTTP [b] a way to serialize data, preferably in JSON (but even that's not a requirement).
nginx is just a very fast webserver and a reverse proxy. The reason it is mentioned often - is because it is very expensive for a framework to serve static media. All requests to a framework (either in django world, or in nodejs world) have to go through a large chain of components that help decode the HTTP request and create a data structure that is easy for developers to use. This chain of components is often called middleware. Since each and every request has to go through this middleware, it is better for performance reasons that requests that don't need the "power" of the application to execute (like a request for an image, a stylesheet, a video file) be handled by something else. This is what nginx is used for, since its a very fast webserver.
Now that those are explained, you need to see what stack works best for your application. To do that, you need to know a bit about the philosophy/justification or problem that each stack is trying to solve.
For django - this is easy. Django was created by a team working on multiple newspapers to help them manage content that was published on different sites. As such, it is designed so that the management of content is of primary concern. That is why it has a very robust administration console as a standard component; and a built-in quite robust ORM and its own templating engine. Django leaves it up to you to figure out how best to actually run and deploy it; although they do provide a lot of suggestions and examples - but in the end, its upto you to decide which database to use, which web server to use, and how to deploy the application.
In the nodejs world - the primary focus is nonblocking I/O and speed of response. Nodejs excels at being able to serve a lot of simultaneous requests on limited resources. Therefore, it provides you a very powerful foundation to develop applications that need to quickly respond to requests ... and that's it. When you program in node or any other specialized lower-level library, you need to make sure your code is taking complete advantage of the library. So, if you start writing blocking code in node, you'll find that the performance that you expect hasn't been achieved.
nodejs doesn't care what the application actually does. Think of it like a very fast, very powerful tool. You can build anything with it, but you need to know what the tool is designed to do best in order to know when to use it.
nodejs has you working at a lower level - which is why there are a lot of packages that help you do all sorts of things with node; and multiple ways you can take components and create your own stack - depending on what you are building on top of node. Think of it like Lego building blocks.
nodejs and django are not mutually exclusive. You can utilize both in your application and exploit their strengths and take advantage of what each does best.
As far as your specific questions:
Did I get the picture? Any comments?
I don't know. Did you?
Is there any further components that will be needed? To get started?
The answer to this is yes, because you don't want to build everything from scratch. Each stack has its own libraries components for developing services. For django, there is django rest framework (DRF).
Which framework are best for CRUD?
Which framework are best for RESTful? Any other module needed?
Best report generator for printing?
Best diagram tools?
There is nothing that is "best" for anything. This question is just asking for opinions. Its like asking, what is the best fruit juice?
Which framework are fastest and most reliable for CRUD using Postgresql
People have developed many robust applications on top of postgresql; however as nodejs is bound to javascript - there is still a lot of work being done in this area.
Can I lock the library (trade secrets) in both environments?
Yes.
Is there better tools for creating ERP/Accounting?
ERP and accounting are two very different things. There are tons of accounting packages/applications written in Python. There are very few ERP systems written in Python.
You cannot combine the two and lump it together.
What is the benefits using Angular on top of Node.js?
The same benefit of using Angular on top of _____ (insert your favorite backend). Angular is just a front end library.
An anecdotal benefit is that both Angular and Node use the same programming language.

Where can I find Python code examples, or tutorials, of social networking style functions/components? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am looking for tutorials and/or examples of certain components of a social network web app that may include Python code examples of:
user account auto-gen function(database)
friend/follow function (Twitter/Facebook style)
messaging/reply function (Twitter style)
live chat function (Facebook style)
blog function
public forums (like Get Satisfaction or Stack Overflow)
profile page template auto-gen function
I just want to start getting my head around how Python can be used to make these features. I am not looking for a solution like Pinax since it is built upon Django and I will be ultimately using Pylons or just straight up Python.
So you're not interested in a fixed solution but want to program it yourself, do I get that correctly? If not: Go with a fixed solution. This will be a lot of programming effort, and whatever you want to do afterwards, doing it in another framework than you intended will be a much smaller problem.
But if you're actually interested in the programming experience, and you haven't found any tutorials googling for, say "messaging python tutorial", then that's because these are large-scale projects,- if you describe a project of this size, you're so many miles above actual lines of code that the concrete programming language almost doesn't matter (or at least you don't get stuck with the details). So you need to break these things down into smaller components.
For example, the friend/follow function: How to insert stuff into a table with a user id, how to keep a table of follow-relations, how to query for a user all texts from people she's following (of course there's also some infrastructural issues if you hit >100.000 people, but you get the idea ;). Then you can ask yourself, which is the part of this which I don't know how to do in Python? If your problem, on the other hand, is breaking down the problems into these subproblems, you need to start looking for help on that, but that's probably not language specific (so you might just want to start googling for "architecture friend feed" or whatever). Also, you could ask that here (beware, each bullet point makes for a huge question in itself ;). Finally, you could get into the Pinax code (don't know it but I assume it's open source) and see how they're doing it. You could try porting some of their stuff to Pylons, for example, so you don't have to reinvent their wheel, learn how they do it, end up in the framework you wanted and maybe even create something reusable by others.
sorry for tl;dr, that's because I don't have a concrete URL to point you to!

What non web-oriented Python frameworks exist? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking for a good framework on which to base my applications development.
In PHP I use Symfony, in ActionScript PureMVC, they are all MVC frameworks.
I'm looking for a Python framework being oriented towards general purpose application development, not web application. I mean, just applications, services, daemons and so on.
Sometimes I have not a real view to implement, just an RPC service. Other times I have to code for a serial port, or implement a command scheduler, or whatever.
What is the best open source software I can think of as a standard base for my needs? Why do you think your suggestion will fulfill my requirements over its competitors?
EDIT:
For "general purpose" I mean not being strongly bounded to be with or without a GUI, being a daemon or a command-line application, being multiprocess/multithread or not. Being general, giving a good architecture structure, not being a particular tool.
EDIT 2:
I'd want to explain that the question is about the eventual existence of one or more "frameworks" not being bounded to any particular use case, but being able to give a good and well standardized startup structure/architecture, with some best practices applied, being a guideline, something being able to guide the architecture planning of the application itself, not of their behavior regarding tasks to perform.
I think this question is not so subjective, maybe wrong exposed because of my English, but I suppose it is legal
For network services needing to handle numerous connections asynchronously, a great many people favor Twisted.
Outside of that (and web applications), however, there's simply less need for overarching frameworks in Python than with many other languages -- the core language itself is expressive, powerful, and comes with batteries included; why add anything?
I would guess what you're looking for might be the Enthought Tool Suite (ETS), particularly Envisage (extensible plug-in architecture for scientific applications).
Check out the Zope Component Architecture. It's an architecture to use and reuse components. It's mostly used in web applications because it's used in Zope (as the name implies) but it is in no way web specific.
I wrote a quick intro to it:
http://regebro.wordpress.com/2007/11/16/a-python-component-architecture/
Here is an online book about it: http://www.muthukadan.net/docs/zca.html
And here is a non-online book: http://www.amazon.com/dp/354076447X
I'm having difficulty imagining what a "framework" would be that unifies "with or without a GUI, being a daemon or a cmd line app, being multiprocess/multithread or not". What do you expect such a framework to provide?
Frameworks are built to encapsulate various basic tasks - GUI, or web, or asynchronicity, or whatever - so that, as you say, users don't have to reinvent them. But you're explicitly excluding all the things that make a framework a framework, so I can't see what you're left with.
About the only thing you don't exclude is database access (ORM). If that's all you want, look at sqlalchemy.
"not being bounded to be with or without a GUI" doesn't make a lot of sense.
GUI's -- generally -- are quite complex and require a framework. Folks use tkinter, pyQT, pyGTK, wxWidgets, etc. to build GUI's.
"daemon or a cmd line app" does not require a framework of any kind. This is already part of the standard library.
"being multiprocess/multithread or not" is already part of the standard library.
Since, "general" doesn't have much meaning, there are several answers:
For GUI development, yes, there are many frameworks. "Best" is subjective.
For non-GUI development, there are no "additional" frameworks to speak of.
For "event driven networking", there is twisted.
For "Object-Relational Mapping", there are several. "Best" is subjective.
Python's core language and standard library are an amazing framework by themselves.
Only languages which are deficient in some way need a framework for efficient development of applications (example: JavaScript needs jQuery or Prototype).
The general approach with Python is:
Check the standard library; it probably has what you need.
If there's some large component that isn't in the standard library, there's probably a specific library that help with it.
Python bindings to GObject and GLib provide an application framework not bound to GUI or anything-- however, if it should be bound to a UI, GTK+ comes closer.
GLib provides functions such as an application main loop, events, signals and callbacks. GObject implements the base class for objects with connectable signal slots.
GLib also offers a lot of Filesystem abstraction, including VFS, trash handling, directory monitoring, file metadata.
The python reference is here:
http://library.gnome.org/devel/pygobject/stable/index.html
I don't think what you are asking for exists. Frameworks provide a common frame for similar applications, whereas you are asking for something for all applications. Almost by definition, such a thing can't exist.
Instead, for each application type, unless you find a framework for that specific type of app, you provide the framework yourself and use libraries to provide common functionality shared across applications. Python has many good libraries that come as standard and more can be found at PyPi.

Python Library/Framework for writing P2P applications [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Is there any library or framework for writing P2P applications in Python ?
I know the initial Bittorrent client was written in Python. I'm looking something like JXTA but for Python.
Twisted is pretty much the answer to anything seriously network-related in Python, but you really have to buy into the Twisted way of doing things. It's not intrinsically a P2P stack, it's an event loop, callback system and networking framework.
Divmod Vertex is not currently being maintained, and was still pretty rough when I tried using it a few years ago.
CSpace might be the closest to what you're looking for: "a platform for secure, decentralized, user-to-user communication over the internet." It abstracts the P2P and NAT traversal out so your app can act normally and not be "a P2P app."
Similarly, there was an old P2P system out of Australia called "The Circle" a few years ago, written entirely in Python, which had secure P2P messaging, chat, file sharing and other features. 0.41c was the last version: http://savannah.nongnu.org/projects/circle/
Also from my bookmarks:
http://entangled.sourceforge.net/ is Entangled, "a distributed hash table (DHT) based on Kademlia, as well as a peer-to-peer tuple space implementation."
http://khashmir.sourceforge.net/ is a Python distributed hash table, notable because it networks using the Airhook protocol, which is very fault-tolerant (designed for use e.g. over cellular networks).
http://kenosis.sourceforge.net/ is a Python P2P RPC system.
Best option I can think, of course, is to use twisted.
Old version of BitTorrent was built with it. The link is to last known version that uses twisted. You can study that as a starting point.
There's also Vertex. It is a library that uses twisted and allows p2p with firewall bypassing.
Since this question was asked and subsequently answered, ZeroMQ has emerged, and I REALLY like it. The Python module is called pyzmq. It makes the process building TCP sockets way less clunky, especially when dealing with message patterns other than Request>Respond, though it does that as well. It's great for basic servers, p2p apps, messaging, distributed processing, you name it.
I don't know if such a thing exists, though I can offer the following alternatives:
use Jython and JXTA
use Python C-API or SWIG and JXTA-C
I quote from the Sun JXTA pages which have a December 2002 date,
"Project JXTA has a Java reference implementation available from download.jxta.org, and is currently working to add reference implementations in other common languages, including C, Objective C, Perl, Ruby, and Python. Though the Java implementation is the most complete implementation of the JXTA protocols, the C implementation (available for both Win32 and Linux) is fast approaching the same level of completeness."
Hi (from the leader of the two last releases of JXTA for Java 2.6 & 2.7),
There is no known implementation of JXTA in Python.
If anyone wants to tackle this issue, one should learn about the JXTA 2.0 protocols first. The Practical JXTA II book available online for reading at Scribd should help understanding the technology.
Cheer!
Stackless Python might be of interest to you.

What's the best online tutorial for starting with Spring Python [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Spring Python seems to be the gold-standard for how to define good quality APIs in Python - it's based on Spring which also seems to be the gold-standard for Java APIs.
My manager has complained (with good reason) that our APIs are in a mess - we need to impose some order on them. Since we will be re-factoring it makes sense to take advantage of what is considered best practice - so we would like to consider Spring.
Could somebody point me to the best learning resources for getting started with Spring? I've googled for a while and not found anything which seems to start from first principles. I'm looking for something which assumes good knowledge of Python but zero knowledge of Spring on other platforms or it's principles.
How did you come to decide on Spring Python as your API of choice? Spring works well on Java where there's a tradition of declarative programming; defining your application primarily using XML to control a core engine is a standard pattern in Java.
In Python, while the underlying patterns like Inversion of Control are still apposite (depending on your use case), the implementation chosen by Spring looks like a classic case of something produced by a Java programmer who doesn't want to learn Python. See the oft-referenced article Python is Not Java.
I applaud your decision to introduce order and thoughtfulness to your codebase, but you may wish to evaluate a number of options before making your decision. In particular, you may find that using Spring Python will make it difficult to hire good Python programmers, many of whom will run the other way when faced with 1000-line XML files describing object interactions.
Perhaps start by re-examining what you really want to accomplish. The problem cannot simply be that "you need a framework". There are lots of frameworks out there, and it's hard to evaluate a) if you truly need one and b) which one will work if you haven't identified what underlying software problems you need to solve.
If the real problem is that your code is an unmaintainable mess, introducing a framework probably won't fix the issue. Instead of just messy code, you'll have code that is messy in someone else's style :-) Perhaps rigour in the dev team is where you should recommend starting first: good planning, code reviews, stringent hiring practices, a "cleanup" release, etc...
Good luck with the research.
I won't go so far as to suggest that Spring Python is bad (because I don't know enough about it). But, to call Spring Python the "gold standard for Python APIs" is a stretch. To me, it seems that Spring Python is more of a way to allow Python apps to interact with Java Apps using Spring.
At any rate, after taking a precursory glance at the official documentation, it seems fairly easy to understand for me having decent knowledge of Python but no knowledge of spring. Aside from the fact that it almost looks like Java code where the author forgot the typenames, semicolons, and curly braces. :-)

Categories