Creating Charts & Graphs with Python [closed] - python

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 8 years ago.
Improve this question
I'm looking for a python library/module that will allow me to create eye catching charts. The module must have/support the following
Windows Support
As I work mainly in windows(using Eclipse in Windows), this is crucial, a simple install .exe file (or adequate install instructions a must)
Work on Python 2.7
I've got Python 2.7.2 installed don't really want to go get some other thing.
Not require being on the web
I've looked at googlepychart, and it looks like you need to be on the web to make it work, I'm not on the world wide web, actually behind a VERY restrictive firewall.
Output should be viewable from HTML browser
While I cannot get onto the WorldWideWeb, I can see localhost, it would be great if the chart result be viewable in a browser.
Good documentation, at the very least some samples on how I can use the library.
If there are any suggestions on how I can create a web app using python that simply display/charts the data i pass in, such advice would be much appreciated

Plotly lets you make graphs using their online Python sandbox. Their gallery has some example scientific graphs with the Python scripts that generated them: https://plotly.com/python/. Here's a sample from the gallery:

matplotlib has become a mature and widely used graphing package.
As for your interaction with a web browser, you may have to use another package in conjunction. I suggest CherryPy because it is simple.

If you can do without using a browser, you can use one of Python Plotting Libraries. If you insist on using the browser, you would be better off using a javascript-based library for the view. I have used web2py web framework before along with protovis. But a simpler web framework like Bottle or CherryPy can also be used to pass the data to the view. Bottle has a Simple Template Engine (very similar to what I used in Web2py).
Developing in two languages (one of which is javascript) is a bit of a pain. You could use something like Pyjamas that translates python into javascript but I am not really sure if this would work out well, and I have no experience with it.

You may want to give details on the types of charts you want to make. Simple graphs are easy with sage and there are lots of options as compared to matlab. If you want more of a powerpoint chart, or picture you can insert into a word doc, then that's a little different.
If you can get something to create chart images, then you can hook it into a python web framework, such as django or pylons. That will allow you to set up a loopback server to host the page on your machine and view it on your machine. This is quite a bit more complex though.
My suggestion is to break your program down into pieces. It's like building a house out of lego brinks. You have an idea what you want it to look like, but the details determine everything. Break it down into the smallest pieces you can, and define larger pieces as groups of smaller pieces
The house is just several rooms. A room is just 4 walls, a floor and a ceiling. A wall is just several boards, and a board is 2x4. Once you break all the parts down, then you'll know not only what you need to make, but what you need to find for each piece.
You've got a good start with your list of requirements. That defines what you want your program to do. Now you need to work backwards to define the different parts. Don't get hung up on how they work, define the way they mesh.
For a simple python script to create a web server: see here. Note the section on dynamic content. By plugging that into a "black box" that produces your charts, you suddenly have a simple working setup. The charts section doesn't care how the user gets them, it just makes a chart and passes it out. The server doesn't care how the chart is made, it just serves it up.
This section of the sage manual has instructions for saving a plot after you create it.

Related

What should I use to deploy a python based image analysis program for an end-user on a server [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have written an SEM (Scanning electron image)-image analysis program in Python which is capable of calculating all the microstructural properties in an SEM image e.g. Identification of different areas in the image 2) calculate the area of specific regions in microns, diameters, circularity, etc. The final results are in the form of a graph(area in microns vs cumulative frequency vs percentage contribution) plotted with the help of Matplotlibrary in Python. I want to give this program on a server where anyone can use it through an interface without looking at the code. I am confused that what should I use to do so? Will Django be a good choice for this? But I suspect Django cannot perform all the tasks (Not sure). I have also read about Jenkins servers. Please guide me which approach should I use to deploy this image analysis program for any user on a server. Thanks
Cool stuff!
If you want to make a server where other user can interact with your program using a user interface then yes Django (or even better Flask) will work.
A very basic structure for your program is to have one endpoint which will render a simple html home page with a form input for uploading a file. Once the file is uploaded, the form is shipped to your backend which will accept the file and give it as an input to your python function for SEM file analysis. The function could then generate a figure which the user will be able to download. That would however require setting up a database (which is usually simple with Django). So yes you can go either with Django or Flask and everything should fall into place.
However, be careful with research project aimed towards people that do not want to deal with scripting or code. I've made a few research project like this for brain imaging data (with a GUI and all) and all of these project ended up being a huge time sink. There will be updates to the analysis to do, bugs on the user interface to fix and cryptic compatibility issues. I've come to the realization that it is much better to have the minimal amount of user interface for a project like this and spend more time documenting how to make the code run on the command line using a well crafted README.md. This allows you to focus on what has a lot of value for your research and also helps other people learn valuable skills.
Anyway, that last paragraph was just my opinion! If you feel like setting up a full-blown website for this project go for it!

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.

Drupal or Wordpress CMS as a Social Network? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am making a community for web-comic artist who will be able to sync their existing website to this site.
However, I am in debate for what CMS I should use: Drupal or Wordpress.
I have heard great things about Drupal, where it is really aimed for Social Networking. I actually got to play a little bit in the back end of Drupal and it seemed quite complicated to me, but I am not going to give up to fully understand how Drupal works.
As for Wordpress, I am very familiar with the Framework. I have the ability to extend it to do what I want, but I am hesitating because I think the framework is not built for communities (I think it may slow down in the future).
I also have a unrelated question as well: Should I go with a Python CMS?
I heard very great things about Python and how much better it is compare to PHP.
Your advice is appreciated.
Difficult decision. Normally I would say 'definitely Drupal' without hesitation, as Drupal was build as a System for community sites from the beginning, whereas Wordpress still shows its heritage as a blogging solution, at least that's what I hear quite often. But then I'm working with Drupal all the time recently and haven't had a closer look at Wordpress for quite a while.
That said, Drupal has grown into a pretty complex system over the years, so there is quite a learning curve for newcomers. Given that you are already familiar with Wordpress, it might be more efficient for you to go with that, provided it can do all that you need.
So I would recommend Drupal, but you should probably get some opinions from people experienced with Wordpress concerning the possibility to turn it into a community site first.
As for the Python vs. PHP CMS question, I'd say that the quality of a CMS is a function of the ability of its developers, the maturity of the system, the surrounding 'ecosystem', etc. and not of the particular language used to build it. (And discussions about the quality of one established language vs. another? Well - let's just not go there ;)
I make websites both using Drupal and Django - sometimes with Pinax (Python). So let me try to set up the differences between Python and PHP, and the different CMS's.
Python - PHP
Pros for Python.
You tend to write more readable code making it easier to maintain. This has a big impact if you are going to do a lot of custom coding, now or in the future. However if you aren't going to make that much custom functionality, this doesn't matters.
Python and Django is buildt on OO, making it easy to reuse code, and is built on the DRY princip.
I find, that python is more intuitive to program in. In many cases it has a less weird / obscure syntax than PHP.
Cons for Python.
PHP is easier to host. More providers will allow you to run PHP and you can generally find PHP hosters a bit more cheaper than python hosters. If you have your own server, this wont matter.
Generally it's easier to code with python in many regards, but this is something that can be overcome simply by using more time with PHP. Also if you don't know python, that means you will have to invest some time learning it, and the things you can do with python. On the other hand it's a bit more difficult to find cheap hosting for Python projects.
Django/Pinax vs Drupal vs Wordpress.
It's always difficult to be able to say, which CMS?CMF to use. Which to choose is dependent on several factors.
How much custom coding are you going to do?
How much customization do you need?
How fine grained control over the system do you want?
Wordpress' strength is it's ease of use, and how you quickly and easily can setup a lot of things. You might be able to get a site like what you want with only a few hours spent. The problem with wordpress however, is when you want to make custom functionality. It doesn't have a strong API like Drupal, and you might have problems changing the output to give you exactly what you want.
Drupal's great strength is it's powerfull API, ability to customize and overwrite anything. In addition to all this, it also has a lot of modules giving you the ability to in many cases build your most/all of your site in a very short time. The problem with Drupal is, that it's not easy to use. You have to spend time learning the system and API before you can take advantage of it. the Drupal AI is also hard to navigate for newcomers, and it takes a while before you learn where the different things are. Drupal is a big machine though, and it can get a bit slow, unless you setup something like Varnish in front of it.
Django is made for rapid development. So once you get into it, which isn't that hard, you can quickly create apps to suite your needs. You have complete control over the urls. The problem with django is that it's not so easy to find the different apps that has been made and figure out which are good. The template system makes it easy to make the markup like you want, but you can't change the functionality of the apps the same way you can with Drupal. One thing to note, is that Pinax doesn't have a 1.0 release yet, while Drupal is on code freeze for it's 7.0 release.
All in all, with all these tools, the biggest challenge is finding out how to use them. If you know wordpress very well and just want to make this one site, you can just use it and be done with it. If however you want to take it further, I would suggest that you use either Django or Drupal. These two has some great development potential.
If you're open to Python, and are building a social / community site, I would check out Pinax for the Django web framework. It provides a lot of common social site features like user accounts, blogging, tagging, friend invites, etc.
Here's an example of a social site built using Pinax.
There's a WordPress extension called BuddyPress that'll give you a ready-to-go social network. If it suits you, it may be an easier solution than a Drupal install. If it doesn't suit you, though, I find Drupal more suited to extending in the long run.
I'd do it Drupal as it's a proven social networking platform and has te ability to be upgraded to do just about anything, from the vast range of modules on offer (read up on cck and views- they basically let you add your own customised page type (cck) and views lets you show data in various different ways, and based on various other parameters.)
I run my own mini social network site in Drupal - Tunstall Communities - Bankeyfields,
Heres a social network/news site using Wordpress, which they've now opted to upgrade to Drupal, as they want more social networking features.
DrupalSN is a social network site designed for showing you how to build Drupal sites, and a lot of the Tutorials on there are focussed on user interaction, so it will be a great resource if you go with Drupal.

What are some good projects to make for a newbie Python (but not new to programming) developer? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I'm downloading Python 3.1.1 and that comes with the IDLE correct?
I'm also downloading QT for Windows which I'm told is a good GUI framework to work with Python.
What projects should I try to make in order to grasp some of the goodies Python brings to the table?
Thanks a bunch SO.
I highly recommend
http://www.diveintopython3.net
It assumes you already understand programming, and walks you through examples that demonstrate the unique abilities of Python.
Do the next project you intended to program with your prefered language with Python.
If you are new to python, why not start with some simpler command line projects? I know you said you are not new to development, but maybe you should spend some time with the core python stuff before tacking on a GUI framework. Just a suggestion.
Also, I would point out that Python 3+ code looks a bit different than a lot of the python 2.x code samples you will see around the internet. I have found Python 3 to be not the best in terms of backward compatibility. You might want to start out with a 2.x version of Python to get the most out of the plethora of Python tutorials on the internet, then move to Python 3 if you need it.
Write a simple Text Editor.
That was one of the projects i started when i first learned python. It gets you used to the GUI framework, file IO, many types, OOP, lots... It's something that you can grow over time as your confidence builds and it's cross platform so it's handy.
If python is your first dynamic lanugage you might want to play with some of it's dynamic aspects.
For example, using the getattr and setattr methods on objects, you could write a class that provides a fluent way of accessing elements from an XML document. Rather calling methods on an object with parameters like 'xml.getnode("a").getnode("b")' you could dynamically lookup the nodes as attributes and allow 'xml.a.b' instead. I thought this was very cool having come from static languages.
Note that this won't neccessarily give you a great feel for python in general (although you'll pick up the language as you go) but it will give you a taste of what is possible in dynamic languages.
PythonChallenge
Code Golf
Google Code Jam
These are good ways to practice learning Python.
Might I also suggest that you consider using a different IDE.
If you are interested in GUI programming, I would suggest looking into wxPython, PyWin32, easyGUI, TkInter (which is bundled with the Python distribution)
Python Challenge This is fun and interesting to learn Python programming.
While it is a matter of personal preference, I certainly wouldn't want to play around with a GUI framework when starting out -- I would want to get a feel for the language first by playing around with smaller snippets, such as those suggested on Code Golf. While getting your code to fit into the smallest number of bytes perhaps isn't the best way to learn good design, I think it's a good way to learn parts of the language. Certainly, just doing the tasks without necessarily trying to compact them down excessively could be helpful.
A project I wish someone would write: a friendly GUI that wraps around the scanner library and the PDF library, and lets the user easily scan and file documents.
It would have a toolbar with big buttons: "scan letter", "scan brochure", "scan photo". These would respectively choose high-resolution black-and-white, medium-resolution color, and high-resolution color.
The user would plop down the document and hit one of those buttons. Python would wake up the scanner and have it scan, and then would use Python Image Library or something to auto-detect the size of the actual scanned document and auto-crop down to minimal size.
For "scan photo" you would get a JPEG. For the others, you would get a PDF. And it would have an option where you could scan several pages and then select the scanned pages, and say "group" and it would make a single PDF out of them.
Other useful toolbar buttons would be: "Copy Letter", "Copy Brochure", "Copy Photo". These would scan and then immediately print on an appropriate output device (or just on the default output device for your first version).
If you want to go crazy, you could add an OCR function to try to recover searchable text from the scanned images, and put that in the PDF as tags or something.
Someday I will write this if nobody else does...

Simple non-web based bug tracker [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 5 years ago.
Improve this question
There's a ton and and a half of questions and even more answers here concerning people looking for bug trackers. However all of them (that I found) seem to be about web based solutions. Since I'm working on a local project where I don't want to set up a web / DB server, and I don't want to use a hosted tracker either, I'm looking for something that runs locally.
very preferably open-source
pure Python or (at least) Windows executable
no need for a database server (sqlite is obviously fine)
Doesn't have to be fancy, just the basic bug / issue tracking functionality; just a little bit more than my current TODO text file or an Excel table.
Any suggestions?
I'm surprised nobody has mentioned Roundup.
It meets all your criteria, including not requiring a web-based interface (as per your specification, and unlike the accepted answer which suggested Trac).
Roundup is:
Open source
Pure Python
Supports SQLite
Not fancy, focuses on solid bug tracking
And as a significant point of differentiation, it has command-line and email interfaces in addition to a web interface.
It's very easy to get started - I suggest you take it for a spin.
Trac might be a bit too over engineered, but you could still run it locally via tracd on localhost.
It's:
opensource.
pure Python
uses sqlite
But as I said, might be too complex for your use case.
Link: http://trac.edgewall.org
If you don't need to share your bug tracker system with a team (i.e., it's okay to have it isolated to your computer) I would recommend using Tiddlywiki. Technically it's web-based, but it's entirely encapsulated within a single HTML document and requires no database or server whatsoever (only a web browser) so I think it follows the spirit of what you are wanting. It's extremely customizable since it's 100% HTML/CSS/javascript. I have been using a tiddlywiki as a project notebook for years, keeping track of my to-do list, bug list, and general project documentation in one centralized, cross-referenced place. You can also find all sorts of tiddlywikis that you can download pre-configured for productivity (for example, TeamTasks, MonkeyGTD, or GTDTiddlyWiki Plus).
Maybe Fossil is of any use to you?
It is actually a DVCS but it also integrates a bugtracker and wiki, very much like trac (although I like trac, don't get me wrong). And its webbased, on the other hand the installation is supossedly dead simple.
Proprietary TestTrack (http://www.seapine.com/ttpro.html) has a client edition that will those things. We use it at work and I'm very happy using it.
Maybe you can check out this wikipedia article for hints
http://en.wikipedia.org/wiki/Comparison_of_issue_tracking_systems
Do yourself a favor. Get over this "must not be web based" obsession, Install a local WAMP stack on your PC or on a LAN server. Now, you can install your own wiki. And something like Trac. I'd like to find an implementation of google code's bugtracker and integrated wiki thats runnable locally - Trac seems to be the closest.
You have also installed a local SVN server? Even for personal projects the ability to track changes over time. revert etc. and integration with Trac are too good to pass up even for purely 1 man projects.

Categories