views:

637

answers:

5

Hi, I have been building business database applications such as finance, inventory and other business requirement applications. I am planning to shift to Python. What would be the tools to start with best. I would need to do master, transaction forms, processing (back end), reports and that sort of thing. The database would be postgress or mysql. As I am new to Python I understand that I need besides Python the ORM and also a frame work. My application is not a web site related but it could also be need to be done over the web if needed.

Pls help me to choose the initial setup of tool combinations, thanks in advance.

Sebj

+2  A: 

If I were you I would start with django.

Macarse
+1: It can be bundled to run on the desktop as if it were a single stand-alone application. Google "Django Desktop" for lots of hints.
S.Lott
+1  A: 

As Boudewijn Rempt wrote here, "for the easiest way to create a [[NON-web]] database application, you might want to take a look at PyQt". He wrote this 6 years ago, but I think it's perfectly true today, too. pyqt4's QtSql module, in particular, supports MySQL, PostgreSQL, and several other databases.

Alex Martelli
+1  A: 

If your application needs to work both on the desktop and on the web in the future, you can consider creating a web-based application with a distributable server. Such things are pretty easy to do with Python both in trivial ways and in more powerful ones such as using Twisted.

If desktop only is your direction, then indeed as Alex has said - go for PyQt. It's really easy to use and provides very powerful GUI capabilities with versatile DB bindings.

As for the DB - which one are you accustomed to using? If you're, say, a MySQL guru, it would be prudent to first of all check out Python's MySQL bindings. For an ORM definitely try SQLAlchemy.

Perhaps more details in the question can help providing a fuller answer.


More details (for your comment):

If PostgreSQL is your direction, Python has PyGreSQL as a binding. It is open-source, like Python itself, so you should have no problem with cost-free applications for the user. As for Python being the right choice, I think it is. Consider that many powerful websites run Python (YouTube, Reddit, even Google for some applications). Python is also used in several high-volume applications such as the source control systems Mercurial and Bazaar, and the mailing list manager mailman.

Eli Bendersky
Well my current skills in RDBMS is in Oracle but I am planning to use Postgress as it supports backend procedures. The nature of the application is small to medium size business applications. But at this time these applications are expected to be web type as well. It is going to be mostly retrieving and manipulating data. Just 1 more question in general... I hope I am not wrong in choosing Python as I have to start from 0 but I want to develop applications which are COST FREE to customer. Applications rarely could be desktop but mostly multi-uer also.
A: 

just FYI, for PyQT, the book has a chapter 15 with Databases, It looks good. and the book has something with data and view etc. I have read it and I think it's well worth your time:)

sunqiang
+2  A: 

If I were you, I would probably first look whether a web-based solution based on Django does the trick. If you need a little bit better look and feel, add jQuery to the mix. If it provides way too little functionality, go for PyQt. If you have a lot of very small applications, go for a mix of technologies. Below, you find my (somewhat lengthy) reasoning for this recommendation.

Webapp vs. desktop application

One year ago, we had a business db and needed a front-end. We had to decide what technology to use for the front-end. We considered:

  1. PyQt
  2. Web-based (look here for an overview of web frame-works for Python)

The advantages for PyQt from our perspective:

  • Previous C++ experience with Qt from which we knew that Qt is suited for the task.
  • All necessary tools included.
  • Easy to develop rich clients.

We however decided against PyQt and for a web-based solution instead. Reasons were:

  • The requirements for the front-end were modest and easy to do within a browser (mostly reporting, some forms for entering data or running functions).
  • Deployment of the application (and new versions, bug fixes, etc.) is much easier as everything only happens on the server in a controlled environment.
  • Access control / authentification / rights is "for free" as it is part of the server (in our case Apache using Active Directory Authentification) and the browser, which is important for us.
  • The application needed server connection anyways and didn't have to store anything on the client's side.

In a nutshell: feature-rich front-ends with a lot of functionality in a controlled deployment environment are probably easier to implement with Qt. For our light-weight front-ends, a server-based solution seemed better to us.

Which web framework?

Now that we had decided on a technology, we had to choose a framework. We researched a bit, and looked at two alternatives in detail:

  1. Django
  2. A stack of software consisting of CherryPy as dispatcher (to match http requests to functionality and all the related stuff), Mako as a templating library to generate web-pages, SQLAlchemy as an ORM, and jQuery for client-side functionality.

We evaluated the two alternatives, and at the end settled for the second one. The decision was driven by our really "light-light-weight" front-end requirements (a lot of very small applications). A stack of software - which we can mix and match as needed - seemed better to us. We can re-use SQLAlchemy in situations, where we don't need a web-front-end, we can just use CherryPy without a templating library and a ORM, and so on. In many other cases, I would however choose Django over this stack.

To sum up:

  • one big, complex application -> PyQt
  • a set of relativily similar, straigtforward reports, forms, etc. with one look-and-feel -> Django
  • a relatively diverse set of things that differ widely in requirements and used technology or re-use of some technology in other circumstances -> mix of technologies as needed
stephan
Stephan thanks for that post. I my case the requirements at the front are normally not very complicated. I will take time to evaluate Django.