Python is Simple

The last python news

Python Hub
A simple tool to make parsing and finding best matches for Accept headers and mimetypes easier.


Python Hub
My 9 year old cousin learned some Python and wants more. Please help me teach him

Release Team Changes and Goals for OpenStack’s Mitaka Release Cycle

For the Mitaka cycle, we will be implementing changes designed to make it easier for project teams to manage their own projects, with less need for coordination and tight-coupling of the schedule. Enabling a New Model for Milestones During previous release cycles we have strictly synchronized teams around milestones, tagging pre-release versions of each project … Continue reading Release Team Changes and Goals for OpenStack’s Mitaka Release Cycle

Intensive Django Training with the US Air Force

Last week Audrey Roy Greenfeld and I had the privilege of teaching the US Air Force's 91st Cyberspace Operations Squadron the finer details of how to build, test, and deploy Django web applications.

It was a challenging, exciting experience for us as instructors. We've taught numerous Python and Django trainings over the years under Cartwheel Web , but this was the first time we taught as Two Scoops Academy using our new system of instruction.

The environment that the 91st Cyberspace ... read more →

How To Create Installable, Reusable Django Packages

What I mean by an "installable Django package": a reusable component that can be shared across Django projects, allowing us to combine our own efforts with others. Some examples include:

  • django-test-plus
  • django-crispy-forms
  • dj-stripe
  • dj-spam

Ever want to quickly create a similarly installable Django package to submit to PyPI and Django Packages? One that goes beyond the basics described in the Django tutorial? Specifically, a package that includes:

Looking for guest bloggers

Hi there folks! I am very busy now-a-days. You might already be aware of that due to the long pauses between posts. Therefore, I am searching for guest bloggers who would like to write about Python, it’s frameworks or literally anything interesting and informative related to Python. If you believe that you can do this then kindly drop […]

PyDev of the Week: Craig Bruce

This week we welcome Craig Bruce (@craigbruce) as our PyDev of the Week. Let’s see what he had to say! Can you tell us a little about yourself (hobbies, education, etc): My background is in computational chemistry and cheminformatics. What that really means is that I’m trained to work in the small, and mainly unheard, […]

PyDev of the Week: Brian Schrader

This week we welcome Brian Schrader (@sonicrocketman) as our PyDev of the Week. Brian blogs about Python and various other subjects of interest. You can get a taste of what open source projects he contributes to on his Github account. Let’s spend some time getting to know Brian better. Can you tell us a little […]

PyDev of the Week: Amit Saha

This week we welcome Amit Saha as our PyDev of the Week! Amit is the author of Doing Math with Python and Write Your First Program. Let’s take some time to get to know Amit better! Can you tell us a little about yourself (hobbies, education, etc): I am a software engineer (currently part of […]

PyDev of the Week: Arun Ravindran

This week we welcome Arun Ravindran (@arocks) as our PyDev of the Week! Arun has a fun Python blog that is worth checking out. He is also the author of Django Design Patterns and Best Practices. Let’s spend some time getting to know Arun. Can you tell us a little about yourself (hobbies, education, etc): […]

My Context Managers Article Got Turned Into a Screencast

Last month I wrote about context managers and a company called Webucator asked me for my permission to turn the article into a screencast. It ended up looking pretty good. Check it out below: Webucator has other Python related training too. I don’t know much about them, but if this video is any indication, I […]

Weight of your PostgreSQL tables "lumped together"

We have lots of tables that weigh a lot. Some of the tables are partitions so they're called "mytable20150901" and "mytable20151001" etc.

To find out how much each table weighs you can use this query:

select table_name, pg_relation_size(table_name), pg_size_pretty(pg_relation_size(table_name))
from information_schema.tables
where table_schema = 'public'
order by 2 desc limit 10;

It'll give you an output like this:

        table_name        | pg_relation_size |

... read more →

Chainable catches in a JavaScript promise

If you have a Promise that you're executing, you can chain multiple things quite nicely by simply returning the value as it "passes through". For example:

new Promise((resolve) => {
  resolve('some value')
.then((value) => {
  console.log('1', value)
  return value
.then((value) => {
  console.log('2', value)
  return value

This will console log

1 some value
2 some value

And you can add more .then() to it. As many as you ... read more →


Whatsdeployed was a tool I developed for my work at Mozilla. I think many other organizations can benefit from using it too.

So, on many sites, what we do when deploying a site, is that we note which git sha was used and write that to a file which is then exposed via the web server. Like this for example. If you know that sha and what's at the tip of the master branch on the project's GitHub page, you can build up an interesting dashboard that allows you to see what's available and what's been ... read more →

Screenshot-sharing performance comparison

One tool that I use many times per day, at work, is to take a screenshot on my mac and then that gets uploaded to the clouds and a permalink to that picture gets put in my clipboard so I can quickly and easily share it.

First I was using CloudApp, which was awesome. I can't remember how much I paid but they started being very unreliable. Sometimes the upload just failed. Sometimes viewing the image failed. It was mostly working but unreliable enough that I just couldn't cope.

So I switched to ... read more →

Python's Hidden Regular Expression Gems

There are many terrible modules in the Python standard library, but the Python re module is not one of them. While it's old and has not been updated in many years, it's one of the best of all dynamic languages I would argue.

What I always found interesting about that module is that Python is one of the few dynamic languages which does not have language integrated regular expression support. However while it lacks syntax and interpreter support for it, it makes up for it with one of the better ... read more →

Talk Python to Me: #35 Turbogears and the future of Python web frameworks

Do you have a new web project coming up? Are you thinking of choosing Django or maybe Flask? Those are excellent frameworks, but you might also want to check out TurboGears. It was created and released around the same time as Django. It lets you starts your project as a microframework (like Flask) and yet can scale up to a fullstack solution (like Django). It also has built-in support both relational DBs (via SQLAlchemy) and MongoDB. This week Alessandro Molina is here to tell us all about ... read more →

S. Lott: Navigation: Latitude, Longitude, Haversine, and all that

For a few years, I was a tech nomad. See Team Red Cruising for some stories of life on a sailboat. Warning: it's pretty dull.As a tech nomad, I lived and died (literally) by my ability to navigate. Modern GPS devices make the dying part relatively unlikely. So, let's not oversell the danger aspect of this.The prudent mariner plans a long voyage with a great deal of respect for the many things which can go wrong. One aspect of this is to create a "Float Plan". Read more about it here: ... read more →

John Cook: Estimating the exponent of discrete power law data

Suppose you have data from a discrete power law with exponent α. That is, the probability of an outcome n is proportional to n-α. How can you recover α?

A naive approach would be to gloss over the fact that you have discrete data and use the MLE (maximum likelihood estimator) for continuous data. That does a very poor job [1]. The discrete case needs its own estimator.

To illustrate this, we start by generating 5,000 samples from a discrete power law with exponent 3.


... read more →

Robin Wilson: Calculating percentiles in Python – use numpy not scipy!

This is just a brief public service announcement reporting something that I’ve just found: np.percentile is **a **lot faster than scipy.stats.scoreatpercentile – almost an order of magnitude faster in some cases.

Someone recently asked me why on earth I was using scoreatpercentile anyway – and it turns out that np.percentile was only added in numpy 1.7, which was released part-way through my PhD in Feb 2013, hence why the scipy function is used in some of my code.

In my code I frequently ... read more →

Paul Everitt: My O’Reilly video series on Pyramid is up

Earlier this year, just before PyCon, I talked to O’Reilly about doing a Pyramid video course in their commercial training catalog. It’s now in “early access”, titled “Web Applications with Python and the Pyramid Framework“.

What an effort it turned out to be. I’m certainly grateful that it has wrapped up, but I’m also glad I did it. I put a serious amount of work (months) into writing, re-writing, and re-re-rewriting the narrative and the examples. Thanks go out to Chris and Tres for steering ... read more →

Ned Batchelder: 4.0.3

I fixed five bugs in 4.0.2 to produce 4.0.3. XML reports now have correct elements in complex cases, and a mysterious problem that seriously borked really unusual cases has been fixed.

Django Weblog: Security releases issued: 1.9rc2, 1.8.7, 1.7.11

In accordance with our security release policy, the Django team is issuing multiple releases -- Django 1.7.11, 1.8.7, and 1.9 release candidate 2. These releases are now available on PyPI and our download page. These releases address a security issues detailed below. We encourage all users of Django to upgrade as soon as possible. The Django master branch has also been updated.

CVE-2015-8213: Fixed settings leak possibility in date template filter

If an application allows users to specify an ... read more →

Giampaolo Rodola: OpenBSD support for psutil

OK, this is a big one: starting from version 3.3.0 (released just now) psutil will officially support OpenBSD platforms. This was contributed by Landry Breuil (thanks dude!) and myself in PR #615. The interesting parts of the code changes are this and this.Differences with FreeBSDAs expected, OpenBSD implementation is very similar to FreeBSD's** **(which was already in place), that is why I decided to merge most of it in a single C file (psutilbsd.c) and use 2 separate C files for when the two ... read more →

The hottest python repositories created in the last week

★539 Newmu / dcgan_code
Deep Convolutional Generative Adversarial Networks
★90 woodrush / neural-art-tf
"A neural algorithm of Artistic style" in tensorflow
★56 sherjilozair / char-rnn-tensorflow
Multi-layer Recurrent Neural Networks (LSTM, RNN) for character-level language models in Python using Tensorflow
★41 Changaco /
Automatic version numbers for git-based python projects
★39 karpathy / arxiv-sanity-preserver
Quick web interface for browsing recent arxiv submissions
★25 edent / BMW-i-Remote
A reverse engineered interface for the BMW i3 Electric Car
★20 Max00355 / SpaceInvaders
This is a Space Invaders clone created for a speed-coding video. This tool 1.5 hours to complete.
★18 fy0 / simple_avatar
Use first character to generate avatar.
★18 jasonbaldridge / try-tf
Simple code for trying out TensorFlow with simulated datasets
★17 kirkthaker / investopedia-trading-api
An api, written in Python, for Investopedia's paper trading stock simulator.
★16 MaxHalford / Flask-Boilerplate
:rocket: Multi featured Flask starter project
★11 justinguy / 21-retweet
Monetizing retweets using a 21 Bitcoin Computer
★11 bearsez / listentothis_onspotify
Generates a Spotify playlist from /r/listentothis's top monthly
★10 fuzz-productions / bib
Bib, cleaning up your API spills since 2015 (django module for logging requests)
★9 napsternxg / deepwalk_keras_igraph
Reimplementation of deepwalk algorithm from
★9 malefico3d / blender2d
Tools to create 2D animation within Blender 3D :)
★8 dlo / twitter_cleanse
Unfollow people who've stopped tweeting (or never did).
★8 yunojuno / django-package-monitor
A Django app for keeping track of dependency updates
★7 oemof / oemof_base
Open Energy Modelling Framework - Base packages for energy system modeling and optimization
★7 m57 / vconfigurator
Automatic VLAN configuration tool for Linux
★6 Medicean / w0rmHole
Android wormhole tool
★6 garnaat / placebo
Make boto3 calls that look real but have no effect.
★6 ZhuoRoger / redismon
Redis monitor plugin for Open-Falcon
★6 danigargu / IDAtropy
IDAtropy is a plugin for Hex-Ray's IDA Pro designed to generate charts of entropy and histograms using the power of idapython and matplotlib.