about summary refs log tree commit diff
path: root/pkgs/top-level
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/top-level')
-rw-r--r--pkgs/top-level/aliases.nix7
-rw-r--r--pkgs/top-level/all-packages.nix153
-rw-r--r--pkgs/top-level/ocaml-packages.nix4
-rw-r--r--pkgs/top-level/perl-packages.nix144
-rw-r--r--pkgs/top-level/php-packages.nix4
-rw-r--r--pkgs/top-level/python-packages.nix6309
-rw-r--r--pkgs/top-level/splice.nix4
7 files changed, 569 insertions, 6056 deletions
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index 8fcf0baba02d..a0f611dd9611 100644
--- a/pkgs/top-level/aliases.nix
+++ b/pkgs/top-level/aliases.nix
@@ -54,6 +54,7 @@ mapAliases ({
   buildbot-pkg = pythonPackages.buildbot-pkg; # added 2018-10-11
   buildbot-ui = pythonPackages.buildbot-ui; # added 2018-10-11
   buildbot-worker = pythonPackages.buildbot-worker; # added 2018-10-11
+  buildPerlPackage = perlPackages.buildPerlPackage; # added 2018-10-12
   bundler_HEAD = bundler; # added 2015-11-15
   cantarell_fonts = cantarell-fonts; # added 2018-03-03
   checkbashism = checkbashisms; # added 2016-08-16
@@ -209,6 +210,8 @@ mapAliases ({
   p11_kit = p11-kit; # added 2018-02-25
   parquet-cpp = arrow-cpp; # added 2018-09-08
   pass-otp = pass.withExtensions (ext: [ext.pass-otp]); # added 2018-05-04
+  perlXMLParser = perlPackages.XMLParser; # added 2018-10-12
+  perlArchiveCpio = perlPackages.ArchiveCpio; # added 2018-10-12
   pgp-tools = signing-party; # added 2017-03-26
   pidgin-with-plugins = pidgin; # added 2016-06
   pidginlatex = pidgin-latex; # added 2018-01-08
@@ -316,8 +319,12 @@ mapAliases ({
   xmonad_log_applet_gnome3 = xmonad_log_applet; # added 2018-05-01
   xf86_video_nouveau = xorg.xf86videonouveau; # added 2015-09
   xlibs = xorg; # added 2015-09
+  xpraGtk3 = xpra; # added 2018-09-13
   youtubeDL = youtube-dl;  # added 2014-10-26
 
+  # TODO(ekleog): add ‘wasm’ alias to ‘ocamlPackages.wasm’ after 19.03
+  # branch-off
+
   # added 2017-05-27
   wineMinimal = winePackages.minimal;
   wineFull = winePackages.full;
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6e2024f0f56e..e50ad0a0b45e 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1684,6 +1684,8 @@ with pkgs;
     pythonPackages = python3Packages;
   };
 
+  bento4 = callPackage ../tools/video/bento4 { };
+
   bepasty = callPackage ../tools/misc/bepasty { };
 
   bettercap = callPackage ../tools/security/bettercap { };
@@ -2075,7 +2077,7 @@ with pkgs;
     zlibSupport = true;
     sslSupport = zlibSupport;
     scpSupport = zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin;
-    gssSupport = true;
+    gssSupport = !stdenv.hostPlatform.isWindows;
   };
 
   curl = callPackage ../tools/networking/curl rec {
@@ -2084,7 +2086,7 @@ with pkgs;
     zlibSupport = true;
     sslSupport = zlibSupport;
     scpSupport = zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin;
-    gssSupport = true;
+    gssSupport = !stdenv.hostPlatform.isWindows;
   };
 
   curl_unix_socket = callPackage ../tools/networking/curl-unix-socket rec { };
@@ -2366,6 +2368,8 @@ with pkgs;
 
   carp = callPackage ../development/compilers/carp { };
 
+  cholmod-extra = callPackage ../development/libraries/science/math/cholmod-extra { };
+
   emscriptenVersion = "1.37.36";
 
   emscripten = callPackage ../development/compilers/emscripten { };
@@ -3429,7 +3433,7 @@ with pkgs;
   jaaa = callPackage ../applications/audio/jaaa { };
 
   jackett = callPackage ../servers/jackett {
-    mono = mono5;
+    mono = mono514;
   };
 
   jade = callPackage ../tools/text/sgml/jade { };
@@ -4522,6 +4526,8 @@ with pkgs;
 
   opae = callPackage ../development/libraries/opae { };
 
+  opentracing-cpp = callPackages ../development/libraries/opentracing-cpp { };
+
   openvswitch = callPackage ../os-specific/linux/openvswitch { };
 
   optipng = callPackage ../tools/graphics/optipng {
@@ -5036,9 +5042,7 @@ with pkgs;
     gsettings-desktop-schemas = gnome3.gsettings-desktop-schemas;
   };
 
-  rename = callPackage ../tools/misc/rename {
-    inherit (perlPackages) buildPerlPackage;
-  };
+  rename = callPackage ../tools/misc/rename { };
 
   renameutils = callPackage ../tools/misc/renameutils { };
 
@@ -5739,6 +5743,8 @@ with pkgs;
 
   tty-clock = callPackage ../tools/misc/tty-clock { };
 
+  ttyplot = callPackage ../tools/misc/ttyplot { };
+
   ttyrec = callPackage ../tools/misc/ttyrec { };
 
   ttylog = callPackage ../tools/misc/ttylog { };
@@ -5860,6 +5866,9 @@ with pkgs;
 
   vimer = callPackage ../tools/misc/vimer { };
 
+  visidata = (newScope python3Packages) ../applications/misc/visidata {
+  };
+
   vit = callPackage ../applications/misc/vit { };
 
   vnc2flv = callPackage ../tools/video/vnc2flv {};
@@ -5923,6 +5932,12 @@ with pkgs;
 
   wbox = callPackage ../tools/networking/wbox {};
 
+  webassemblyjs-cli = nodePackages."@webassemblyjs/cli";
+  webassemblyjs-repl = nodePackages."@webassemblyjs/repl";
+  wasm-strip = nodePackages."@webassemblyjs/wasm-strip";
+  wasm-text-gen = nodePackages."@webassemblyjs/wasm-text-gen";
+  wast-refmt = nodePackages."@webassemblyjs/wast-refmt";
+
   welkin = callPackage ../tools/graphics/welkin {};
 
   whipper = callPackage ../applications/audio/whipper { };
@@ -6829,7 +6844,7 @@ with pkgs;
 
   cabal-install = haskell.lib.justStaticExecutables haskellPackages.cabal-install;
 
-  stack = haskell.lib.justStaticExecutables haskellPackages.stack;
+  stack = haskell.lib.justStaticExecutables haskell.packages.ghc861.stack;
   hlint = haskell.lib.justStaticExecutables haskellPackages.hlint;
 
   all-cabal-hashes = callPackage ../data/misc/hackage { };
@@ -6964,14 +6979,12 @@ with pkgs;
         (lib.addMetaAttrs { outputsToInstall = [ "jre" ]; }
           ((openjdk8.override { minimal = true; }).jre // { outputs = [ "jre" ]; }));
 
-  jdk10 = if stdenv.isAarch32 || stdenv.isAarch64 then oraclejdk10 else openjdk10 // { outputs = [ "out" ]; };
-  jre10 = if stdenv.isAarch32 || stdenv.isAarch64 then oraclejre10 else lib.setName "openjre-${lib.getVersion pkgs.openjdk10.jre}"
+  jdk10 = openjdk10 // { outputs = [ "out" ]; };
+  jre10 = lib.setName "openjre-${lib.getVersion pkgs.openjdk10.jre}"
     (lib.addMetaAttrs { outputsToInstall = [ "jre" ]; }
       (openjdk10.jre // { outputs = [ "jre" ]; }));
   jre10_headless =
-    if stdenv.isAarch32 || stdenv.isAarch64 then
-      oraclejre10
-    else if stdenv.isDarwin then
+    if stdenv.isDarwin then
       jre10
     else
       lib.setName "openjre-${lib.getVersion pkgs.openjdk10.jre}-headless"
@@ -6986,6 +6999,8 @@ with pkgs;
 
   openshot-qt = libsForQt5.callPackage ../applications/video/openshot-qt { };
 
+  openspin = callPackage ../development/compilers/openspin { };
+
   oraclejdk = pkgs.jdkdistro true false;
 
   oraclejdk8 = pkgs.oraclejdk8distro true false;
@@ -7253,6 +7268,8 @@ with pkgs;
 
   ocamlPackages = recurseIntoAttrs ocaml-ng.ocamlPackages;
 
+  ocamlformat = callPackage ../development/tools/ocaml/ocamlformat { };
+
   orc = callPackage ../development/compilers/orc { };
 
   metaocaml_3_09 = callPackage ../development/compilers/ocaml/metaocaml-3.09.nix { };
@@ -8272,7 +8289,7 @@ with pkgs;
   cpplint = callPackage ../development/tools/analysis/cpplint { };
 
   cquery = callPackage ../development/tools/misc/cquery {
-    llvmPackages = llvmPackages_6;
+    llvmPackages = llvmPackages_7;
   };
 
   creduce = callPackage ../development/tools/misc/creduce {
@@ -8563,6 +8580,8 @@ with pkgs;
 
   kubectx = callPackage ../development/tools/kubectx { };
 
+  kube-prompt = callPackage ../development/tools/kube-prompt { };
+
   kustomize = callPackage ../development/tools/kustomize { };
 
   kythe = callPackage ../development/tools/kythe { };
@@ -8843,7 +8862,7 @@ with pkgs;
 
   sparse = callPackage ../development/tools/analysis/sparse { };
 
-  speedtest-cli = callPackage ../tools/networking/speedtest-cli { };
+  speedtest-cli = with python3Packages; toPythonApplication speedtest-cli;
 
   spin = callPackage ../development/tools/analysis/spin { };
 
@@ -10240,6 +10259,8 @@ with pkgs;
     inherit (darwin.apple_sdk.frameworks) CoreAudio CoreServices AudioUnit;
   };
 
+  libaosd = callPackage ../development/libraries/libaosd { };
+
   libabw = callPackage ../development/libraries/libabw { };
 
   libamqpcpp = callPackage ../development/libraries/libamqpcpp { };
@@ -12300,6 +12321,29 @@ with pkgs;
 
   sqlite-jdbc = callPackage ../servers/sql/sqlite/jdbc { };
 
+  sqlite-replication = sqlite.overrideAttrs (oldAttrs: rec {
+    name = "sqlite-${version}";
+    version = "3.24.0+replication3";
+    src = pkgs.fetchFromGitHub {
+      owner = "CanonicalLtd";
+      repo = "sqlite";
+      rev = "version-${version}";
+      sha256 = "19557b7aick1pxk0gw013cf5jy42i7539qn1ziza8dzy16a6zs8b";
+    };
+    nativeBuildInputs = [ pkgs.tcl ];
+    configureFlags = oldAttrs.configureFlags ++ [
+      "--enable-replication"
+      "--disable-amalgamation"
+      "--disable-tcl"
+    ];
+    preConfigure = ''
+      echo "D 2018-08-01T13:22:18" > manifest
+      echo -n "c94dbda1a570c1ab180e7694afd3cc7116268c06" > manifest.uuid
+    '';
+  });
+
+  dqlite = callPackage ../development/libraries/dqlite { };
+
   sqlcipher = lowPrio (callPackage ../development/libraries/sqlcipher {
     readline = null;
     ncurses = null;
@@ -12899,6 +12943,8 @@ with pkgs;
 
   leaps = callPackage ../development/tools/leaps { };
 
+  vgo2nix = callPackage ../development/tools/vgo2nix { };
+
   ws = callPackage ../development/tools/ws { };
 
   ### DEVELOPMENT / JAVA MODULES
@@ -12958,14 +13004,10 @@ with pkgs;
   });
 
   perlPackages = perl528Packages;
-  inherit (perlPackages) perl buildPerlPackage;
-
-  perlXMLParser = perlPackages.XMLParser;
+  inherit (perlPackages) perl;
 
   ack = perlPackages.ack;
 
-  perlArchiveCpio = perlPackages.ArchiveCpio;
-
   perlcritic = perlPackages.PerlCritic;
 
   sqitchPg = callPackage ../development/tools/misc/sqitch {
@@ -13646,7 +13688,6 @@ with pkgs;
   });
 
   samba4Full = lowPrio (samba4.override {
-    enableInfiniband = true;
     enableLDAP = true;
     enablePrinting = true;
     enableMDNS = true;
@@ -13773,21 +13814,19 @@ with pkgs;
     inherit (darwin.apple_sdk.libs) Xplugin;
   };
 
-  xorg = recurseIntoAttrs (lib.callPackagesWith pkgs ../servers/x11/xorg {
-    inherit clangStdenv fetchurl fetchgit fetchpatch stdenv intltool freetype fontconfig
-      libxslt expat libpng zlib perl mesa_drivers spice-protocol libunwind
-      dbus libuuid openssl gperf m4 libevdev tradcpp libinput mcpp makeWrapper autoreconfHook
-      autoconf automake libtool mtdev pixman libGL libGLU
-      cairo epoxy;
-    inherit (buildPackages) pkgconfig xmlto asciidoc flex bison;
-    inherit (darwin) apple_sdk cf-private libobjc;
+  # Use `lib.callPackageWith __splicedPackages` rather than plain `callPackage`
+  # so as not to have the newly bound xorg items already in scope,  which would
+  # have created a cycle.
+  xorg = recurseIntoAttrs ((lib.callPackageWith __splicedPackages ../servers/x11/xorg {
+  }).overrideScope' (lib.callPackageWith __splicedPackages ../servers/x11/xorg/overrides.nix {
+    inherit (darwin) apple_sdk;
     bootstrap_cmds = if stdenv.isDarwin then darwin.bootstrap_cmds else null;
     python = python2; # Incompatible with Python 3x
     udev = if stdenv.isLinux then udev else null;
     libdrm = if stdenv.isLinux then libdrm else null;
     abiCompat = config.xorg.abiCompat # `config` because we have no `xorg.override`
       or (if stdenv.isDarwin then "1.18" else null); # 1.19 needs fixing on Darwin
-  } // { inherit xlibsWrapper; } );
+  }) // { inherit xlibsWrapper; } );
 
   xwayland = callPackage ../servers/x11/xorg/xwayland.nix { };
 
@@ -14214,6 +14253,16 @@ with pkgs;
       ];
   };
 
+  linux_4_19 = callPackage ../os-specific/linux/kernel/linux-4.19.nix {
+    kernelPatches =
+      [ kernelPatches.bridge_stp_helper
+        # See pkgs/os-specific/linux/kernel/cpu-cgroup-v2-patches/README.md
+        # when adding a new linux version
+        # kernelPatches.cpu-cgroup-v2."4.11"
+        kernelPatches.modinst_arg_list_too_long
+      ];
+  };
+
   linux_testing = callPackage ../os-specific/linux/kernel/linux-testing.nix {
     kernelPatches = [
       kernelPatches.bridge_stp_helper
@@ -14406,7 +14455,7 @@ with pkgs;
   linux = linuxPackages.kernel;
 
   # Update this when adding the newest kernel major version!
-  linuxPackages_latest = linuxPackages_4_18;
+  linuxPackages_latest = linuxPackages_4_19;
   linux_latest = linuxPackages_latest.kernel;
 
   # Build the kernel modules for the some of the kernels.
@@ -14417,6 +14466,7 @@ with pkgs;
   linuxPackages_4_9 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_9);
   linuxPackages_4_14 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_14);
   linuxPackages_4_18 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_18);
+  linuxPackages_4_19 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_19);
   # Don't forget to update linuxPackages_latest!
 
   # Intentionally lacks recurseIntoAttrs, as -rc kernels will quite likely break out-of-tree modules and cause failed Hydra builds.
@@ -15495,6 +15545,8 @@ with pkgs;
 
   vistafonts-chs = callPackage ../data/fonts/vista-fonts-chs { };
 
+  weather-icons = callPackage ../data/fonts/weather-icons { };
+
   wireless-regdb = callPackage ../data/misc/wireless-regdb { };
 
   wqy_microhei = callPackage ../data/fonts/wqy-microhei { };
@@ -15816,13 +15868,13 @@ with pkgs;
 
   brackets = callPackage ../applications/editors/brackets { gconf = gnome2.GConf; };
 
+  brave = callPackage ../applications/networking/browsers/brave { };
+
   notmuch-bower = callPackage ../applications/networking/mailreaders/notmuch-bower { };
 
   bristol = callPackage ../applications/audio/bristol { };
 
-  bs1770gain = callPackage ../applications/audio/bs1770gain {
-    ffmpeg = ffmpeg_2;
-  };
+  bs1770gain = callPackage ../applications/audio/bs1770gain { };
 
   bspwm = callPackage ../applications/window-managers/bspwm { };
 
@@ -16037,6 +16089,7 @@ with pkgs;
     pythonPackages = datadog-integrations-core {};
   };
   datadog-process-agent = callPackage ../tools/networking/dd-agent/datadog-process-agent.nix { };
+  datadog-trace-agent = callPackage ../tools/networking/dd-agent/datadog-trace-agent.nix { };
   datadog-integrations-core = extras: callPackage ../tools/networking/dd-agent/integrations-core.nix {
     python = python27;
     extraIntegrations = extras;
@@ -17005,7 +17058,7 @@ with pkgs;
 
   googleearth = callPackage ../applications/misc/googleearth { };
 
-  google-chrome = callPackage ../applications/networking/browsers/google-chrome { gconf = gnome2.GConf; patchelf = patchelfUnstable; };
+  google-chrome = callPackage ../applications/networking/browsers/google-chrome { gconf = gnome2.GConf; };
 
   google-chrome-beta = google-chrome.override { chromium = chromiumBeta; channel = "beta"; };
 
@@ -17146,9 +17199,11 @@ with pkgs;
 
   wlc = callPackage ../development/libraries/wlc { };
   wlroots = callPackage ../development/libraries/wlroots { };
-  rootston = wlroots.bin;
+
   orbment = callPackage ../applications/window-managers/orbment { };
+
   sway = callPackage ../applications/window-managers/sway { };
+  sway-beta = callPackage ../applications/window-managers/sway/beta.nix { };
 
   velox = callPackage ../applications/window-managers/velox {
     stConf = config.st.conf or null;
@@ -17724,6 +17779,8 @@ with pkgs;
     inherit (darwin.apple_sdk.frameworks) vmnet;
   };
 
+  minishift = callPackage ../applications/networking/cluster/minishift { };
+
   minitube = libsForQt5.callPackage ../applications/video/minitube { };
 
   mimic = callPackage ../applications/audio/mimic {
@@ -18592,6 +18649,8 @@ with pkgs;
 
   rclone = callPackage ../applications/networking/sync/rclone { };
 
+  rclone-browser = libsForQt5.callPackage ../applications/networking/sync/rclone/browser.nix { };
+
   rcs = callPackage ../applications/version-management/rcs { };
 
   rdesktop = callPackage ../applications/networking/remote/rdesktop { };
@@ -19491,6 +19550,7 @@ with pkgs;
   winswitch = callPackage ../tools/X11/winswitch { };
 
   wings = callPackage ../applications/graphics/wings {
+    esdl = esdl.override { erlang = erlangR18; };
     erlang = erlangR18;
   };
 
@@ -19787,8 +19847,6 @@ with pkgs;
 
   xpra = callPackage ../tools/X11/xpra { };
   libfakeXinerama = callPackage ../tools/X11/xpra/libfakeXinerama.nix { };
-  #TODO: 'pil' is not available for python3, yet
-  xpraGtk3 = callPackage ../tools/X11/xpra/gtk3.nix { inherit (texFunctions) fontsConf; inherit (python3Packages) buildPythonApplication python cython pygobject3 pycairo; };
 
   xrectsel = callPackage ../tools/X11/xrectsel { };
 
@@ -20345,11 +20403,9 @@ with pkgs;
 
   pong3d = callPackage ../games/pong3d { };
 
-  pokerth = callPackage ../games/pokerth {
-    protobuf = protobuf3_4;
-  };
+  pokerth = libsForQt5.callPackage ../games/pokerth { };
 
-  pokerth-server = pokerth.server;
+  pokerth-server = libsForQt5.callPackage ../games/pokerth { target = "server"; };
 
   prboom = callPackage ../games/prboom { };
 
@@ -20439,6 +20495,12 @@ with pkgs;
 
   scummvm = callPackage ../games/scummvm { };
 
+  inherit (callPackage ../games/scummvm/games.nix { })
+    beneath-a-steel-sky
+    drascula-the-vampire-strikes-back
+    flight-of-the-amazon-queen
+    lure-of-the-temptress;
+
   scorched3d = callPackage ../games/scorched3d { };
 
   scrolls = callPackage ../games/scrolls { };
@@ -21067,6 +21129,8 @@ with pkgs;
   liblapackWithAtlas = liblapack;
 
   liblbfgs = callPackage ../development/libraries/science/math/liblbfgs { };
+  
+  lrs = callPackage ../development/libraries/science/math/lrs { };
 
   m4ri = callPackage ../development/libraries/science/math/m4ri { };
 
@@ -21135,8 +21199,9 @@ with pkgs;
   sageWithDoc = sage.override { withDoc = true; };
 
   suitesparse_4_2 = callPackage ../development/libraries/science/math/suitesparse/4.2.nix { };
-  suitesparse_4_4 = callPackage ../development/libraries/science/math/suitesparse {};
-  suitesparse = suitesparse_4_4;
+  suitesparse_4_4 = callPackage ../development/libraries/science/math/suitesparse/4.4.nix {};
+  suitesparse_5_3 = callPackage ../development/libraries/science/math/suitesparse {};
+  suitesparse = suitesparse_5_3;
 
   superlu = callPackage ../development/libraries/science/math/superlu {};
 
@@ -22353,7 +22418,7 @@ with pkgs;
   unity3d = callPackage ../development/tools/unity3d {
     stdenv = stdenv_32bit;
     gcc_32bit = pkgsi686Linux.gcc;
-    inherit (gnome2) GConf libgnomeui gnome_vfs;
+    inherit (gnome2) GConf;
   };
 
   urbit = callPackage ../misc/urbit { };
diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix
index c9df0f908ee2..9f9bba933a17 100644
--- a/pkgs/top-level/ocaml-packages.nix
+++ b/pkgs/top-level/ocaml-packages.nix
@@ -753,6 +753,10 @@ let
 
     zed = callPackage ../development/ocaml-modules/zed { };
 
+    zmq = callPackage ../development/ocaml-modules/zmq { };
+
+    zmq-lwt = callPackage ../development/ocaml-modules/zmq/lwt.nix { };
+
     ocsigen_deriving = callPackage ../development/ocaml-modules/ocsigen-deriving {
       oasis = ocaml_oasis;
     };
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 4fe08fb6ecb8..c68e15aeb961 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -7,6 +7,8 @@
 
 {config, pkgs, fetchurl, fetchFromGitHub, stdenv, gnused, perl, overrides}:
 
+# cpan2nix assumes that perl-packages.nix will be used only with perl 5.26 or above
+assert stdenv.lib.versionAtLeast perl.version "5.26";
 let
   inherit (stdenv.lib) maintainers;
   self = _self // overrides;
@@ -93,6 +95,34 @@ let
     };
   };
 
+  AlienBuild = buildPerlPackage {
+    name = "Alien-Build-1.48";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/P/PL/PLICEASE/Alien-Build-1.48.tar.gz;
+      sha256 = "1sv4544g2qhwigpj1x2qycafab04p2b0vdr2x07wzriq5fqgsspp";
+    };
+    propagatedBuildInputs = [ CaptureTiny FFICheckLib FileWhich Filechdir PathTiny Test2Suite ];
+    buildInputs = [ DevelHide PkgConfig ];
+    meta = {
+      description = "Build external dependencies for use in CPAN";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
+    };
+  };
+
+  AlienGMP = buildPerlPackage {
+    name = "Alien-GMP-1.14";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/P/PL/PLICEASE/Alien-GMP-1.14.tar.gz;
+      sha256 = "116vvh1b0d1ykkklqgfxfn89g3bw90a4cj3qrvsnkw1kk5cmn60a";
+    };
+    propagatedBuildInputs = [ AlienBuild ];
+    buildInputs = [ pkgs.gmp DevelChecklib ];
+    meta = {
+      description = "Alien package for the GNU Multiple Precision library.";
+      license = with stdenv.lib.licenses; [ lgpl3Plus ];
+    };
+  };
+
   aliased = buildPerlModule rec {
     name = "aliased-0.34";
     src = fetchurl {
@@ -525,8 +555,6 @@ let
     };
   };
 
-  ArchiveZip_1_53 = ArchiveZip;
-
   AudioScan = buildPerlPackage rec {
     name = "Audio-Scan-1.01";
     src = fetchurl {
@@ -1857,7 +1885,7 @@ let
       url = "mirror://cpan/authors/id/J/JS/JSWARTZ/${name}.tar.gz";
       sha256 = "c7f1a2b3570a8fede484e933f89ba1729e0abd05935791d146c522dd120ee851";
     };
-    preConfigure = stdenv.lib.optionalString (stdenv.lib.versionAtLeast perl.version "5.26") ''
+    preConfigure = ''
       # fix error 'Unescaped left brace in regex is illegal here in regex'
       substituteInPlace lib/CHI/t/Driver/Subcache/l1_cache.pm --replace 'qr/CHI stats: {' 'qr/CHI stats: \{'
     '';
@@ -2095,7 +2123,7 @@ let
       url = "mirror://cpan/authors/id/E/EV/EVO/${name}.tar.gz";
       sha256 = "0ricb0mn0i06ngfhq5y035yx8i7ahlx83yyqwixqmv6hg4p79b5c";
     };
-    preConfigure = stdenv.lib.optionalString (stdenv.lib.versionAtLeast perl.version "5.26") ''
+    preConfigure = ''
       # fix error 'Unescaped left brace in regex is illegal here in regex'
       substituteInPlace tests/xemulator/class_methodmaker/Test.pm --replace 's/(TEST\s{)/$1/g' 's/(TEST\s\{)/$1/g'
     '';
@@ -2855,6 +2883,18 @@ let
     };
   };
 
+  CryptCurve25519 = buildPerlPackage {
+    name = "Crypt-Curve25519-0.06";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/A/AJ/AJGB/Crypt-Curve25519-0.06.tar.gz;
+      sha256 = "1ir0gfxm8i7r9zyfs2zvil5jgwirl7j6cb9cm1p2kjpfnhyp0j4z";
+    };
+    meta = {
+      description = "Generate shared secret using elliptic-curve Diffie-Hellman function";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
+    };
+  };
+
   CryptDES = buildPerlPackage rec {
     name = "Crypt-DES-2.07";
     src = fetchurl {
@@ -2892,6 +2932,14 @@ let
     propagatedBuildInputs = [ ClassMix ];
   };
 
+  CryptIDEA = buildPerlPackage {
+    name = "Crypt-IDEA-1.10";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/D/DP/DPARIS/Crypt-IDEA-1.10.tar.gz;
+      sha256 = "0690lzlyjqgmnb94dq7dm5n6pgybg10fkpgfycgzr814370pig9k";
+    };
+  };
+
   CryptJWT = buildPerlPackage rec {
     name = "Crypt-JWT-0.023";
     src = fetchurl {
@@ -4423,7 +4471,6 @@ let
     };
   };
 
-  DigestHMAC_SHA1 = DigestHMAC;
   DigestJHash = buildPerlPackage rec {
     name = "Digest-JHash-0.10";
     src = fetchurl {
@@ -5587,6 +5634,19 @@ let
     };
   };
 
+  FFICheckLib = buildPerlPackage {
+    name = "FFI-CheckLib-0.20";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/P/PL/PLICEASE/FFI-CheckLib-0.20.tar.gz;
+      sha256 = "1pggqj5cs77myp4g62jzkld95a286vwkygi7i0hbqjgwf3w3f5gl";
+    };
+    buildInputs = [ Test2Suite ];
+    meta = {
+      description = "Check that a library is available for FFI";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
+    };
+  };
+
   FennecLite = buildPerlModule {
     name = "Fennec-Lite-0.004";
     src = fetchurl {
@@ -8009,7 +8069,7 @@ let
       sha256 = "0nlgdzy40q26z8qhwngsd461glyai8dpwaccyhiljmrkaqwdjxz2";
     };
     # Do not abort cross-compilation on failure to load native JSON module into host perl
-    preConfigure = ''
+    preConfigure = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
       substituteInPlace Makefile.PL --replace "exit 0;" ""
     '';
     buildInputs = [ TestPod ];
@@ -8852,6 +8912,10 @@ let
       sha256 = "dda2578d7b32152c4afce834761a61d117de286c705a9f7972c7ac6032ca5953";
     };
     propagatedBuildInputs = [ FileListing HTMLParser HTTPCookies HTTPDaemon HTTPNegotiate NetHTTP TryTiny WWWRobotRules ];
+    # support cross-compilation by avoiding using `has_module` which does not work in miniperl (it requires B native module)
+    postPatch = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
+      substituteInPlace Makefile.PL --replace 'if has_module' 'if 0; #'
+    '';
     meta = with stdenv.lib; {
       description = "The World-Wide Web library for Perl";
       license = with licenses; [ artistic1 gpl1Plus ];
@@ -9232,6 +9296,21 @@ let
     };
   };
 
+  MathGMP = buildPerlPackage {
+    name = "Math-GMP-2.19";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/S/SH/SHLOMIF/Math-GMP-2.19.tar.gz;
+      sha256 = "1c07521m4d38hy2yx21hkwz22n2672bvrc4i21ldc68h85qy1q8i";
+    };
+    buildInputs = [ pkgs.gmp AlienGMP ];
+    NIX_CFLAGS_COMPILE = "-I${pkgs.gmp.dev}/include";
+    NIX_CFLAGS_LINK = "-L${pkgs.gmp.out}/lib -lgmp";
+    meta = {
+      description = "High speed arbitrary size integer math";
+      license = with stdenv.lib.licenses; [ lgpl21Plus ];
+    };
+  };
+
   MathGeometryVoronoi = buildPerlPackage rec {
     name = "Math-Geometry-Voronoi-1.3";
     src = fetchurl {
@@ -11105,7 +11184,7 @@ let
       url = "mirror://cpan/authors/id/D/DA/DANBERR/${name}.tar.gz";
       sha256 = "8391696db9e96c374b72984c0bad9c7d1c9f3b4efe68f9ddf429a77548e0e269";
     };
-    nativeBuildInputs = [ pkgs.pkgconfig ];
+    nativeBuildInputs = [ pkgs.buildPackages.pkgconfig ];
     buildInputs = [ pkgs.dbus TestPod TestPodCoverage ];
     propagatedBuildInputs = [ XMLTwig ];
     meta = {
@@ -11274,7 +11353,7 @@ let
       url = "mirror://cpan/authors/id/I/IV/IVAN/${name}.tar.gz";
       sha256 = "88a9b2df69e769e5855a408b19f61915b82e8fe070ab5cf4d525dd3b8bbe31c1";
     };
-    propagatedBuildInputs = [ pkgs.openssl Carp Exporter IO NetSSH StringShellQuote ];
+    propagatedBuildInputs = [ pkgs.openssl Carp IO NetSSH StringShellQuote ];
     patchPhase = ''
       sed -i 's|$scp = "scp";|$scp = "${pkgs.openssh}/bin/scp";|' SCP.pm
     '';
@@ -11367,7 +11446,7 @@ let
       url = "mirror://cpan/authors/id/I/IV/IVAN/${name}.tar.gz";
       sha256 = "7c71c7c3cbe953234dfe25bcc1ad7edb0e1f5a0578601f5523bc6070262a3817";
     };
-    propagatedBuildInputs = [ pkgs.openssl Exporter IO ];
+    propagatedBuildInputs = [ pkgs.openssl IO ];
     patchPhase = ''
       sed -i 's|$ssh = "ssh";|$ssh = "${pkgs.openssh}/bin/ssh";|' SSH.pm
     '';
@@ -11377,6 +11456,20 @@ let
     };
   };
 
+  NetSSHPerl = buildPerlPackage rec {
+    name = "Net-SSH-Perl-2.14";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/S/SC/SCHWIGON/Net-SSH-Perl-2.14.tar.gz;
+      sha256 = "2b5d1bb13590b5870116704e7f1dce9a9823c4f80ff5461b97bb26a317393017";
+    };
+    propagatedBuildInputs = [ CryptCurve25519 CryptIDEA CryptX FileHomeDir MathGMP StringCRC32 ];
+    preCheck = "export HOME=$TMPDIR";
+    meta = {
+      description = "Perl client Interface to SSH";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
+    };
+  };
+
   NetSSLeay = buildPerlPackage rec {
     name = "Net-SSLeay-1.85";
     src = fetchurl {
@@ -12018,7 +12111,7 @@ let
       sha256 = "18wxvp7psqrx0zdvg47azrals572hv9fx1s3p0q65s87lnk3q63l";
     };
     outputs = [ "out" ];
-    buildInputs = [ DBDmysql DBI DigestMD5 IOSocketSSL TermReadKey TimeHiRes ];
+    buildInputs = [ DBDmysql DBI IOSocketSSL TermReadKey TimeHiRes ];
     meta = {
       description = ''Collection of advanced command-line tools to perform a variety of MySQL and system tasks.'';
       homepage = http://www.percona.com/software/percona-toolkit;
@@ -13335,7 +13428,6 @@ let
       sha256 = "17syqbq17qw6ajg3w88q9ljdm4c2b7zadq9pwshxxgyijg8dlfh4";
     };
     buildInputs = [ TestDeep TestDifferences TestWarn TestLongString ];
-    propagatedBuildInputs = [ XSLoader ];
     preBuild = ''ls'';
     meta = {
       homepage = https://github.com/Sereal/Sereal;
@@ -13352,7 +13444,7 @@ let
       sha256 = "02hbk5dwq7fpnyb3vp7xxhb41ra48xhghl13p9pjq9lzsqlb6l19";
     };
     buildInputs = [ TestDeep TestDifferences TestWarn TestLongString ];
-    propagatedBuildInputs = [ XSLoader SerealDecoder ];
+    propagatedBuildInputs = [ SerealDecoder ];
     meta = {
       homepage = https://github.com/Sereal/Sereal;
       description = "Fast, compact, powerful binary deserialization";
@@ -14045,7 +14137,7 @@ let
       sha256 = "1y9lfhxgwyysybing72n3hng2db5njpk2dbb80vskdz75r7ffqjp";
     };
 
-    buildInputs = [ ArchiveZip_1_53 pkgs.file ];
+    buildInputs = [ ArchiveZip pkgs.file ];
     meta.broken = true;
   };
 
@@ -14059,7 +14151,7 @@ let
       sha256 = "1y9lfhxgwyysybing72n3hng2db5njpk2dbb80vskdz75r7ffqjp";
     };
 
-    buildInputs = [ ArchiveZip_1_53 libfile-stripnondeterminism pkgs.file ];
+    buildInputs = [ ArchiveZip libfile-stripnondeterminism pkgs.file ];
 
     meta = with stdenv.lib; {
       description = "A Perl module for stripping bits of non-deterministic information";
@@ -14125,7 +14217,6 @@ let
     };
   };
 
-  SubExporterUtil = SubExporter;
   SubIdentify = buildPerlPackage rec {
     name = "Sub-Identify-0.14";
     src = fetchurl {
@@ -14841,7 +14932,7 @@ let
     meta = {
       description = "Aggregate C<*.t> tests to make them run faster";
       license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
-      broken = stdenv.lib.versionAtLeast perl.version "5.26"; # This module only works with Test::More version < 1.3, but you have 1.302133
+      broken = true; # This module only works with Test::More version < 1.3, but you have 1.302133
     };
   };
 
@@ -16967,7 +17058,7 @@ let
      meta = {
        description = "Turns ref() into a multimethod";
        license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
-       broken = stdenv.lib.versionAtLeast perl.version "5.26"; # 'OP {aka struct op}' has no member named 'op_sibling'
+       broken = true; # 'OP {aka struct op}' has no member named 'op_sibling'
      };
   };
 
@@ -17495,6 +17586,19 @@ let
     propagatedBuildInputs = [ XMLRegExp libxml_perl ];
   };
 
+  XMLFeedPP = buildPerlPackage rec {
+    name = "XML-FeedPP-0.95";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/M/MA/MARKOV/${name}.tar.gz";
+      sha256 = "1x5806xwmbqxr1dkdhalb6d7n31s3ya776klkai7c2x6y6drbhwh";
+    };
+    propagatedBuildInputs = [ XMLTreePP ];
+    meta = {
+      description = "Parse/write/merge/edit RSS/RDF/Atom syndication feeds";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
+    };
+  };
+
   XMLFilterBufferText = buildPerlPackage {
     name = "XML-Filter-BufferText-1.01";
     src = fetchurl {
@@ -17594,9 +17698,11 @@ let
       url = mirror://cpan/authors/id/T/TO/TODDR/XML-Parser-2.44.tar.gz;
       sha256 = "05ij0g6bfn27iaggxf8nl5rhlwx6f6p6xmdav6rjcly3x5zd1s8s";
     };
-    patchPhase = if stdenv.isCygwin then ''
+    patchPhase = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
+      substituteInPlace Expat/Makefile.PL --replace 'use English;' '#'
+    '' + stdenv.lib.optionalString stdenv.isCygwin ''
       sed -i"" -e "s@my \$compiler = File::Spec->catfile(\$path, \$cc\[0\]) \. \$Config{_exe};@my \$compiler = File::Spec->catfile(\$path, \$cc\[0\]) \. (\$^O eq 'cygwin' ? \"\" : \$Config{_exe});@" inc/Devel/CheckLib.pm
-    '' else null;
+    '';
     makeMakerFlags = "EXPATLIBPATH=${pkgs.expat.out}/lib EXPATINCPATH=${pkgs.expat.dev}/include";
     propagatedBuildInputs = [ LWP ];
   };
diff --git a/pkgs/top-level/php-packages.nix b/pkgs/top-level/php-packages.nix
index 0f8f8b5dd30c..63c0e36eb370 100644
--- a/pkgs/top-level/php-packages.nix
+++ b/pkgs/top-level/php-packages.nix
@@ -390,11 +390,11 @@ let
 
   php-cs-fixer = pkgs.stdenv.mkDerivation rec {
     name = "php-cs-fixer-${version}";
-    version = "2.12.2";
+    version = "2.13.1";
 
     src = pkgs.fetchurl {
       url = "https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v${version}/php-cs-fixer.phar";
-      sha256 = "19cq04x1wi489259vyad15zy6y0k3qd7dj77pcf74gxqw92hgg5c";
+      sha256 = "0yy9q140jd63h9qz5jvplh7ls3j7y1hf25dkxk0h4mx9cbxdzkq4";
     };
 
     phases = [ "installPhase" ];
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index f2c0c7c1b27a..6c5870b529c1 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -258,6 +258,8 @@ in {
 
   breathe = callPackage ../development/python-modules/breathe { };
 
+  brotli = callPackage ../development/python-modules/brotli { };
+
   browser-cookie3 = callPackage ../development/python-modules/browser-cookie3 { };
 
   browsermob-proxy = disabledIf isPy3k (callPackage ../development/python-modules/browsermob-proxy {});
@@ -340,6 +342,8 @@ in {
 
   genanki = callPackage ../development/python-modules/genanki { };
 
+  gidgethub = callPackage ../development/python-modules/gidgethub { };
+
   globus-sdk = callPackage ../development/python-modules/globus-sdk { };
 
   goocalendar = callPackage ../development/python-modules/goocalendar { };
@@ -575,6 +579,8 @@ in {
 
   python-lz4 = callPackage ../development/python-modules/python-lz4 { };
 
+  python-ldap-test = callPackage ../development/python-modules/python-ldap-test { };
+
   python-igraph = callPackage ../development/python-modules/python-igraph {
     pkgconfig = pkgs.pkgconfig;
     igraph = pkgs.igraph;
@@ -582,6 +588,8 @@ in {
 
   python3-openid = callPackage ../development/python-modules/python3-openid { };
 
+  python-packer = callPackage ../development/python-modules/python-packer { };
+
   python-periphery = callPackage ../development/python-modules/python-periphery { };
 
   python-prctl = callPackage ../development/python-modules/python-prctl { };
@@ -825,6 +833,8 @@ in {
 
   backports_functools_lru_cache = callPackage ../development/python-modules/backports_functools_lru_cache { };
 
+  backports_os = callPackage ../development/python-modules/backports_os { };
+
   backports_shutil_get_terminal_size = callPackage ../development/python-modules/backports_shutil_get_terminal_size { };
 
   backports_ssl_match_hostname = if !(pythonOlder "3.5") then null else
@@ -862,99 +872,19 @@ in {
 
   bibtexparser = callPackage ../development/python-modules/bibtexparser { };
 
-  binwalk_fun = { visualizationSupport ? false, pyqtgraph ? null }:
-    assert visualizationSupport -> pyqtgraph != null;
-
-    buildPythonPackage rec {
-    name = "binwalk-${version}";
-    version = "2.1.1";
-
-    src = pkgs.fetchFromGitHub {
-      owner = "devttys0";
-      repo = "binwalk";
-      rev = "291a03595d17f848c73b74cb6ca508da782cd8f7";
-      sha256 = "0grid93yz6i6jb2zggrqncp5awdf7qi88j5y2k7dq0k9r6b8zydw";
-    };
-
-    propagatedBuildInputs = with stdenv.lib; with pkgs; [ zlib xz ncompress gzip bzip2 gnutar p7zip cabextract lzma self.pycrypto ]
-      ++ optional visualizationSupport pyqtgraph;
-
-    meta = with stdenv.lib; {
-      homepage = "http://binwalk.org";
-      description = "A tool for searching a given binary image for embedded files";
-      platforms = platforms.all;
-      maintainers = [ maintainers.koral ];
-    };
-  };
+  binwalk = callPackage ../development/python-modules/binwalk { };
 
-  binwalk = self.binwalk_fun { };
-  binwalk-full = self.binwalk_fun { visualizationSupport = true; pyqtgraph = self.pyqtgraph; };
+  binwalk-full = appendToName "full" (self.binwalk.override {
+    pyqtgraph = self.pyqtgraph;
+  });
 
   bitmath = callPackage ../development/python-modules/bitmath { };
 
-  caldavclientlibrary-asynk = buildPythonPackage rec {
-    version = "asynkdev";
-    name = "caldavclientlibrary-asynk-${version}";
-
-    src = pkgs.fetchgit {
-      url = "https://github.com/skarra/CalDAVClientLibrary.git";
-      rev = "06699b08190d50cc2636b921a654d67db0a967d1";
-      sha256 = "157q32251ac9x3gdshgrjwsy48nq74vrzviswvph56h9wa8ksnnk";
-    };
-
-    disabled = isPy3k;
-
-    meta = {
-      description = "A Python library and tool for CalDAV";
-
-      longDescription = ''
-        CalDAVCLientLibrary is a Python library and tool for CalDAV.
-
-        This package is the unofficial CalDAVCLientLibrary Python
-        library maintained by the author of Asynk and is needed for
-        that package.
-      '';
-
-      homepage = https://github.com/skarra/CalDAVClientLibrary/tree/asynkdev/;
-      maintainers = with maintainers; [ pjones ];
-      broken = true; # 2018-04-11
-    };
-  };
+  caldavclientlibrary-asynk = callPackage ../development/python-modules/caldavclientlibrary-asynk { };
 
   biopython = callPackage ../development/python-modules/biopython { };
 
-  bedup = buildPythonPackage rec {
-    version = "0.10.1";
-    name = "bedup-${version}";
-
-    src = pkgs.fetchFromGitHub {
-      owner = "g2p";
-      repo = "bedup";
-      rev = "v${version}";
-      sha256 = "0sp8pmjkxcqq0alianfp41mwq7qj10rk1qy31pjjp9kiph1rn0x6";
-    };
-
-    buildInputs = with self; [ pkgs.btrfs-progs ];
-    propagatedBuildInputs = with self; [ contextlib2 pyxdg pycparser alembic ]
-      ++ optionals (!isPyPy) [ cffi ];
-
-    disabled = pythonOlder "3.3";
-
-    meta = {
-      description = "Deduplication for Btrfs";
-      longDescription = ''
-        Deduplication for Btrfs. bedup looks for new and changed files, making sure that multiple
-        copies of identical files share space on disk. It integrates deeply with btrfs so that scans
-        are incremental and low-impact.
-      '';
-      homepage = https://github.com/g2p/bedup;
-      license = licenses.gpl2;
-
-      platforms = platforms.linux;
-
-      maintainers = with maintainers; [ bluescreen303 ];
-    };
-  };
+  bedup = callPackage ../development/python-modules/bedup { };
 
   blessed = callPackage ../development/python-modules/blessed {};
 
@@ -967,6 +897,8 @@ in {
     enablePython = true;
   });
 
+  boltztrap2 = callPackage ../development/python-modules/boltztrap2 { };
+
   bumps = callPackage ../development/python-modules/bumps {};
 
   cached-property = callPackage ../development/python-modules/cached-property { };
@@ -977,33 +909,7 @@ in {
     numpy = self.numpy;
   };
 
-  capstone = buildPythonPackage rec {
-    name = "capstone-3.0.4";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/c/capstone/${name}.tar.gz";
-      sha256 = "945d3b8c3646a1c3914824c416439e2cf2df8969dd722c8979cdcc23b40ad225";
-    };
-    patches = [
-      (pkgs.fetchpatch {
-        stripLen = 2;
-        url = "https://patch-diff.githubusercontent.com/raw/aquynh/capstone/pull/783/commits/23fe9f36622573c747e2bab6119ff245437bf276.patch";
-        sha256 = "0yizqrdlxqxn16873593kdx2vrr7gvvilhgcf9xy6hr0603d3m5r";
-      })
-    ];
-    postPatch = ''
-      patchShebangs src/make.sh
-    '';
-    propagatedBuildInputs = [ ];
-    preCheck = ''
-      mv src/libcapstone.so capstone
-    '';
-    meta = with pkgs.stdenv.lib; {
-      homepage = "http://www.capstone-engine.org/";
-      license = licenses.bsdOriginal;
-      description = "Capstone disassembly engine";
-      maintainers = with maintainers; [ bennofs ];
-    };
-  };
+  capstone = callPackage ../development/python-modules/capstone { };
 
   cement = callPackage ../development/python-modules/cement {};
 
@@ -1031,19 +937,7 @@ in {
 
   constantly = callPackage ../development/python-modules/constantly { };
 
-  cornice = buildPythonPackage rec {
-    name = "cornice-${version}";
-    version = "1.2.1";
-    src = pkgs.fetchgit {
-      url = https://github.com/mozilla-services/cornice.git;
-      rev = "refs/tags/${version}";
-      sha256 = "0688vrkl324jmpi8jkjh1s8nsyjinw149g3x8qlis8vz6j6a01wv";
-    };
-
-    propagatedBuildInputs = with self; [ pyramid simplejson ];
-
-    doCheck = false; # lazy packager
-  };
+  cornice = callPackage ../development/python-modules/cornice { };
 
   cram = callPackage ../development/python-modules/cram { };
 
@@ -1127,35 +1021,7 @@ in {
 
   bpython = callPackage ../development/python-modules/bpython {};
 
-  bsddb3 = buildPythonPackage rec {
-    name = "bsddb3-${version}";
-    version = "6.1.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/b/bsddb3/${name}.tar.gz";
-      sha256 = "6f21b0252125c07798d784c164ef135ad153d226c01b290258ee1c5b9e7c4dd3";
-    };
-
-    buildInputs = [ pkgs.db ];
-
-    # Judging from SyntaxError in test
-#    disabled = isPy3k;
-    doCheck = false; # test suite breaks python3 compatibility
-
-    # Path to database need to be set.
-    # Somehow the setup.py flag is not propagated.
-    #setupPyBuildFlags = [ "--berkeley-db=${pkgs.db}" ];
-    # We can also use a variable
-    preConfigure = ''
-      export BERKELEYDB_DIR=${pkgs.db.dev};
-    '';
-
-    meta = {
-      description = "Python bindings for Oracle Berkeley DB";
-      homepage = https://www.jcea.es/programacion/pybsddb.htm;
-      license = with licenses; [ agpl3 ]; # License changed from bsd3 to agpl3 since 6.x
-    };
-  };
+  bsddb3 = callPackage ../development/python-modules/bsddb3 { };
 
   bkcharts = callPackage ../development/python-modules/bkcharts { };
 
@@ -1169,53 +1035,13 @@ in {
 
   bottle = callPackage ../development/python-modules/bottle { };
 
-  box2d = buildPythonPackage rec {
-    name = "box2d-${version}";
-    version = "2.3b0";
-    disabled = (!isPy27);
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/B/Box2D/Box2D-2.3b0.zip";
-      sha256 = "4519842c650b0153550eb0c9864da46b5a4ec8555c68b70f5cd2952a21c788b0";
-    };
-
-    patches = [ ../development/python-modules/box2d/disable-test.patch ];
-
-    propagatedBuildInputs = [ pkgs.swig2 pkgs.box2d ];
-
-    meta = {
-      homepage = https://code.google.com/p/pybox2d/;
-      description = ''
-        A 2D game physics library for Python under
-        the very liberal zlib license
-      '';
-      license = licenses.zlib;
-      platforms = platforms.all;
-      maintainers = with maintainers; [ sepi ];
-    };
-  };
+  box2d = callPackage ../development/python-modules/box2d { pkgs-box2d = pkgs.box2d; };
 
   branca = callPackage ../development/python-modules/branca { };
 
   bugwarrior = callPackage ../development/python-modules/bugwarrior { };
 
-  # bugz = buildPythonPackage (rec {
-  #   name = "bugz-0.9.3";
-  #
-  #   src = pkgs.fetchgit {
-  #     url = "https://github.com/williamh/pybugz.git";
-  #     rev = "refs/tags/0.9.3";
-  #   };
-  #
-  #   propagatedBuildInputs = with self; [ self.argparse ];
-  #
-  #   doCheck = false;
-  #
-  #   meta = {
-  #     homepage = http://www.liquidx.net/pybugz/;
-  #     description = "Command line interface for Bugzilla";
-  #   };
-  # });
+  bugz = callPackage ../development/python-modules/bugz { };
 
   bugzilla = callPackage ../development/python-modules/bugzilla { };
 
@@ -1252,87 +1078,13 @@ in {
 
   case = callPackage ../development/python-modules/case {};
 
-  cassandra-driver = buildPythonPackage rec {
-    name = "cassandra-driver-3.6.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/c/cassandra-driver/${name}.tar.gz";
-      sha256 = "1aqmy3psn12lxgp659d0zsxkirxzy5lnbnzxf9xjq1a93s3qm704";
-    };
-
-    buildInputs = with self; [ pkgs.libev cython ];
-
-    propagatedBuildInputs = with self; [ futures six ];
-
-    postPatch = ''
-      sed -i "s/<=1.0.1//" setup.py
-    '';
-
-    checkPhase = ''
-      ${python.interpreter} setup.py gevent_nosetests
-      ${python.interpreter} setup.py eventlet_nosetests
-    '';
-
-    checkInputs = [ scales eventlet twisted mock gevent nose pytz pyyaml sure ];
-
-    # Could not get tests running
-    doCheck = false;
-
-    meta = {
-      homepage = http://datastax.github.io/python-driver/;
-      description = "A Python client driver for Apache Cassandra";
-      license = licenses.asl20;
-    };
-  };
+  cassandra-driver = callPackage ../development/python-modules/cassandra-driver { };
 
   cccolutils = callPackage ../development/python-modules/cccolutils {};
 
-  CDDB = buildPythonPackage rec {
-    name = "CDDB-1.4";
-
-    disabled = !isPy27;
-
-    buildInputs = optionals stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.IOKit ];
-
-    src = pkgs.fetchurl {
-      url = "http://cddb-py.sourceforge.net/${name}.tar.gz";
-      sha256 = "098xhd575ibvdx7i3dny3lwi851yxhjg2hn5jbbgrwj833rg5l5w";
-    };
-
-    meta = {
-      homepage = http://cddb-py.sourceforge.net/;
-      description = "CDDB and FreeDB audio CD track info access";
-      license = licenses.gpl2Plus;
-    };
-  };
-
-  cntk = buildPythonPackage rec {
-    inherit (pkgs.cntk) name version src meta;
-
-    buildInputs = [ pkgs.cntk pkgs.swig pkgs.openmpi ];
-    propagatedBuildInputs = with self; [ numpy scipy enum34 protobuf pip ];
-
-    CNTK_LIB_PATH = "${pkgs.cntk}/lib";
-    CNTK_COMPONENT_VERSION = pkgs.cntk.version;
-
-    postPatch = ''
-      cd bindings/python
-      sed -i 's,"libmpi.so.12","${pkgs.openmpi}/lib/libmpi.so",g' cntk/train/distributed.py
-    '';
-
-    postInstall = ''
-      rm -rf $out/${python.sitePackages}/cntk/libs
-      ln -s ${pkgs.cntk}/lib $out/${python.sitePackages}/cntk/libs
-      # It's not installed for some reason.
-      cp cntk/cntk_py.py $out/${python.sitePackages}/cntk
-    '';
+  CDDB = callPackage ../development/python-modules/cddb { };
 
-    # Actual tests are broken.
-    checkPhase = ''
-      cd $NIX_BUILD_TOP
-      ${python.interpreter} -c "import cntk"
-    '';
-  };
+  cntk = callPackage ../development/python-modules/cntk { };
 
   celery = callPackage ../development/python-modules/celery { };
 
@@ -1370,29 +1122,7 @@ in {
 
   cligj = callPackage ../development/python-modules/cligj { };
 
-  /* There is a project called "closure-linter" on PyPI that is the
-     same as this, but it does not appear to be owned by Google.
-     So we're pulling from Google's GitHub repo instead. */
-  closure-linter = buildPythonPackage rec {
-    name = "closure-linter-${version}";
-    version = "2.3.19";
-
-    /* This project has no Python 3 support, as noted by
-       https://github.com/google/closure-linter/issues/81 */
-    disabled = isPy3k;
-
-    propagatedBuildInputs = with self; [ gflags ];
-    src = pkgs.fetchgit {
-      url = "https://github.com/google/closure-linter";
-      rev = "5c27529075bb88bdc45e73008f496dec8438d658";
-      sha256 = "076c7q7pr7akfvq5y8lxr1ab81wwps07gw00igdkcxnc5k9dzxwc";
-    };
-    meta = {
-      description = "Checks JavaScript files against Google's style guide.";
-      homepage = "https://developers.google.com/closure/utilities/";
-      license = with licenses; [ asl20 ];
-    };
-  };
+  closure-linter = callPackage ../development/python-modules/closure-linter { };
 
   cloudpickle = callPackage ../development/python-modules/cloudpickle { };
 
@@ -1423,31 +1153,7 @@ in {
   # Backported version of the ConfigParser library of Python 3.3
   configparser = callPackage ../development/python-modules/configparser { };
 
-  ColanderAlchemy = buildPythonPackage rec {
-    name = "ColanderAlchemy-${version}";
-    version = "0.3.3";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/C/ColanderAlchemy/${name}.tar.gz";
-      sha256 = "11wcni2xmfmy001rj62q2pwf305vvngkrfm5c4zlwvgbvlsrvnnw";
-    };
-
-    patches = [
-      (pkgs.fetchpatch {
-          url = "https://github.com/stefanofontanelli/ColanderAlchemy/commit/b45fe35f2936a5ccb705e9344075191e550af6c9.patch";
-          sha256 = "1kf278wjq49zd6fhpp55vdcawzdd107767shzfck522sv8gr6qvx";
-      })
-    ];
-
-    buildInputs = with self; [ unittest2 ];
-    propagatedBuildInputs = with self; [ colander sqlalchemy ];
-
-    meta = {
-      description = "Autogenerate Colander schemas based on SQLAlchemy models";
-      homepage = https://github.com/stefanofontanelli/ColanderAlchemy;
-      license = licenses.mit;
-    };
-  };
+  ColanderAlchemy = callPackage ../development/python-modules/colanderalchemy { };
 
   conda = callPackage ../development/python-modules/conda { };
 
@@ -1515,36 +1221,7 @@ in {
 
   wakeonlan = callPackage ../development/python-modules/wakeonlan { };
 
-  openant = buildPythonPackage rec {
-    name = "openant-unstable-2017-02-11";
-
-    meta = with stdenv.lib; {
-      homepage = "https://github.com/Tigge/openant";
-      description = "ANT and ANT-FS Python Library";
-      license = licenses.mit;
-      platforms = platforms.linux;
-    };
-
-    src = pkgs.fetchFromGitHub {
-      owner = "Tigge";
-      repo = "openant";
-      rev = "ed89281e37f65d768641e87356cef38877952397";
-      sha256 = "1g81l9arqdy09ijswn3sp4d6i3z18d44lzyb78bwnvdb14q22k19";
-    };
-
-    # Removes some setup.py hacks intended to install udev rules.
-    # We do the job ourselves in postInstall below.
-    postPatch = ''
-      sed -i -e '/cmdclass=.*/d' setup.py
-    '';
-
-    postInstall = ''
-      install -dm755 "$out/etc/udev/rules.d"
-      install -m644 resources/ant-usb-sticks.rules "$out/etc/udev/rules.d/99-ant-usb-sticks.rules"
-    '';
-
-    propagatedBuildInputs = with self; [ pyusb ];
-  };
+  openant = callPackage ../development/python-modules/openant { };
 
   opencv = toPythonModule (pkgs.opencv.override {
     enablePython = true;
@@ -1564,74 +1241,15 @@ in {
 
   MDP = callPackage ../development/python-modules/mdp {};
 
-  minidb = buildPythonPackage rec {
-    name = "minidb-2.0.1";
-
-    src = pkgs.fetchurl {
-      url = "https://thp.io/2010/minidb/${name}.tar.gz";
-      sha256 = "1x958zr9jc26vaqij451qb9m2l7apcpz34ir9fwfjg4fwv24z2dy";
-    };
-
-    meta = {
-      description = "A simple SQLite3-based store for Python objects";
-      homepage = https://thp.io/2010/minidb/;
-      license = stdenv.lib.licenses.isc;
-      maintainers = [ stdenv.lib.maintainers.tv ];
-    };
-  };
+  minidb = callPackage ../development/python-modules/minidb { };
 
   miniupnpc = callPackage ../development/python-modules/miniupnpc {};
 
-  mixpanel = buildPythonPackage rec {
-    version = "4.0.2";
-    name = "mixpanel-${version}";
-    disabled = isPy3k;
-
-    src = pkgs.fetchzip {
-      url = "https://github.com/mixpanel/mixpanel-python/archive/${version}.zip";
-      sha256 = "0yq1bcsjzsz7yz4rp69izsdn47rvkld4wki2xmapp8gg2s9i8709";
-    };
-
-    buildInputs = with self; [ pytest mock ];
-    propagatedBuildInputs = with self; [ six ];
-    checkPhase = "py.test tests.py";
-
-    meta = {
-      homepage = https://github.com/mixpanel/mixpanel-python;
-      description = "This is the official Mixpanel Python library. This library
-                     allows for server-side integration of Mixpanel.";
-      license = stdenv.lib.licenses.asl20;
-    };
-  };
+  mixpanel = callPackage ../development/python-modules/mixpanel { };
 
   mpyq = callPackage ../development/python-modules/mpyq { };
 
-  mxnet = buildPythonPackage rec {
-    inherit (pkgs.mxnet) name version src meta;
-
-    buildInputs = [ pkgs.mxnet ];
-    propagatedBuildInputs = with self; [ requests numpy graphviz ];
-
-    LD_LIBRARY_PATH = makeLibraryPath [ pkgs.mxnet ];
-
-    doCheck = !isPy3k;
-
-    postPatch = ''
-      substituteInPlace python/setup.py \
-      --replace "graphviz<0.9.0" "graphviz<0.10.0" \
-      --replace "numpy<=1.15.0" "numpy<1.16.0" \
-      --replace "requests<2.19.0" "requests<2.20.0"
-    '';
-
-    preConfigure = ''
-      cd python
-    '';
-
-    postInstall = ''
-      rm -rf $out/mxnet
-      ln -s ${pkgs.mxnet}/lib/libmxnet.so $out/${python.sitePackages}/mxnet
-    '';
-  };
+  mxnet = callPackage ../development/python-modules/mxnet { };
 
   parsy = callPackage ../development/python-modules/parsy { };
 
@@ -1669,40 +1287,7 @@ in {
 
   python-ly = callPackage ../development/python-modules/python-ly {};
 
-  pyhepmc = buildPythonPackage rec {
-    name = "pyhepmc-${version}";
-    version = "0.5.0";
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pyhepmc/${name}.tar.gz";
-      sha256 = "1rbi8gqgclfvaibv9kzhfis11gw101x8amc93qf9y08ny4jfyr1d";
-    };
-
-    patches = [
-      # merge PR https://bitbucket.org/andybuckley/pyhepmc/pull-requests/1/add-incoming-outgoing-generators-for/diff
-      ../development/python-modules/pyhepmc_export_edges.patch
-      # add bindings to Flow class
-      ../development/python-modules/pyhepmc_export_flow.patch
-    ];
-
-    # regenerate python wrapper
-    preConfigure = ''
-      rm hepmc/hepmcwrap.py
-      swig -c++ -I${pkgs.hepmc}/include -python hepmc/hepmcwrap.i
-    '';
-
-    buildInputs = with pkgs; [ swig hepmc ];
-
-    HEPMCPATH = pkgs.hepmc;
-
-    meta = {
-      description = "A simple wrapper on the main classes of the HepMC event simulation representation, making it possible to create, read and manipulate HepMC events from Python code";
-      license     = licenses.gpl2;
-      maintainers = with maintainers; [ veprbl ];
-      platforms   = platforms.all;
-    };
-  };
+  pyhepmc = callPackage ../development/python-modules/pyhepmc { };
 
   pytest = self.pytest_37;
 
@@ -1741,6 +1326,8 @@ in {
 
   pytest-rerunfailures = callPackage ../development/python-modules/pytest-rerunfailures { };
 
+  pytest-relaxed = callPackage ../development/python-modules/pytest-relaxed { };
+
   pytest-flake8 = callPackage ../development/python-modules/pytest-flake8 { };
 
   pytestflakes = callPackage ../development/python-modules/pytest-flakes { };
@@ -1868,39 +1455,7 @@ in {
 
   derpconf = callPackage ../development/python-modules/derpconf { };
 
-  deskcon = self.buildPythonPackage rec {
-    name = "deskcon-0.3";
-    disabled = !isPy27;
-
-    src = pkgs.fetchFromGitHub {
-      owner= "screenfreeze";
-      repo = "deskcon-desktop";
-      rev = "267804122188fa79c37f2b21f54fe05c898610e6";
-      sha256 ="0i1dd85ls6n14m9q7lkympms1w3x0pqyaxvalq82s4xnjdv585j3";
-    };
-
-    phases = [ "unpackPhase" "installPhase" ];
-
-    pythonPath = [ self.pyopenssl pkgs.gtk3 ];
-
-    installPhase = ''
-      substituteInPlace server/deskcon-server --replace "python2" "python"
-
-      mkdir -p $out/bin
-      mkdir -p $out/lib/${python.libPrefix}/site-packages
-      cp -r "server/"* $out/lib/${python.libPrefix}/site-packages
-      mv $out/lib/${python.libPrefix}/site-packages/deskcon-server $out/bin/deskcon-server
-
-      wrapPythonProgramsIn $out/bin "$out $pythonPath"
-    '';
-
-    meta = {
-      description = "Integrates an Android device into a desktop";
-      homepage = https://github.com/screenfreeze/deskcon-desktop;
-      license = licenses.gpl3;
-    };
-  };
-
+  deskcon = callPackage ../development/python-modules/deskcon { };
 
   dill = callPackage ../development/python-modules/dill { };
 
@@ -1953,30 +1508,7 @@ in {
       pythonPackages = self;
     }));
 
-  EditorConfig = buildPythonPackage rec {
-    name = "EditorConfig-${version}";
-    version = "0.12.0";
-
-    # fetchgit used to ensure test submodule is available
-    src = pkgs.fetchgit {
-      url = "https://github.com/editorconfig/editorconfig-core-py";
-      rev = "refs/tags/v${version}";
-      sha256 = "0svk7id7ncygj2rnxhm7602xizljyidk4xgrl6i0xgq3829cz4bl";
-    };
-
-    buildInputs = [ pkgs.cmake ];
-    checkPhase = ''
-      cmake .
-      # utf_8_char fails with python3
-      ctest -E "utf_8_char" .
-    '';
-
-    meta = {
-      homepage = https://editorconfig.org;
-      description = "EditorConfig File Locator and Interpreter for Python";
-      license = stdenv.lib.licenses.psfl;
-    };
-  };
+  EditorConfig = callPackage ../development/python-modules/editorconfig { };
 
   edward = callPackage ../development/python-modules/edward { };
 
@@ -1994,127 +1526,19 @@ in {
 
   escapism = callPackage ../development/python-modules/escapism { };
 
-  etcd = buildPythonPackage rec {
-    name = "etcd-${version}";
-    version = "2.0.8";
-
-    # PyPI package is incomplete
-    src = pkgs.fetchurl {
-      url = "https://github.com/dsoprea/PythonEtcdClient/archive/${version}.tar.gz";
-      sha256 = "0fi6rxa1yxvz7nwrc7dw6fax3041d6bj3iyhywjgbkg7nadi9i8v";
-    };
-
-    patchPhase = ''
-      sed -i -e '13,14d;37d' setup.py
-    '';
-
-    propagatedBuildInputs = with self; [ simplejson pytz requests ];
-
-    # No proper tests are available
-    doCheck = false;
-
-    meta = {
-      description = "A Python etcd client that just works";
-      homepage = https://github.com/dsoprea/PythonEtcdClient;
-      license = licenses.gpl2;
-    };
-  };
+  etcd = callPackage ../development/python-modules/etcd { };
 
   evdev = callPackage ../development/python-modules/evdev {};
 
   eve = callPackage ../development/python-modules/eve {};
 
-  eventlib = buildPythonPackage rec {
-    pname = "python-eventlib";
-    name = "${pname}-${version}";
-    version = "0.2.2";
-
-    # Judging from SyntaxError
-    disabled = isPy3k;
-
-    src = pkgs.fetchdarcs {
-      url = "http://devel.ag-projects.com/repositories/${pname}";
-      rev = "release-${version}";
-      sha256 = "1zxhpq8i4jwsk7wmfncqfm211hqikj3hp38cfv509924bi76wak8";
-    };
-
-    propagatedBuildInputs = with self; [ greenlet ];
-
-    doCheck = false;
-
-    meta = {
-      description = "Eventlib bindings for python";
-      homepage    = "http://ag-projects.com/";
-      license     = licenses.lgpl2;
-      platforms   = platforms.all;
-    };
-  };
+  eventlib = callPackage ../development/python-modules/eventlib { };
 
   events = callPackage ../development/python-modules/events { };
 
-  eyeD3 = buildPythonPackage rec {
-    version = "0.7.8";
-    name    = "eyeD3-${version}";
-    disabled = isPyPy;
-
-    src = pkgs.fetchurl {
-      url = "http://eyed3.nicfit.net/releases/${name}.tar.gz";
-      sha256 = "1nv7nhfn1d0qm7rgkzksbccgqisng8klf97np0nwaqwd5dbmdf86";
-    };
+  eyeD3 = callPackage ../development/python-modules/eyed3 { };
 
-    buildInputs = with self; [ paver ];
-
-    postInstall = ''
-      for prog in "$out/bin/"*; do
-        wrapProgram "$prog" --prefix PYTHONPATH : "$PYTHONPATH" \
-                            --prefix PATH : ${python}/bin
-      done
-    '';
-
-    meta = {
-      description = "A Python module and command line program for processing ID3 tags";
-      homepage    = http://eyed3.nicfit.net/;
-      license     = licenses.gpl2;
-      maintainers = with maintainers; [ lovek323 ];
-      platforms   = platforms.unix;
-
-      longDescription = ''
-        eyeD3 is a Python module and command line program for processing ID3
-        tags. Information about mp3 files (i.e bit rate, sample frequency, play
-        time, etc.) is also provided. The formats supported are ID3 v1.0/v1.1
-        and v2.3/v2.4.
-      '';
-    };
-  };
-
-  execnet = buildPythonPackage rec {
-    name = "${pname}-${version}";
-    pname = "execnet";
-    version = "1.4.1";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/e/${pname}/${name}.tar.gz";
-      sha256 = "1rpk1vyclhg911p3hql0m0nrpq7q7mysxnaaw6vs29cpa6kx8vgn";
-    };
-    buildInputs = with self; [ pytest setuptools_scm ];
-    propagatedBuildInputs = with self; [ apipkg ];
-    # remove vbox tests
-    postPatch = ''
-      rm -v testing/test_termination.py
-      rm -v testing/test_channel.py
-      rm -v testing/test_xspec.py
-      rm -v testing/test_gateway.py
-    '';
-    checkPhase = ''
-      py.test testing
-    '';
-    __darwinAllowLocalNetworking = true;
-    meta = {
-      description = "Rapid multi-Python deployment";
-      license = licenses.gpl2;
-      homepage = "http://codespeak.net/execnet";
-      maintainers = with maintainers; [ nand0p ];
-    };
-  };
+  execnet = callPackage ../development/python-modules/execnet { };
 
   ezdxf = callPackage ../development/python-modules/ezdxf {};
 
@@ -2126,64 +1550,11 @@ in {
 
   faker = callPackage ../development/python-modules/faker { };
 
-  fake_factory = buildPythonPackage rec {
-    name = "fake-factory-${version}";
-    version = "0.6.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/fake-factory/${name}.tar.gz";
-      sha256 = "09sgk0kylsshs64a1xsz3qr187sbnqrbf4z8k3dgsy32lsgyffv2";
-    };
-
-    propagatedBuildInputs = with self; [ six dateutil ipaddress mock ];
-    checkPhase = ''
-      ${python.interpreter} -m unittest faker.tests
-    '';
-
-    meta = {
-      description = "A Python package that generates fake data for you";
-      homepage    = https://pypi.python.org/pypi/fake-factory;
-      license     = licenses.mit;
-      maintainers = with maintainers; [ lovek323 ];
-      platforms   = platforms.unix;
-    };
-  };
-
-  factory_boy = buildPythonPackage rec {
-    name = "factory_boy-${version}";
-    version = "2.6.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/factory_boy/${name}.tar.gz";
-      sha256 = "0a21f8kq917fj8xgmyp6gy8vcrlzzgwn80qas0d76h3vjbdy0bdq";
-    };
-
-    propagatedBuildInputs = with self; [ fake_factory ];
+  fake_factory = callPackage ../development/python-modules/fake_factory { };
 
-    meta = {
-      description = "A Python package to create factories for complex objects";
-      homepage    = https://github.com/rbarrois/factory_boy;
-      license     = licenses.mit;
-    };
-  };
+  factory_boy = callPackage ../development/python-modules/factory_boy { };
 
-  Fabric = buildPythonPackage rec {
-    name = "Fabric-${version}";
-    version = "1.13.2";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/F/Fabric/${name}.tar.gz";
-      sha256 = "0k944dxr41whw7ib6380q9x15wyskx7fqni656icdn8rzshn9bwq";
-    };
-    disabled = isPy3k;
-    doCheck = (!isPyPy);  # https://github.com/fabric/fabric/issues/11891
-    propagatedBuildInputs = with self; [ paramiko pycrypto ];
-    buildInputs = with self; [ fudge_9 nose ];
-    meta = {
-      description = "Pythonic remote execution";
-      homepage    = https://www.fabfile.org/;
-      license     = licenses.bsd2;
-    };
-  };
+  Fabric = callPackage ../development/python-modules/Fabric { };
 
   faulthandler = if ! isPy3k
     then callPackage ../development/python-modules/faulthandler {}
@@ -2193,28 +1564,7 @@ in {
 
   flit = callPackage ../development/python-modules/flit { };
 
-  flowlogs_reader = buildPythonPackage rec {
-    name = "flowlogs_reader-1.0.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/flowlogs_reader/${name}.tar.gz";
-      sha256 = "0158aki6m3pkf98hpd60088qyhrfxkmybdf8hv3qfl8nb61vaiwf";
-    };
-
-    propagatedBuildInputs = with self; [
-      botocore boto3 docutils
-    ];
-    buildInputs = with self; [
-      unittest2 mock
-    ];
-
-    meta = with pkgs.stdenv.lib; {
-      description = "Python library to make retrieving Amazon VPC Flow Logs from CloudWatch Logs a bit easier";
-      homepage = "https://github.com/obsrvbl/flowlogs-reader";
-      maintainers = with maintainers; [ cransom ];
-      license = licenses.asl20;
-    };
-  };
+  flowlogs_reader = callPackage ../development/python-modules/flowlogs_reader { };
 
   fluent-logger = callPackage ../development/python-modules/fluent-logger {};
 
@@ -2230,125 +1580,27 @@ in {
 
   ftputil = callPackage ../development/python-modules/ftputil { };
 
-  fudge = buildPythonPackage rec {
-    name = "fudge-1.1.0";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/fudge/${name}.tar.gz";
-      sha256 = "eba59a926fa1df1ab6dddd69a7a8af21865b16cad800cb4d1af75070b0f52afb";
-    };
-    buildInputs = with self; [ nose nosejs ];
-    propagatedBuildInputs = with self; [ sphinx ];
-
-    disabled = isPy3k;
+  fudge = callPackage ../development/python-modules/fudge { };
 
-    checkPhase = ''
-      nosetests -v
-    '';
-  };
+  fudge_9 = self.fudge.overridePythonAttrs (old: rec {
+     version = "0.9.6";
 
-  fudge_9 = self.fudge.override rec {
-    name = "fudge-0.9.6";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/fudge/${name}.tar.gz";
+     src = fetchPypi {
+      pname = "fudge";
+      inherit version;
       sha256 = "34690c4692e8717f4d6a2ab7d841070c93c8d0ea0d2615b47064e291f750b1a0";
     };
-  };
-
-
-  funcparserlib = buildPythonPackage rec {
-    name = "funcparserlib-0.3.6";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/funcparserlib/${name}.tar.gz";
-      sha256 = "b7992eac1a3eb97b3d91faa342bfda0729e990bd8a43774c1592c091e563c91d";
-    };
+  });
 
-    checkPhase = ''
-      ${python.interpreter} -m unittest discover
-    '';
-
-    # Tests are Python 2.x only judging from SyntaxError
-    doCheck = !(isPy3k);
-
-    meta = {
-      description = "Recursive descent parsing library based on functional combinators";
-      homepage = https://code.google.com/p/funcparserlib/;
-      license = licenses.mit;
-      platforms = platforms.unix;
-    };
-  };
+  funcparserlib = callPackage ../development/python-modules/funcparserlib { };
 
   fastcache = callPackage ../development/python-modules/fastcache { };
 
-  functools32 = if isPy3k then null else buildPythonPackage rec {
-    name = "functools32-${version}";
-    version = "3.2.3-2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/functools32/functools32-${version}.tar.gz";
-      sha256 = "0v8ya0b58x47wp216n1zamimv4iw57cxz3xxhzix52jkw3xks9gn";
-    };
-
-
-    meta = with stdenv.lib; {
-      description = "This is a backport of the functools standard library module from";
-      homepage = "https://github.com/MiCHiLU/python-functools32";
-    };
-  };
-
-  gateone = buildPythonPackage rec {
-    name = "gateone-1.2-0d57c3";
-    disabled = ! isPy27;
-    src = pkgs.fetchFromGitHub {
-      rev = "1d0e8037fbfb7c270f3710ce24154e24b7031bea";
-      owner= "liftoff";
-      repo = "GateOne";
-      sha256 = "1ghrawlqwv7wnck6alqpbwy9mpv0y21cw2jirrvsxaracmvgk6vv";
-    };
-    propagatedBuildInputs = with self; [tornado futures html5lib pkgs.openssl pkgs.cacert pkgs.openssh];
-    meta = {
-      homepage = https://liftoffsoftware.com/;
-      description = "GateOne is a web-based terminal emulator and SSH client";
-      maintainers = with maintainers; [ tomberek ];
-
-    };
-    postInstall=''
-    cp -R "$out/gateone/"* $out/lib/python2.7/site-packages/gateone
-    '';
-  };
-
-  gcutil = buildPythonPackage rec {
-    name = "gcutil-1.16.1";
-
-    src = pkgs.fetchurl {
-      url = https://dl.google.com/dl/cloudsdk/release/artifacts/gcutil-1.16.1.tar.gz;
-      sha256 = "00jaf7x1ji9y46fbkww2sg6r6almrqfsprydz3q2swr4jrnrsx9x";
-    };
-
-    propagatedBuildInputs = with self; [
-      gflags
-      iso8601
-      ipaddr
-      httplib2
-      google_apputils
-      google_api_python_client
-    ];
+  functools32 = callPackage ../development/python-modules/functools32 { };
 
-    prePatch = ''
-      sed -i -e "s|google-apputils==0.4.0|google-apputils==0.4.1|g" setup.py
-      substituteInPlace setup.py \
-        --replace "httplib2==0.8" "httplib2" \
-        --replace "iso8601==0.1.4" "iso8601"
-    '';
+  gateone = callPackage ../development/python-modules/gateone { };
 
-    meta = {
-      description = "Command-line tool for interacting with Google Compute Engine";
-      homepage = "https://cloud.google.com/compute/docs/gcutil/";
-      license = licenses.asl20;
-      maintainers = with maintainers; [ phreedom ];
-      broken = true;
-    };
-  };
+  gcutil = callPackage ../development/python-modules/gcutil { };
 
   GeoIP = callPackage ../development/python-modules/GeoIP { };
 
@@ -2356,71 +1608,11 @@ in {
 
   gmpy2 = callPackage ../development/python-modules/gmpy2 { };
 
-  gmusicapi = with pkgs; buildPythonPackage rec {
-    name = "gmusicapi-10.1.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/gmusicapi/gmusicapi-10.1.0.tar.gz";
-      sha256 = "0smlrafh1bjzrcjzl7im8pf8f04gcnx92lf3g5qr7yzgq8k20xa2";
-    };
-
-    propagatedBuildInputs = with self; [
-      validictory
-      decorator
-      mutagen
-      protobuf
-      setuptools
-      requests
-      dateutil
-      proboscis
-      mock
-      appdirs
-      oauth2client
-      pyopenssl
-      gpsoauth
-      MechanicalSoup
-      future
-    ];
-
-    meta = {
-      description = "An unofficial API for Google Play Music";
-      homepage = https://pypi.python.org/pypi/gmusicapi/;
-      license = licenses.bsd3;
-    };
-  };
-
-  gnureadline = buildPythonPackage rec {
-    version = "6.3.3";
-    name = "gnureadline-${version}";
-    disabled = isPyPy;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/gnureadline/${name}.tar.gz";
-      sha256 = "1ghck2zz4xbqa3wz73brgjhrqj55p9hc1fq6c9zb09dnyhwb0nd2";
-    };
-
-    buildInputs = [ pkgs.ncurses ];
-    patchPhase = ''
-      substituteInPlace setup.py --replace "/bin/bash" "${pkgs.bash}/bin/bash"
-    '';
-  };
+  gmusicapi = callPackage ../development/python-modules/gmusicapi { };
 
-  gnutls = buildPythonPackage rec {
-    pname = "python-gnutls";
-    version = "3.0.0";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/python-gnutls/${pname}-${version}.tar.gz";
-      sha256 = "1yrdxcj5rzvz8iglircz6icvyggz5fmdcd010n6w3j60yp4p84kc";
-    };
+  gnureadline = callPackage ../development/python-modules/gnureadline { };
 
-    # https://github.com/AGProjects/python-gnutls/issues/2
-    disabled = isPy3k;
-
-    propagatedBuildInputs = with self; [ pkgs.gnutls ];
-    patchPhase = ''
-      substituteInPlace gnutls/library/__init__.py --replace "/usr/local/lib" "${pkgs.gnutls.out}/lib"
-    '';
-  };
+  gnutls = callPackage ../development/python-modules/gnutls { };
 
   gpy = callPackage ../development/python-modules/gpy { };
 
@@ -2442,37 +1634,7 @@ in {
   gpapi = callPackage ../development/python-modules/gpapi { };
   gplaycli = callPackage ../development/python-modules/gplaycli { };
 
-  gpsoauth = buildPythonPackage rec {
-    version = "0.2.0";
-    name = "gpsoauth-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/gpsoauth/${name}.tar.gz";
-      sha256 = "01zxw8rhml8xfwda7ba8983890bzwkfa55ijd6qf8qrdy6ja1ncn";
-    };
-
-    propagatedBuildInputs = with self; [
-      cffi
-      cryptography
-      enum34
-      idna
-      ipaddress
-      ndg-httpsclient
-      pyopenssl
-      pyasn1
-      pycparser
-      pycryptodome
-      requests
-      six
-    ];
-
-    meta = {
-      description = "A python client library for Google Play Services OAuth";
-      homepage = "https://github.com/simon-weber/gpsoauth";
-      license = licenses.mit;
-      maintainers = with maintainers; [ jgillich ];
-    };
-  };
+  gpsoauth = callPackage ../development/python-modules/gpsoauth { };
 
   grip = callPackage ../development/python-modules/grip { };
 
@@ -2480,41 +1642,7 @@ in {
     gst-plugins-base = pkgs.gst_all_1.gst-plugins-base;
   };
 
-  gtimelog = buildPythonPackage rec {
-    name = "gtimelog-${version}";
-    version = "0.9.1";
-
-    src = pkgs.fetchurl {
-      url = "https://github.com/gtimelog/gtimelog/archive/${version}.tar.gz";
-      sha256 = "0qk8fv8cszzqpdi3wl9vvkym1jil502ycn6sic4jrxckw5s9jsfj";
-    };
-
-    buildInputs = [ pkgs.glibcLocales ];
-
-    LC_ALL="en_US.UTF-8";
-
-    # TODO: AppIndicator
-    propagatedBuildInputs = with self; [ pkgs.gobjectIntrospection pygobject3 pkgs.makeWrapper pkgs.gtk3 ];
-
-    checkPhase = ''
-      substituteInPlace runtests --replace "/usr/bin/env python" "${python}/bin/${python.executable}"
-      ./runtests
-    '';
-
-    preFixup = ''
-        wrapProgram $out/bin/gtimelog \
-          --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
-          --prefix LD_LIBRARY_PATH ":" "${pkgs.gtk3.out}/lib" \
-    '';
-
-    meta = {
-      description = "A small Gtk+ app for keeping track of your time. It's main goal is to be as unintrusive as possible";
-      homepage = https://mg.pov.lt/gtimelog/;
-      license = licenses.gpl2Plus;
-      maintainers = with maintainers; [ ocharles ];
-      platforms = platforms.unix;
-    };
-  };
+  gtimelog = callPackage ../development/python-modules/gtimelog { };
 
   gurobipy = if stdenv.hostPlatform.system == "x86_64-darwin"
   then callPackage ../development/python-modules/gurobipy/darwin.nix {
@@ -2530,114 +1658,19 @@ in {
 
   hglib = callPackage ../development/python-modules/hglib {};
 
-  humanize = buildPythonPackage rec {
-    version = "0.5.1";
-    name = "humanize-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/humanize/${name}.tar.gz";
-      sha256 = "a43f57115831ac7c70de098e6ac46ac13be00d69abbf60bdcac251344785bb19";
-    };
-
-    buildInputs = with self; [ mock ];
-
-    doCheck = false;
-
-    meta = {
-      description = "Python humanize utilities";
-      homepage = https://github.com/jmoiron/humanize;
-      license = licenses.mit;
-      maintainers = with maintainers; [ ];
-      platforms = platforms.linux; # can only test on linux
-    };
-
-  };
+  humanize = callPackage ../development/python-modules/humanize { };
 
   hupper = callPackage ../development/python-modules/hupper {};
 
-  hovercraft = buildPythonPackage rec {
-    disabled = ! isPy3k;
-    name = "hovercraft-${version}";
-    version = "2.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/hovercraft/${name}.tar.gz";
-      sha256 = "0lqxr816lymgnywln8bbv9nrmkyahjjcjkm9kjyny9bflayz4f1g";
-    };
-
-    propagatedBuildInputs = with self; [ docutils lxml manuel pygments svg-path watchdog ];
-
-    # one test assumes we have docutils 0.12
-    # TODO: enable tests after upgrading docutils to 0.12
-    doCheck = false;
-
-    meta = {
-      description = "A tool to make impress.js presentations from reStructuredText";
-      homepage = https://github.com/regebro/hovercraft;
-      license = licenses.mit;
-      maintainers = with maintainers; [ goibhniu ];
-    };
-  };
+  hovercraft = callPackage ../development/python-modules/hovercraft { };
 
-  hsaudiotag = buildPythonPackage (rec {
-    name = "hsaudiotag-1.1.1";
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/hsaudiotag/${name}.tar.gz";
-      sha256 = "15hgm128p8nysfi0jb127awga3vlj0iw82l50swjpvdh01m7rda8";
-    };
-
-    # no tests
-    doCheck = false;
-
-    meta = {
-      description = "A pure Python library that lets one to read metadata from media files";
-      homepage = http://hg.hardcoded.net/hsaudiotag/;
-      license = licenses.bsd3;
-    };
-  });
-
-  hsaudiotag3k = buildPythonPackage (rec {
-    name = "hsaudiotag3k-1.1.3";
-    disabled = !isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/hsaudiotag3k/${name}.tar.gz";
-      sha256 = "0bv5k5594byr2bmhh77xv10fkdpckcmxg3w380yp30aqf83rcsx3";
-    };
-
-    # no tests
-    doCheck = false;
-
-    meta = {
-      description = "A pure Python library that lets one to read metadata from media files";
-      homepage = http://hg.hardcoded.net/hsaudiotag/;
-      license = licenses.bsd3;
-    };
-  });
+  hsaudiotag = callPackage ../development/python-modules/hsaudiotag { };
 
+  hsaudiotag3k = callPackage ../development/python-modules/hsaudiotag3k { };
 
   htmlmin = callPackage ../development/python-modules/htmlmin {};
 
-  httpauth = buildPythonPackage rec {
-    version = "0.3";
-    name = "httpauth-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/httpauth/${name}.tar.gz";
-      sha256 = "0qas7876igyz978pgldp5r7n7pis8n4vf0v87gxr9l7p7if5lr3l";
-    };
-
-    doCheck = false;
-
-    meta = {
-      description = "WSGI HTTP Digest Authentication middleware";
-      homepage = https://github.com/jonashaag/httpauth;
-      license = licenses.bsd2;
-      maintainers = with maintainers; [ ];
-    };
-  };
+  httpauth = callPackage ../development/python-modules/httpauth { };
 
   idna-ssl = callPackage ../development/python-modules/idna-ssl { };
 
@@ -2645,22 +1678,7 @@ in {
 
   ijson = callPackage ../development/python-modules/ijson {};
 
-  imagesize = buildPythonPackage rec {
-    name = "imagesize-${version}";
-    version = "0.7.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/imagesize/${name}.tar.gz";
-      sha256 = "0msgz4ncp2nb5nbsxnf8kvxsl6nhwvc3b46ik097fvznl3y10gdv";
-    };
-
-    meta = {
-      description = "Getting image size from png/jpeg/jpeg2000/gif file";
-      homepage = https://github.com/shibukawa/imagesize_py;
-      license = with licenses; [ mit ];
-    };
-
-  };
+  imagesize = callPackage ../development/python-modules/imagesize { };
 
   image-match = callPackage ../development/python-modules/image-match { };
 
@@ -2668,115 +1686,17 @@ in {
 
   immutables = callPackage ../development/python-modules/immutables {};
 
-  imread = buildPythonPackage rec {
-    name = "python-imread-${version}";
-    version = "0.6";
-
-    src = pkgs.fetchurl {
-      url = "https://github.com/luispedro/imread/archive/release-${version}.tar.gz";
-      sha256 = "0i14bc67200zhzxc41g5dfp2m0pr1zaa2gv59p2va1xw0ji2dc0f";
-    };
-
-    nativeBuildInputs = [ pkgs.pkgconfig ];
-    buildInputs = with self; [
-      nose
-      pkgs.libjpeg
-      pkgs.libpng
-      pkgs.libtiff
-      pkgs.libwebp
-    ];
-    propagatedBuildInputs = with self; [ numpy ];
-
-    meta = with stdenv.lib; {
-      description = "Python package to load images as numpy arrays";
-      homepage = https://imread.readthedocs.io/en/latest/;
-      maintainers = with maintainers; [ luispedro ];
-      license = licenses.mit;
-      platforms = platforms.linux;
-    };
-  };
+  imread = callPackage ../development/python-modules/imread { };
 
   imaplib2 = callPackage ../development/python-modules/imaplib2 { };
 
-  ipfsapi = buildPythonPackage rec {
-    name = "ipfsapi-${version}";
-    version = "0.4.2.post1";
-    disabled = isPy27;
-
-    src = pkgs.fetchFromGitHub {
-      owner = "ipfs";
-      repo = "py-ipfs-api";
-      rev = "0c485544a114f580c65e2ffbb5782efbf7fd9f61";
-      sha256 = "1v7f77cv95yv0v80gisdh71mj7jcq41xcfip6bqm57zfdbsa0xpn";
-    };
-
-    propagatedBuildInputs = with self; [ six requests ];
-
-    meta = {
-      description = "A python client library for the IPFS API";
-      license = licenses.mit;
-      maintainers = with maintainers; [ mguentner ];
-      homepage = "https://pypi.python.org/pypi/ipfsapi";
-    };
-  };
-
-  itsdangerous = buildPythonPackage rec {
-    name = "itsdangerous-0.24";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/itsdangerous/${name}.tar.gz";
-      sha256 = "06856q6x675ly542ig0plbqcyab6ksfzijlyf1hzhgg3sgwgrcyb";
-    };
-
-    meta = {
-      description = "Helpers to pass trusted data to untrusted environments and back";
-      homepage = "https://pypi.python.org/pypi/itsdangerous/";
-    };
-  };
+  ipfsapi = callPackage ../development/python-modules/ipfsapi { };
 
-  iniparse = buildPythonPackage rec {
+  itsdangerous = callPackage ../development/python-modules/itsdangerous { };
 
-    name = "iniparse-${version}";
-    version = "0.4";
+  iniparse = callPackage ../development/python-modules/iniparse { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/iniparse/iniparse-${version}.tar.gz";
-      sha256 = "0m60k46vr03x68jckachzsipav0bwhhnqb8715hm1cngs89fxhdb";
-    };
-
-    checkPhase = ''
-      ${python.interpreter} runtests.py
-    '';
-
-    # Does not install tests
-    doCheck = false;
-
-    meta = with stdenv.lib; {
-      description = "Accessing and Modifying INI files";
-      license = licenses.mit;
-      maintainers = with maintainers; [ danbst ];
-    };
-  };
-
-  i3-py = buildPythonPackage rec {
-    version = "0.6.4";
-    name = "i3-py-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/i3-py/i3-py-${version}.tar.gz";
-      sha256 = "1sgl438jrb4cdyl7hbc3ymwsf7y3zy09g1gh7ynilxpllp37jc8y";
-    };
-
-    # no tests in tarball
-    doCheck = false;
-
-    meta = {
-      description = "Tools for i3 users and developers";
-      homepage =  "https://github.com/ziberna/i3-py";
-      license = licenses.gpl3;
-      platforms = platforms.linux;
-    };
-  };
+  i3-py = callPackage ../development/python-modules/i3-py { };
 
   JayDeBeApi = callPackage ../development/python-modules/JayDeBeApi {};
 
@@ -2800,52 +1720,13 @@ in {
 
   jsonpickle = callPackage ../development/python-modules/jsonpickle { };
 
-  jsonpointer = buildPythonPackage rec {
-    name = "jsonpointer-1.9";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/j/jsonpointer/${name}.tar.gz";
-      sha256 = "39403b47a71aa782de6d80db3b78f8a5f68ad8dfc9e674ca3bb5b32c15ec7308";
-    };
-
-    meta = {
-      description = "Resolve JSON Pointers in Python";
-      homepage = "https://github.com/stefankoegl/python-json-pointer";
-      license = stdenv.lib.licenses.bsd2; # "Modified BSD license, says pypi"
-    };
-  };
+  jsonpointer = callPackage ../development/python-modules/jsonpointer { };
 
   jsonrpclib = callPackage ../development/python-modules/jsonrpclib { };
 
   jsonrpclib-pelix = callPackage ../development/python-modules/jsonrpclib-pelix {};
 
-  jsonwatch = buildPythonPackage rec {
-    name = "jsonwatch-0.2.0";
-
-    disabled = isPyPy; # doesn't find setuptools
-
-    src = pkgs.fetchurl {
-      url = "https://github.com/dbohdan/jsonwatch/archive/v0.2.0.tar.gz";
-      sha256 = "04b616ef97b9d8c3887004995420e52b72a4e0480a92dbf60aa6c50317261e06";
-    };
-
-    propagatedBuildInputs = with self; [ six ];
-
-    meta = {
-      description = "Like watch -d but for JSON";
-      longDescription = ''
-        jsonwatch is a command line utility with which you can track changes in
-        JSON data delivered by a shell command or a web (HTTP/HTTPS) API.
-        jsonwatch requests data from the designated source repeatedly at a set
-        interval and displays the differences when the data changes. It is
-        similar in its behavior to how watch(1) with the -d switch works
-        for plain-text data.
-      '';
-      homepage = "https://github.com/dbohdan/jsonwatch";
-      license = licenses.mit;
-      platforms = platforms.all;
-    };
-  };
+  jsonwatch = callPackage ../development/python-modules/jsonwatch { };
 
   latexcodec = callPackage ../development/python-modules/latexcodec {};
 
@@ -2855,107 +1736,13 @@ in {
 
   libsoundtouch = callPackage ../development/python-modules/libsoundtouch { };
 
-  libthumbor = buildPythonPackage rec {
-    name = "libthumbor-${version}";
-    version = "1.3.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/l/libthumbor/${name}.tar.gz";
-      sha256 = "1vjhszsf8wl9k16wyg2rfjycjnawzl7z8j39bhiysbz5x4lqg91b";
-    };
-
-    buildInputs = with self; [ django ];
-
-    propagatedBuildInputs = with self; [ six pycrypto ];
-
-    doCheck = false;
-
-    meta = {
-      description = "libthumbor is the python extension to thumbor";
-      homepage = https://github.com/heynemann/libthumbor;
-      license = licenses.mit;
-    };
-  };
-
-  lightblue = buildPythonPackage rec {
-    pname = "lightblue";
-    version = "0.4";
-    name = "${pname}-${version}";
-    disabled = isPy3k; # build fails, 2018-04-11
-
-    src = pkgs.fetchurl {
-      url = "mirror://sourceforge/${pname}/${name}.tar.gz";
-      sha256 = "016h1mlhpqxjj25lcvl4fqc19k8ifmsv6df7rhr12fyfcrp5i14d";
-    };
-
-    buildInputs = [ pkgs.bluez pkgs.openobex ];
-
-
-    meta = {
-      homepage = http://lightblue.sourceforge.net;
-      description = "Cross-platform Bluetooth API for Python";
-      maintainers = with maintainers; [ leenaars ];
-      license = licenses.gpl3;
-      platforms = platforms.all;
-    };
-  };
-
+  libthumbor = callPackage ../development/python-modules/libthumbor { };
 
-  lightning = buildPythonPackage rec {
-    version = "1.2.1";
-    name = "lightning-python-${version}";
+  lightblue = callPackage ../development/python-modules/lightblue { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/l/lightning-python/${name}.tar.gz";
-      sha256 = "3987d7d4a634bdb6db9bcf212cf4d2f72bab5bc039f4f6cbc02c9d01c4ade792";
-    };
+  lightning = callPackage ../development/python-modules/lightning { };
 
-    buildInputs = with self; [ pytest ];
-
-    propagatedBuildInputs = with self; [
-      jinja2
-      matplotlib
-      numpy
-      requests
-      six
-    ];
-
-    meta = {
-      description = "A Python client library for the Lightning data visualization server";
-      homepage = http://lightning-viz.org;
-      license = licenses.mit;
-    };
-  };
-
-  jupyter = buildPythonPackage rec {
-    version = "1.0.0";
-    name = "jupyter-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/j/jupyter/${name}.tar.gz";
-      sha256 = "d9dc4b3318f310e34c82951ea5d6683f67bed7def4b259fafbfe4f1beb1d8e5f";
-    };
-
-    propagatedBuildInputs = with self; [
-      notebook
-      qtconsole
-      jupyter_console
-      nbconvert
-      ipykernel
-      ipywidgets
-    ];
-
-    # Meta-package, no tests
-    doCheck = false;
-
-    meta = {
-      description = "Installs all the Jupyter components in one go";
-      homepage = "http://jupyter.org/";
-      license = licenses.bsd3;
-      platforms = platforms.all;
-      priority = 100; # This is a metapackage which is unimportant
-    };
-  };
+  jupyter = callPackage ../development/python-modules/jupyter { };
 
   jupyter_console = callPackage ../development/python-modules/jupyter_console { };
 
@@ -2965,234 +1752,29 @@ in {
 
   PyLTI = callPackage ../development/python-modules/pylti { };
 
-  lmdb = buildPythonPackage rec {
-    pname = "lmdb";
-    version = "0.92";
-    name = "${pname}-${version}";
+  lmdb = callPackage ../development/python-modules/lmdb { };
 
-    src = self.fetchPypi {
-      inherit pname version;
-      sha256 = "01nw6r08jkipx6v92kw49z34wmwikrpvc5j9xawdiyg1n2526wrx";
-    };
+  logilab_astng = callPackage ../development/python-modules/logilab_astng { };
 
-    # Some sort of mysterious failure with lmdb.tool
-    doCheck = !isPy3k;
-
-    meta = {
-      description = "Universal Python binding for the LMDB 'Lightning' Database";
-      homepage = "https://github.com/dw/py-lmdb";
-      license = licenses.openldap;
-      maintainers = with maintainers; [ copumpkin ];
-    };
-  };
-
-  logilab_astng = buildPythonPackage rec {
-    name = "logilab-astng-0.24.3";
-
-    src = pkgs.fetchurl {
-      url = "http://download.logilab.org/pub/astng/${name}.tar.gz";
-      sha256 = "0np4wpxyha7013vkkrdy54dvnil67gzi871lg60z8lap0l5h67wn";
-    };
-
-    propagatedBuildInputs = with self; [ logilab_common ];
-  };
-
-  lpod = buildPythonPackage rec {
-    version = "1.1.7";
-    name = "python-lpod-${version}";
-    # lpod library currently does not support Python 3.x
-    disabled = isPy3k;
-
-    propagatedBuildInputs = with self; [ lxml docutils pillow ];
-
-    src = pkgs.fetchFromGitHub {
-      owner = "lpod";
-      repo = "lpod-python";
-      rev = "dee32120ee582ff337b0c52a95a9a87cca71fd67";
-      sha256 = "1mikvzp27wxkzpr2lii4wg1hhx8h610agckqynvsrdc8v3nw9ciw";
-    };
-
-    meta = {
-      homepage = https://github.com/lpod/lpod-python/;
-      description = "Library implementing the ISO/IEC 26300 OpenDocument Format standard (ODF) ";
-      license = licenses.gpl3;
-    };
-  };
+  lpod = callPackage ../development/python-modules/lpod { };
 
   luftdaten = callPackage ../development/python-modules/luftdaten { };
 
   m2r = callPackage ../development/python-modules/m2r { };
 
-  mailchimp = buildPythonPackage rec {
-    version = "2.0.9";
-    name = "mailchimp-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/mailchimp/mailchimp-${version}.tar.gz";
-      sha256 = "0351ai0jqv3dzx0xxm1138sa7mb42si6xfygl5ak8wnfc95ff770";
-    };
-
-    buildInputs = with self; [ docopt ];
-    propagatedBuildInputs = with self; [ requests ];
-    patchPhase = ''
-      sed -i 's/==/>=/' setup.py
-    '';
-
-    meta = {
-      description = "A CLI client and Python API library for the MailChimp email platform";
-      homepage = "http://apidocs.mailchimp.com/api/2.0/";
-      license = licenses.mit;
-    };
-  };
-
-  python-mapnik = buildPythonPackage rec {
-    name = "python-mapnik-${version}";
-    version = "3.0.16";
-
-    src = pkgs.fetchFromGitHub {
-      owner = "mapnik";
-      repo = "python-mapnik";
-      rev = "v${version}";
-      sha256 = "1gqs4kvmjawdgl80j0ab5r8y0va9kw0rvwix3093xsv4hwd00lcc";
-    };
-
-    disabled = isPyPy;
-    doCheck = false; # doesn't find needed test data files
-    preBuild = let
-      pythonVersion = with stdenv.lib.versions; "${major python.version}${minor python.version}";
-    in ''
-      export BOOST_PYTHON_LIB="boost_python${pythonVersion}"
-      export BOOST_THREAD_LIB="boost_thread"
-      export BOOST_SYSTEM_LIB="boost_system"
-    '';
-    buildInputs = with pkgs; [
-        (boost.override {
-          enablePython = true;
-          inherit python;
-        })
-        (mapnik.override {
-          inherit python;
-          boost = (boost.override { enablePython = true; inherit python; });
-        })
-        cairo
-        harfbuzz
-        icu
-        libjpeg
-        libpng
-        libtiff
-        libwebp
-        proj
-        zlib
-      ];
-    propagatedBuildInputs = with self; [ pillow pycairo ];
+  mailchimp = callPackage ../development/python-modules/mailchimp { };
 
-    meta = with stdenv.lib; {
-      description = "Python bindings for Mapnik";
-      homepage = http://mapnik.org;
-      license  = licenses.lgpl21;
-    };
-  };
+  python-mapnik = callPackage ../development/python-modules/python-mapnik { };
 
   misaka = callPackage ../development/python-modules/misaka {};
 
   mt-940 = callPackage ../development/python-modules/mt-940 { };
 
-  mwlib = let
-    pyparsing = buildPythonPackage rec {
-      name = "pyparsing-1.5.7";
-      disabled = isPy3k;
-
-      src = pkgs.fetchurl {
-        url = "mirror://pypi/p/pyparsing/${name}.tar.gz";
-        sha256 = "646e14f90b3689b005c19ac9b6b390c9a39bf976481849993e277d7380e6e79f";
-      };
-      meta = {
-        homepage = http://pyparsing.wikispaces.com/;
-        description = "An alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions";
-      };
-    };
-  in buildPythonPackage rec {
-    version = "0.15.15";
-    name = "mwlib-${version}";
-
-    src = pkgs.fetchurl {
-      url = "http://pypi.pediapress.com/packages/mirror/${name}.tar.gz";
-      sha256 = "1dnmnkc21zdfaypskbpvkwl0wpkpn0nagj1fc338w64mbxrk8ny7";
-    };
-
-    propagatedBuildInputs = with self; [
-        apipkg
-        bottle
-        gevent
-        lxml
-        odfpy
-        pillow
-        py
-        pyPdf
-        pyparsing
-        qserve
-        roman
-        simplejson
-        sqlite3dbm
-        timelib
-    ];
-
-    checkInputs = with self; [ pytest ];
-
-    checkPhase = ''
-      py.test
-    '';
-
-    # Tests are in build directory but we need extension modules that are in $out
-    doCheck = false;
+  mwlib = callPackage ../development/python-modules/mwlib { };
 
-    meta = {
-      description = "Library for parsing MediaWiki articles and converting them to different output formats";
-      homepage = "http://pediapress.com/code/";
-      license = licenses.bsd3;
-      broken = true; # Requires different versions of packages
-    };
-  };
+  mwlib-ext = callPackage ../development/python-modules/mwlib-ext { };
 
-  mwlib-ext = buildPythonPackage rec {
-    version = "0.13.2";
-    name = "mwlib.ext-${version}";
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "http://pypi.pediapress.com/packages/mirror/${name}.zip";
-      sha256 = "9229193ee719568d482192d9d913b3c4bb96af7c589d6c31ed4a62caf5054278";
-    };
-
-    meta = {
-      description = "Dependencies for mwlib markup";
-      homepage = "http://pediapress.com/code/";
-      license = licenses.bsd3;
-    };
-  };
-
-  mwlib-rl = buildPythonPackage rec {
-    version = "0.14.6";
-    name = "mwlib.rl-${version}";
-
-    src = pkgs.fetchurl {
-      url = "http://pypi.pediapress.com/packages/mirror/${name}.zip";
-      sha256 = "7f596fd60eb24d8d3da3ab4880f095294028880eafb653810a7bdaabdb031238";
-    };
-
-    buildInputs = with self;
-      [
-        mwlib
-        mwlib-ext
-        pygments
-      ];
-
-    meta = {
-      description = "Generate pdfs from mediawiki markup";
-      homepage = "http://pediapress.com/code/";
-      license = licenses.bsd3;
-    };
-  };
+  mwlib-rl = callPackage ../development/python-modules/mwlib-rl { };
 
   natsort = callPackage ../development/python-modules/natsort { };
 
@@ -3200,29 +1782,7 @@ in {
 
   logfury = callPackage ../development/python-modules/logfury { };
 
-  ndg-httpsclient = buildPythonPackage rec {
-    version = "0.4.2";
-    name = "ndg-httpsclient-${version}";
-
-    propagatedBuildInputs = with self; [ pyopenssl ];
-
-    src = pkgs.fetchFromGitHub {
-      owner = "cedadev";
-      repo = "ndg_httpsclient";
-      rev = version;
-      sha256 = "1kk4knv029j0cicfiv23c1rayc1n3f1j3rhl0527gxiv0qv4jw8h";
-    };
-
-    # uses networking
-    doCheck = false;
-
-    meta = {
-      homepage = https://github.com/cedadev/ndg_httpsclient/;
-      description = "Provide enhanced HTTPS support for httplib and urllib2 using PyOpenSSL";
-      license = licenses.bsd2;
-      maintainers = with maintainers; [ ];
-    };
-  };
+  ndg-httpsclient = callPackage ../development/python-modules/ndg-httpsclient { };
 
   netcdf4 = callPackage ../development/python-modules/netcdf4 { };
 
@@ -3230,60 +1790,13 @@ in {
 
   Nikola = callPackage ../development/python-modules/Nikola { };
 
-  nxt-python = buildPythonPackage rec {
-    version = "unstable-20160819";
-    pname = "nxt-python";
-    name = "${pname}-${version}";
-
-    propagatedBuildInputs = with self; [ pyusb pybluez pyfantom pkgs.git ];
-    disabled = isPy3k;
-
-    src = pkgs.fetchgit {
-      url = "http://github.com/Eelviny/nxt-python";
-      rev = "479e20b7491b28567035f4cee294c4a2af629297";
-      sha256 = "0mcsajhgm2wy4iy2lhmyi3xibgmbixbchanzmlhsxk6qyjccn9r9";
-      branchName= "pyusb";
-    };
-
-    # Tests fail on Mac dependency
-    doCheck = false;
-
-    meta = {
-      description = "Python driver/interface for Lego Mindstorms NXT robot";
-      homepage = https://github.com/Eelviny/nxt-python;
-      license = licenses.gpl3;
-      platforms = platforms.linux;
-      maintainers = with maintainers; [ leenaars ];
-    };
-  };
+  nxt-python = callPackage ../development/python-modules/nxt-python { };
 
   odfpy = callPackage ../development/python-modules/odfpy { };
 
   oset = callPackage ../development/python-modules/oset { };
 
-  pamela = buildPythonPackage rec {
-    name = "pamela-${version}";
-    version = "0.3.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pamela/${name}.tar.gz";
-      sha256 = "0ssxbqsshrm8p642g3h6wsq20z1fsqhpdvqdm827gn6dlr38868y";
-    };
-
-    postUnpack = ''
-      substituteInPlace $sourceRoot/pamela.py --replace \
-        'find_library("pam")' \
-        '"${getLib pkgs.pam}/lib/libpam.so"'
-    '';
-
-    doCheck = false;
-
-    meta = {
-      description = "PAM interface using ctypes";
-      homepage = "https://github.com/minrk/pamela";
-      license = licenses.mit;
-    };
-  };
+  pamela = callPackage ../development/python-modules/pamela { };
 
   # These used to be here but were moved to all-packages, but I'll leave them around for a while.
   pants = pkgs.pants;
@@ -3296,112 +1809,17 @@ in {
 
   pathspec = callPackage ../development/python-modules/pathspec { };
 
-  pathtools = buildPythonPackage rec {
-    name = "pathtools-${version}";
-    version = "0.1.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pathtools/${name}.tar.gz";
-      sha256 = "1h7iam33vwxk8bvslfj4qlsdprdnwf8bvzhqh3jq5frr391cadbw";
-    };
-
-    meta = {
-      description = "Pattern matching and various utilities for file systems paths";
-      homepage = https://github.com/gorakhargosh/pathtools;
-      license = licenses.mit;
-      maintainers = with maintainers; [ goibhniu ];
-    };
-  };
-
-  paver = buildPythonPackage rec {
-    version = "1.2.2";
-    name    = "Paver-${version}";
-
-    src = pkgs.fetchurl {
-      url    = "mirror://pypi/P/Paver/Paver-${version}.tar.gz";
-      sha256 = "0lix9d33ndb3yk56sm1zlj80fbmxp0w60yk0d9pr2xqxiwi88sqy";
-    };
+  pathtools = callPackage ../development/python-modules/pathtools { };
 
-    buildInputs = with self; [ cogapp mock virtualenv ];
-
-    propagatedBuildInputs = with self; [ nose ];
-
-    # the tests do not pass
-    doCheck = false;
-
-    meta = {
-      description = "A Python-based build/distribution/deployment scripting tool";
-      homepage    = https://github.com/paver/paver;
-      maintainers = with maintainers; [ lovek323 ];
-      platforms   = platforms.unix;
-    };
-  };
+  paver = callPackage ../development/python-modules/paver { };
 
   passlib = callPackage ../development/python-modules/passlib { };
 
-  path-and-address = buildPythonPackage rec {
-    version = "2.0.1";
-    name = "path-and-address-${version}";
-
-    buildInputs = with self; [ pytest ];
-
-    checkPhase = "py.test";
-
-    src = pkgs.fetchFromGitHub {
-      owner = "joeyespo";
-      repo = "path-and-address";
-      rev = "v${version}";
-      sha256 = "0b0afpsaim06mv3lhbpm8fmawcraggc11jhzr6h72kdj1cqjk5h6";
-    };
-
-    meta = {
-      description = "Functions for server CLI applications used by humans";
-      homepage = https://github.com/joeyespo/path-and-address;
-      license = licenses.mit;
-      maintainers = with maintainers; [ koral];
-    };
-  };
-
-  peewee =  callPackage ../development/python-modules/peewee { };
-
-  peppercorn = buildPythonPackage rec {
-    name = "peppercorn-0.5";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/peppercorn/${name}.tar.gz";
-      sha256 = "921cba5d51fa211e6da0fbd2120b9a98d663422a80f5bb669ad81ffb0909774b";
-    };
-
-    meta = {
-      maintainers = with maintainers; [ garbas domenkozar ];
-      platforms = platforms.all;
-    };
-  };
-
-  pex = buildPythonPackage rec {
-    name = "pex-${version}";
-    version = "1.2.7";
-
-    src = self.fetchPypi {
-      pname  = "pex";
-      sha256 = "1m0gx9182w1dybkyjwwjyd6i87x2dzv252ks2fj8yn6avlcp5z4q";
-      inherit version;
-    };
-
-    prePatch = ''
-      substituteInPlace setup.py --replace 'SETUPTOOLS_REQUIREMENT,' '"setuptools"'
-    '';
+  path-and-address = callPackage ../development/python-modules/path-and-address { };
 
-    # A few more dependencies I don't want to handle right now...
-    doCheck = false;
+  peppercorn = callPackage ../development/python-modules/peppercorn { };
 
-    meta = {
-      description = "A library and tool for generating .pex (Python EXecutable) files";
-      homepage = "https://github.com/pantsbuild/pex";
-      license = licenses.asl20;
-      maintainers = with maintainers; [ copumpkin ];
-    };
-  };
+  pex = callPackage ../development/python-modules/pex { };
 
   phe = callPackage ../development/python-modules/phe { };
 
@@ -3428,119 +1846,29 @@ in {
     inherit (pkgs.libsForQt5) poppler;
   };
 
-  poyo = buildPythonPackage rec {
-    version = "0.4.0";
-    name = "poyo-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/poyo/${name}.tar.gz";
-      sha256 = "1f48ffl0j1f2lmgabajps7v8w90ppxbp5168gh8kh27bjd8xk5ca";
-    };
-
-    meta = {
-      homepage = https://github.com/hackebrot/poyo;
-      description = "A lightweight YAML Parser for Python";
-      license = licenses.mit;
-    };
-  };
+  poyo = callPackage ../development/python-modules/poyo { };
 
   prov = callPackage ../development/python-modules/prov { };
 
-  pudb = buildPythonPackage rec {
-    name = "pudb-2016.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pudb/${name}.tar.gz";
-      sha256 = "0njhi49d9fxbwh5p8yjx8m3jlfyzfm00b5aff6bz473pn7vxfn79";
-    };
-
-    propagatedBuildInputs = with self; [ pygments urwid ];
-
-    # Tests fail on python 3 due to writes to the read-only home directory
-    doCheck = !isPy3k;
-
-    meta = {
-      description = "A full-screen, console-based Python debugger";
-      license = licenses.mit;
-      platforms = platforms.all;
-    };
-  };
+  pudb = callPackage ../development/python-modules/pudb { };
 
   pybtex = callPackage ../development/python-modules/pybtex {};
 
   pybtex-docutils = callPackage ../development/python-modules/pybtex-docutils {};
 
-  pycallgraph = buildPythonPackage rec {
-    name = "pycallgraph-${version}";
-    version = "1.0.1";
-
-    src = pkgs.fetchurl {
-      url = mirror://pypi/p/pycallgraph/pycallgraph-1.0.1.tar.gz;
-      sha256 = "0w8yr43scnckqcv5nbyd2dq4kpv74ai856lsdsf8iniik07jn9mi";
-    };
-
-    buildInputs = with self; [ pytest ];
-
-    # Tests do not work due to this bug: https://github.com/gak/pycallgraph/issues/118
-    doCheck = false;
-
-    meta = {
-      homepage = http://pycallgraph.slowchop.com;
-      description = "Call graph visualizations for Python applications";
-      maintainers = with maintainers; [ auntie ];
-      license = licenses.gpl2;
-      platforms = platforms.all;
-    };
-  };
+  pycallgraph = callPackage ../development/python-modules/pycallgraph { };
 
   pycassa = callPackage ../development/python-modules/pycassa { };
 
-  pyblake2 = callPackage ../development/python-modules/pyblake2 { };
-
-  pybluez = buildPythonPackage rec {
-    version = "unstable-20160819";
-    pname = "pybluez";
-    name = "${pname}-${version}";
-
-    propagatedBuildInputs = with self; [ pkgs.bluez ];
-
-    src = pkgs.fetchFromGitHub {
-      owner = "karulis";
-      repo = "${pname}";
-      rev = "a0b226a61b166e170d48539778525b31e47a4731";
-      sha256 = "104dm5ngfhqisv1aszdlr3szcav2g3bhsgzmg4qfs09b3i5zj047";
-    };
-
-    # the tests do not pass
-    doCheck = false;
-
-    meta = {
-      description = "Bluetooth Python extension module";
-      license = licenses.gpl2;
-      maintainers = with maintainers; [ leenaars ];
-    };
-  };
-
-  pycares = buildPythonPackage rec {
-    name = "pycares-${version}";
-    version = "1.0.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pycares/${name}.tar.gz";
-      sha256 = "a18341ea030e2cc0743acdf4aa72302bdf6b820938b36ce4bd76e43faa2276a3";
-    };
+  lirc = disabledIf isPy27 (toPythonModule (pkgs.lirc.override {
+    python3 = python;
+  }));
 
-    propagatedBuildInputs = [ pkgs.c-ares ];
+  pyblake2 = callPackage ../development/python-modules/pyblake2 { };
 
-    # No tests included
-    doCheck = false;
+  pybluez = callPackage ../development/python-modules/pybluez { };
 
-    meta = {
-      homepage = https://github.com/saghul/pycares;
-      description = "Interface for c-ares";
-      license = licenses.mit;
-    };
-  };
+  pycares = callPackage ../development/python-modules/pycares { };
 
   pycuda = callPackage ../development/python-modules/pycuda rec {
     cudatoolkit = pkgs.cudatoolkit_7_5;
@@ -3559,37 +1887,7 @@ in {
 
   pyphen = callPackage ../development/python-modules/pyphen {};
 
-  pypoppler = buildPythonPackage rec {
-    name = "pypoppler-${version}";
-    version = "0.12.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pypoppler/${name}.tar.gz";
-      sha256 = "47e6ac99e5b114b9abf2d1dd1bca06f22c028d025432512989f659142470810f";
-    };
-
-    NIX_CFLAGS_COMPILE="-I${pkgs.poppler.dev}/include/poppler/";
-    nativeBuildInputs = [ pkgs.pkgconfig ];
-    buildInputs = [ pkgs.poppler.dev ];
-    propagatedBuildInputs = with self; [ pycairo pygobject2 ];
-
-    patches = [
-      ../development/python-modules/pypoppler-0.39.0.patch
-      ../development/python-modules/pypoppler-poppler.c.patch
-    ];
-
-    # Not supported.
-    disabled = isPy3k;
-
-    # No tests in archive
-    doCheck = false;
-
-    meta = {
-      homepage = https://code.launchpad.net/~mriedesel/poppler-python/main;
-      description = "Python bindings for poppler-glib, unofficial branch including bug fixes, and removal of gtk dependencies";
-      license = licenses.gpl2;
-    };
-  };
+  pypoppler = callPackage ../development/python-modules/pypoppler { };
 
   pypillowfight = callPackage ../development/python-modules/pypillowfight { };
 
@@ -3601,149 +1899,17 @@ in {
 
   pythonix = toPythonModule (callPackage ../development/python-modules/pythonix { });
 
-  pyramid = buildPythonPackage rec {
-    pname = "pyramid";
-    version = "1.9.1";
-    name = "${pname}-${version}";
-
-    src = fetchPypi {
-      inherit pname version;
-      sha256 = "0dhbzc4q0vsnv3aihy728aczg56xs6h9s1rmvr096q4lb6yln3w4";
-    };
-
-    checkInputs = with self; [
-      docutils
-      virtualenv
-      webtest
-      zope_component
-    ];
-
-    propagatedBuildInputs = with self; [
-      hupper
-      PasteDeploy
-      plaster
-      plaster-pastedeploy
-      repoze_lru
-      repoze_sphinx_autointerface
-      translationstring
-      venusian
-      webob
-      zope_deprecation
-      zope_interface
-    ];
-
-    meta = {
-      maintainers = with maintainers; [ garbas domenkozar ];
-      platforms = platforms.all;
-    };
-
-    # Failing tests
-    # https://github.com/Pylons/pyramid/issues/1899
-    doCheck = !isPy35;
-
-  };
+  pyramid = callPackage ../development/python-modules/pyramid { };
 
   pyramid_beaker = callPackage ../development/python-modules/pyramid_beaker { };
 
-  pyramid_chameleon = buildPythonPackage rec {
-    name = "pyramid_chameleon-0.3";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pyramid_chameleon/${name}.tar.gz";
-      sha256 = "d176792a50eb015d7865b44bd9b24a7bd0489fa9a5cebbd17b9e05048cef9017";
-    };
-
-    propagatedBuildInputs = with self; [
-      chameleon
-      pyramid
-      zope_interface
-      setuptools
-    ];
-
-    meta = {
-      maintainers = with maintainers; [ domenkozar ];
-    };
-  };
+  pyramid_chameleon = callPackage ../development/python-modules/pyramid_chameleon { };
 
+  pyramid_jinja2 = callPackage ../development/python-modules/pyramid_jinja2 { };
 
-  pyramid_jinja2 = buildPythonPackage rec {
-    name = "pyramid_jinja2-${version}";
-    version = "2.5";
+  pyramid_mako = callPackage ../development/python-modules/pyramid_mako { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pyramid_jinja2/${name}.tar.gz";
-      sha256 = "93c86e3103b454301f4d66640191aba047f2ab85ba75647aa18667b7448396bd";
-    };
-
-    buildInputs = with self; [ webtest ];
-    propagatedBuildInputs = with self; [ jinja2 pyramid ];
-
-    meta = {
-      maintainers = with maintainers; [ domenkozar ];
-      platforms = platforms.all;
-    };
-  };
-
-
-  pyramid_mako = buildPythonPackage rec {
-    name = "pyramid_mako-0.3.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pyramid_mako/${name}.tar.gz";
-      sha256 = "00811djmsc4rz20kpy2paam05fbx6dmrv2i5jf90f6xp6zw4isy6";
-    };
-
-    buildInputs = with self; [ webtest ];
-    propagatedBuildInputs = with self; [ pyramid Mako ];
-  };
-
-
-  pyramid_exclog = buildPythonPackage rec {
-    name = "pyramid_exclog-0.7";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pyramid_exclog/${name}.tar.gz";
-      sha256 = "a58c82866c3e1a350684e6b83b440d5dc5e92ca5d23794b56d53aac06fb65a2c";
-    };
-
-    propagatedBuildInputs = with self; [ pyramid ];
-
-    meta = {
-      maintainers = with maintainers; [ garbas domenkozar ];
-      platforms = platforms.all;
-    };
-  };
-
-
-  pyramid_multiauth = buildPythonPackage rec {
-    name = "pyramid_multiauth-${version}";
-    version = "0.8.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pyramid_multiauth/${name}.tar.gz";
-      sha256 = "1lq292qakrm4ixi4vaif8dqywzj08pn6qy0wi4gw28blh39p0msk";
-    };
-
-    propagatedBuildInputs = with self; [ pyramid ];
-
-    meta = {
-      description = "Authentication policy for Pyramid that proxies to a stack of other authentication policies";
-      homepage = https://github.com/mozilla-services/pyramid_multiauth;
-    };
-  };
-
-  pyramid_hawkauth = buildPythonPackage rec {
-    name = "pyramidhawkauth-${version}";
-    version = "0.1.0";
-    src = pkgs.fetchgit {
-      url = https://github.com/mozilla-services/pyramid_hawkauth.git;
-      rev = "refs/tags/v${version}";
-      sha256 = "038ign7qlavlmvrhb2y8bygbxvy4j7bx2k1zg0i3wblg2ja50w7h";
-    };
-
-    propagatedBuildInputs = with self; [ pyramid hawkauthlib tokenlib ];
-    buildInputs = with self; [ webtest ];
-  };
+  peewee =  callPackage ../development/python-modules/peewee { };
 
   pyroute2 = callPackage ../development/python-modules/pyroute2 { };
 
@@ -3755,29 +1921,6 @@ in {
 
   pytools = callPackage ../development/python-modules/pytools { };
 
-  pytun = buildPythonPackage rec {
-    name = "pytun-${version}";
-    version = "2.2.1";
-    rev = "v${version}";
-
-    src = pkgs.fetchFromGitHub {
-      inherit rev;
-      owner = "montag451";
-      repo = "pytun";
-      sha256 = "1bxk0z0v8m0b01xg94f039j3bsclkshb7girvjqfzk5whbd2nryh";
-    };
-
-    doCheck = false;
-
-    meta = {
-      homepage = https://github.com/montag451/pytun;
-      description = "Linux TUN/TAP wrapper for Python";
-      license = licenses.mit;
-      maintainers = with maintainers; [ montag451 ];
-      platforms = platforms.linux;
-    };
-  };
-
   python-ctags3 = callPackage ../development/python-modules/python-ctags3 { };
 
   junos-eznc = callPackage ../development/python-modules/junos-eznc {};
@@ -3786,111 +1929,8 @@ in {
 
   rawkit = callPackage ../development/python-modules/rawkit { };
 
-  rethinkdb = buildPythonPackage rec {
-    name = "rethinkdb-${version}";
-    version = "2.3.0.post6";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/r/rethinkdb/${name}.tar.gz";
-      sha256 = "05qwkmq6kn437ywyjs02jxbry720gw39q4z4jdb0cnbbi76lwddm";
-    };
-
-    doCheck = false;
-
-    meta = {
-      description = "Python driver library for the RethinkDB database server";
-      homepage = "https://pypi.python.org/pypi/rethinkdb";
-      license = licenses.agpl3;
-    };
-  };
-
-  roman = buildPythonPackage rec {
-    version = "2.0.0";
-    name = "roman-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/r/roman/${name}.zip";
-      sha256 = "90e83b512b44dd7fc83d67eb45aa5eb707df623e6fc6e66e7f273abd4b2613ae";
-    };
-
-    buildInputs = with self; with pkgs; [ ];
-
-    propagatedBuildInputs = with self; [ ];
-
-    meta = {
-      description = "Integer to Roman numerals converter";
-      homepage = "https://pypi.python.org/pypi/roman";
-      license = licenses.psfl;
-    };
-  };
-
-
-
-  librosa = buildPythonPackage rec {
-    pname = "librosa";
-    name = "${pname}-${version}";
-    version = "0.4.3";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz";
-      sha256 = "209626c53556ca3922e52d2fae767bf5b398948c867fcc8898f948695dacb247";
-    };
-
-    propagatedBuildInputs = with self; [ joblib matplotlib six scikitlearn
-      decorator audioread resampy ];
-
-    # No tests
-    doCheck = false;
-
-    meta = {
-      description = "Python module for audio and music processing";
-      homepage = http://librosa.github.io/;
-      license = licenses.isc;
-    };
-  };
-
   joblib = callPackage ../development/python-modules/joblib { };
 
-  safe = buildPythonPackage rec {
-    version = "0.4";
-    name = "Safe-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/S/Safe/${name}.tar.gz";
-      sha256 = "a2fdac9fe8a9dcf02b438201d6ce0b7be78f85dc6492d03edfb89be2adf489de";
-    };
-
-    buildInputs = with self; [ nose ];
-    meta = {
-      homepage = "https://github.com/lepture/safe";
-      license = licenses.bsd3;
-      description = "Check password strength";
-    };
-  };
-
-  samplerate = buildPythonPackage rec {
-    name = "scikits.samplerate-${version}";
-    version = "0.3.3";
-    src = pkgs.fetchgit {
-      url = https://github.com/cournape/samplerate;
-      rev = "a536c97eb2d6195b5f266ea3cc3a35364c4c2210";
-      sha256 = "0mgic7bs5zv5ji05vr527jlxxlb70f9dg93hy1lzyz2plm1kf7gg";
-    };
-
-    buildInputs = with self;  [ pkgs.libsamplerate ];
-
-    propagatedBuildInputs = with self; [ numpy ];
-
-    preConfigure = ''
-       cat > site.cfg << END
-       [samplerate]
-       library_dirs=${pkgs.libsamplerate.out}/lib
-       include_dirs=${pkgs.libsamplerate.dev}/include
-       END
-    '';
-
-    doCheck = false;
-  };
-
   sarge = callPackage ../development/python-modules/sarge { };
 
   subliminal = callPackage ../development/python-modules/subliminal {};
@@ -3899,98 +1939,14 @@ in {
 
   zope_copy = callPackage ../development/python-modules/zope_copy {};
 
-  ssdeep = buildPythonPackage rec {
-    name = "ssdeep-3.1.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/s/ssdeep/${name}.tar.gz";
-      sha256 = "1p9dpykmnfb73cszdiic5wbz5bmbbmkiih08pb4dah5mwq4n7im6";
-    };
-
-    buildInputs = with pkgs; [ ssdeep ];
-    propagatedBuildInputs = with self; [ cffi six ];
-    meta.broken = true; # Tests fail, and no reverse-dependencies anyway
-  };
-
   s2clientprotocol = callPackage ../development/python-modules/s2clientprotocol { };
 
-  statsd = buildPythonPackage rec {
-    name = "statsd-${version}";
-    version = "3.2.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/s/statsd/${name}.tar.gz";
-      sha256 = "3fa92bf0192af926f7a0d9be031fe3fd0fbaa1992d42cf2f07e68f76ac18288e";
-    };
-
-    buildInputs = with self; [ nose mock ];
-
-    meta = {
-      maintainers = with maintainers; [ domenkozar ];
-      description = "A simple statsd client";
-      license = licenses.mit;
-      homepage = https://github.com/jsocol/pystatsd;
-    };
-
-    patchPhase = ''
-      # Failing test: ERROR: statsd.tests.test_ipv6_resolution_udp
-      sed -i 's/test_ipv6_resolution_udp/noop/' statsd/tests.py
-      # well this is a noop, but so it was before
-      sed -i 's/assert_called_once()/called/' statsd/tests.py
-    '';
-
-  };
-
   py3status = callPackage ../development/python-modules/py3status {};
 
-  multi_key_dict = buildPythonPackage rec {
-    name = "multi_key_dict-${version}";
-    version = "2.0.3";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/multi_key_dict/multi_key_dict-${version}.tar.gz";
-      sha256 = "17lkx4rf4waglwbhc31aak0f28c63zl3gx5k5i1iq2m3gb0xxsyy";
-    };
-
-    meta = with stdenv.lib; {
-      description = "multi_key_dict";
-      homepage = "https://github.com/formiaczek/multi_key_dict";
-    };
-  };
-
-
   pyrtlsdr = callPackage ../development/python-modules/pyrtlsdr { };
 
-  random2 = self.buildPythonPackage rec {
-    name = "random2-1.0.1";
-
-    doCheck = !isPyPy;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/r/random2/${name}.zip";
-      sha256 = "34ad30aac341039872401595df9ab2c9dc36d0b7c077db1cea9ade430ed1c007";
-    };
-  };
-
   scandir = callPackage ../development/python-modules/scandir { };
 
-  schedule = buildPythonPackage rec {
-    name = "schedule-0.3.2";
-
-    src = pkgs.fetchurl {
-      url = "https://pypi.python.org/packages/10/96/d101fab391753ebc81fa3bb0e744df1ddcfb032c31b036d38083f8994db1/schedule-0.3.2.tar.gz";
-      sha256 = "1h0waw4jd5ql68y5kxb9irwapkbkwfs1w0asvbl24fq5f8czdijm";
-    };
-
-    buildInputs = with self; [ mock ];
-
-    meta = with stdenv.lib; {
-      description = "Python job scheduling for humans";
-      homepage = https://github.com/dbader/schedule;
-      license = licenses.mit;
-    };
-  };
-
   schema = callPackage ../development/python-modules/schema {};
 
   simple-websocket-server = callPackage ../development/python-modules/simple-websocket-server {};
@@ -4003,206 +1959,63 @@ in {
 
   ratelimiter = callPackage ../development/python-modules/ratelimiter { };
 
-  repoze_lru = buildPythonPackage rec {
-    name = "repoze.lru-0.6";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/r/repoze.lru/${name}.tar.gz";
-      sha256 = "0f7a323bf716d3cb6cb3910cd4fccbee0b3d3793322738566ecce163b01bbd31";
-    };
-
-    meta = {
-      maintainers = with maintainers; [ garbas domenkozar ];
-      platforms = platforms.all;
-    };
-  };
-
-  repoze_sphinx_autointerface = buildPythonPackage rec {
-    name = "repoze.sphinx.autointerface-0.7.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/r/repoze.sphinx.autointerface/${name}.tar.gz";
-      sha256 = "97ef5fac0ab0a96f1578017f04aea448651fa9f063fc43393a8253bff8d8d504";
-    };
-
-    propagatedBuildInputs = with self; [ zope_interface sphinx ];
-
-    meta = {
-      maintainers = with maintainers; [ domenkozar ];
-      platforms = platforms.all;
-    };
-  };
-
-
-  setuptools-git = buildPythonPackage rec {
-    name = "setuptools-git-${version}";
-    version = "1.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/s/setuptools-git/${name}.tar.gz";
-      sha256 = "047d7595546635edebef226bc566579d422ccc48a8a91c7d32d8bd174f68f831";
-    };
-
-    propagatedBuildInputs = [ pkgs.git ];
-    doCheck = false;
-
-    meta = {
-      description = "Setuptools revision control system plugin for Git";
-      homepage = https://pypi.python.org/pypi/setuptools-git;
-      license = licenses.bsd3;
-    };
-  };
-
-
-  watchdog = buildPythonPackage rec {
-    name = "watchdog-${version}";
-    version = "0.8.3";
-
-    propagatedBuildInputs = with self; [ argh pathtools pyyaml ];
-
-    buildInputs = stdenv.lib.optionals stdenv.isDarwin
-      [ pkgs.darwin.apple_sdk.frameworks.CoreServices pkgs.darwin.cf-private ];
-
-    doCheck = false;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/w/watchdog/${name}.tar.gz";
-      sha256 = "0qj1vqszxwfx6d1s66s96jmfmy2j94bywxiqdydh6ikpvcm8hrby";
-    };
-
-    meta = {
-      description = "Python API and shell utilities to monitor file system events";
-      homepage = https://github.com/gorakhargosh/watchdog;
-      license = licenses.asl20;
-      maintainers = with maintainers; [ goibhniu ];
-    };
-  };
-
   pywatchman = callPackage ../development/python-modules/pywatchman { };
 
   pywavelets = callPackage ../development/python-modules/pywavelets { };
 
-  zope_deprecation = buildPythonPackage rec {
-    name = "zope.deprecation-4.1.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/z/zope.deprecation/${name}.tar.gz";
-      sha256 = "fed622b51ffc600c13cc5a5b6916b8514c115f34f7ea2730409f30c061eb0b78";
-    };
-
-    buildInputs = with self; [ zope_testing ];
-
-    meta = {
-      maintainers = with maintainers; [ garbas domenkozar ];
-      platforms = platforms.all;
-    };
-  };
-
-  validictory = buildPythonPackage rec {
-    name = "validictory-1.0.0a2";
+  vcrpy = callPackage ../development/python-modules/vcrpy { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/v/validictory/validictory-1.0.0a2.tar.gz";
-      sha256 = "c02388a70f5b854e71e2e09bd6d762a2d8c2a017557562e866d8ffafb0934b07";
-    };
+  descartes = callPackage ../development/python-modules/descartes { };
 
-    doCheck = false;
+  chardet = callPackage ../development/python-modules/chardet { };
 
-    meta = {
-      description = "Validate dicts against a schema";
-      homepage = https://github.com/sunlightlabs/validictory;
-      license = licenses.mit;
-    };
-  };
+  pyramid_exclog = callPackage ../development/python-modules/pyramid_exclog { };
 
-  vcrpy = callPackage ../development/python-modules/vcrpy { };
+  pyramid_multiauth = callPackage ../development/python-modules/pyramid_multiauth { };
 
-  venusian = buildPythonPackage rec {
-    name = "venusian-1.0";
+  pyramid_hawkauth = callPackage ../development/python-modules/pyramid_hawkauth { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/v/venusian/${name}.tar.gz";
-      sha256 = "1720cff2ca9c369c840c1d685a7c7a21da1afa687bfe62edd93cae4bf429ca5a";
-    };
+  pytun = callPackage ../development/python-modules/pytun { };
 
-    # TODO: https://github.com/Pylons/venusian/issues/23
-    doCheck = false;
+  rethinkdb = callPackage ../development/python-modules/rethinkdb { };
 
-    meta = {
-      maintainers = with maintainers; [ garbas domenkozar ];
-      platforms = platforms.all;
-    };
-  };
+  roman = callPackage ../development/python-modules/roman { };
 
+  librosa = callPackage ../development/python-modules/librosa { };
 
-  chameleon = buildPythonPackage rec {
-    name = "Chameleon-2.25";
+  samplerate = callPackage ../development/python-modules/samplerate { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/C/Chameleon/${name}.tar.gz";
-      sha256 = "0va95cml7wfjpvgj3dc9xdn8psyjh3zbk6v51b0hcqv2fzh409vb";
-    } ;
+  ssdeep = callPackage ../development/python-modules/ssdeep { };
 
-    meta = {
-      maintainers = with maintainers; [ garbas domenkozar ];
-    };
-  };
+  statsd = callPackage ../development/python-modules/statsd { };
 
-  ddt = buildPythonPackage (rec {
-    name = "ddt-1.0.0";
+  multi_key_dict = callPackage ../development/python-modules/multi_key_dict { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/ddt/${name}.tar.gz";
-      sha256 = "e24ecb7e2cf0bf43fa9d4255d3ae2bd0b7ce30b1d1b89ace7aa68aca1152f37a";
-    };
+  random2 = callPackage ../development/python-modules/random2 { };
 
-    meta = {
-      description = "Data-Driven/Decorated Tests, a library to multiply test cases";
+  schedule = callPackage ../development/python-modules/schedule { };
 
-      homepage = https://github.com/txels/ddt;
+  repoze_lru = callPackage ../development/python-modules/repoze_lru { };
 
-      license = licenses.mit;
-    };
-  });
+  repoze_sphinx_autointerface =  callPackage ../development/python-modules/repoze_sphinx_autointerface { };
 
-  descartes = callPackage ../development/python-modules/descartes { };
+  setuptools-git = callPackage ../development/python-modules/setuptools-git { };
 
-  distutils_extra = buildPythonPackage rec {
-    name = "distutils-extra-${version}";
-    version = "2.39";
+  watchdog = callPackage ../development/python-modules/watchdog { };
 
-    src = pkgs.fetchurl {
-      url = "http://launchpad.net/python-distutils-extra/trunk/${version}/+download/python-${name}.tar.gz";
-      sha256 = "1bv3h2p9ffbzyddhi5sccsfwrm3i6yxzn0m06fdxkj2zsvs28gvj";
-    };
+  zope_deprecation = callPackage ../development/python-modules/zope_deprecation { };
 
-    meta = {
-      homepage = https://launchpad.net/python-distutils-extra;
-      description = "Enhancements to Python's distutils";
-      license = licenses.gpl2;
-    };
-  };
+  validictory = callPackage ../development/python-modules/validictory { };
 
-  pyxdg = buildPythonPackage rec {
-    name = "pyxdg-0.25";
+  venusian = callPackage ../development/python-modules/venusian { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pyxdg/${name}.tar.gz";
-      sha256 = "81e883e0b9517d624e8b0499eb267b82a815c0b7146d5269f364988ae031279d";
-    };
+  chameleon = callPackage ../development/python-modules/chameleon { };
 
-    # error: invalid command 'test'
-    doCheck = false;
+  ddt = callPackage ../development/python-modules/ddt { };
 
-    meta = {
-      homepage = http://freedesktop.org/wiki/Software/pyxdg;
-      description = "Contains implementations of freedesktop.org standards";
-      license = licenses.lgpl2;
-      maintainers = with maintainers; [ domenkozar ];
-    };
-  };
+  distutils_extra = callPackage ../development/python-modules/distutils_extra { };
 
-  chardet = callPackage ../development/python-modules/chardet { };
+  pyxdg = callPackage ../development/python-modules/pyxdg { };
 
   crayons = callPackage ../development/python-modules/crayons{ };
 
@@ -4220,96 +2033,23 @@ in {
     gdal = self.gdal;
   };
 
-  django_1_8 = buildPythonPackage rec {
-    name = "Django-${version}";
-    version = "1.8.18";
-    disabled = pythonOlder "2.7";
-
-    src = pkgs.fetchurl {
-      url = "http://www.djangoproject.com/m/releases/1.8/${name}.tar.gz";
-      sha256 = "1ishvbihr9pain0486qafb18dnb7v2ppq34nnx1s8f95bvfiqqf7";
-    };
-
-    # too complicated to setup
-    doCheck = false;
-
-    # patch only $out/bin to avoid problems with starter templates (see #3134)
-    postFixup = ''
-      wrapPythonProgramsIn $out/bin "$out $pythonPath"
-    '';
-
-    meta = {
-      description = "A high-level Python Web framework";
-      homepage = https://www.djangoproject.com/;
-    };
-  };
+  django_1_8 = callPackage ../development/python-modules/django/1_8.nix { };
 
   django-allauth = callPackage ../development/python-modules/django-allauth { };
 
   django_appconf = callPackage ../development/python-modules/django_appconf { };
 
-  django_colorful = buildPythonPackage rec {
-    name = "django-colorful-${version}";
-    version = "1.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/django-colorful/${name}.tar.gz";
-      sha256 = "0y34hzvfrm1xbxrd8frybc9yzgqvz4c07frafipjikw7kfjsw8az";
-    };
-
-    # Tests aren't run
-    doCheck = false;
-
-    # Requires Django >= 1.8
-    buildInputs = with self; [ django ];
-
-    meta = {
-      description = "Django extension that provides database and form color fields";
-      homepage = https://github.com/charettes/django-colorful;
-      license = licenses.mit;
-    };
-  };
+  django_colorful = callPackage ../development/python-modules/django_colorful { };
 
   django_compressor = callPackage ../development/python-modules/django_compressor { };
 
   django_compat = callPackage ../development/python-modules/django-compat { };
 
-  django_environ = buildPythonPackage rec {
-    name = "django-environ-${version}";
-    version = "0.4.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/django-environ/${name}.tar.gz";
-      sha256 = "0i32vsgk1xmwpi7i6f6v5hg653y9dl0fsz5qmv94skz6hwgm5kvh";
-    };
-
-    # The testsuite fails to modify the base environment
-    doCheck = false;
-    propagatedBuildInputs = with self ; [ django six ];
+  django_contrib_comments = callPackage ../development/python-modules/django_contrib_comments { };
 
-    meta = {
-      description = "Utilize environment variables to configure your Django application";
-      homepage = https://github.com/joke2k/django-environ/;
-      license = licenses.mit;
-    };
-  };
-
-  django_evolution = buildPythonPackage rec {
-    name = "django_evolution-0.7.5";
-    disabled = isPy3k;
+  django_environ = callPackage ../development/python-modules/django_environ { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/django_evolution/${name}.tar.gz";
-      sha256 = "1qbcx54hq8iy3n2n6cki3bka1m9rp39np4hqddrm9knc954fb7nv";
-    };
-
-    propagatedBuildInputs = with self; [ django ];
-
-    meta = {
-      description = "A database schema evolution tool for the Django web framework";
-      homepage = http://code.google.com/p/django-evolution/;
-    };
-  };
+  django_evolution = callPackage ../development/python-modules/django_evolution { };
 
   django_extensions = callPackage ../development/python-modules/django-extensions { };
 
@@ -4349,26 +2089,7 @@ in {
     propagatedBuildInputs = with self; [ django ];
   });
 
-  django_classytags = buildPythonPackage rec {
-    name = "django-classy-tags-${version}";
-    version = "0.6.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/django-classy-tags/${name}.tar.gz";
-      sha256 = "0wxvpmjdzk0aajk33y4himn3wqjx7k0aqlka9j8ay3yfav78bdq0";
-    };
-
-    propagatedBuildInputs = with self; [ django ];
-
-    # tests appear to be broken on 0.6.1 at least
-    doCheck = ( version != "0.6.1" );
-
-    meta = {
-      description = "Class based template tags for Django";
-      homepage = https://github.com/ojii/django-classy-tags;
-      license = licenses.bsd3;
-    };
-  };
+  django_classytags = callPackage ../development/python-modules/django_classytags { };
 
   # This package may need an older version of Django.
   # Override the package set and set e.g. `django = super.django_1_9`.
@@ -4377,47 +2098,9 @@ in {
 
   django_hijack_admin = callPackage ../development/python-modules/django-hijack-admin { };
 
-  django_nose = buildPythonPackage rec {
-    name = "django-nose-${version}";
-    version = "1.4.4";
+  django_nose = callPackage ../development/python-modules/django_nose { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/django-nose/${name}.tar.gz";
-      sha256 = "1fm47fkza2lk0xgc6qpi9vs78zg7q8cgl6mdan69sbycgy909ff0";
-    };
-
-    # vast dependency list
-    doCheck = false;
-
-    propagatedBuildInputs = with self; [ django nose ];
-
-    meta = {
-      description = "Provides all the goodness of nose in your Django tests";
-      homepage = https://github.com/django-nose/django-nose;
-      license = licenses.bsd3;
-    };
-  };
-
-  django_modelcluster = buildPythonPackage rec {
-    name = "django-modelcluster-${version}";
-    version = "0.6.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/django-modelcluster/django-modelcluster-${version}.tar.gz";
-      sha256 = "1plsdi44dvsj2sfx79lsrccjfg0ymajcsf5n0mln4cwd4qi5mwpx";
-    };
-
-    doCheck = false;
-
-    propagatedBuildInputs = with self; [ pytz six ];
-
-    meta = {
-      description = "Django extension to allow working with 'clusters' of models as a single unit, independently of the database";
-      homepage = https://github.com/torchbox/django-modelcluster/;
-      license = licenses.bsd2;
-      maintainers = with maintainers; [ desiderius ];
-    };
-  };
+  django_modelcluster = callPackage ../development/python-modules/django_modelcluster { };
 
   djangorestframework = callPackage ../development/python-modules/djangorestframework { };
 
@@ -4425,96 +2108,13 @@ in {
 
   django_redis = callPackage ../development/python-modules/django_redis { };
 
-  django_reversion = buildPythonPackage rec {
-    name = "django-reversion-${version}";
-    version = "1.10.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/django-reversion/${name}.tar.gz";
-      sha256 = "01iv8w6lmmq98qjhxmnp8ddjxifmhxcmp612ijd91wc8nv8lk12w";
-    };
-
-    propagatedBuildInputs = with self; [ django ];
-
-    meta = {
-      description = "An extension to the Django web framework that provides comprehensive version control facilities";
-      homepage = https://github.com/etianen/django-reversion;
-      license = licenses.bsd3;
-    };
-  };
-
-  django_silk = buildPythonPackage rec {
-    name = "django-silk-${version}";
-    version = "0.5.6";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/django-silk/${name}.tar.gz";
-      sha256 = "845abc688738858ce06e993c4b7dbbcfcecf33029e828f143463ff96f9a78947";
-    };
-
-    doCheck = false;
-
-    buildInputs = [ self.mock ];
-
-    propagatedBuildInputs = with self; [
-      django
-      pygments
-      simplejson
-      dateutil
-      requests
-      sqlparse
-      jinja2
-      autopep8
-      pytz
-      pillow
-    ];
-
-    meta = {
-      description = "Silky smooth profiling for the Django Framework";
-      homepage = https://github.com/mtford90/silk;
-      license = licenses.mit;
-    };
-  };
-
-  django_taggit = buildPythonPackage rec {
-    name = "django-taggit-${version}";
-    version = "0.17.0";
-    disabled = pythonOlder "2.7";
+  django_reversion = callPackage ../development/python-modules/django_reversion { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/django-taggit/django-taggit-${version}.tar.gz";
-      sha256 = "1xy4mm1y6z6bpakw907859wz7fiw7jfm586dj89w0ggdqlb0767b";
-    };
+  django_silk = callPackage ../development/python-modules/django_silk { };
 
-    doCheck = false;
+  django_taggit = callPackage ../development/python-modules/django_taggit { };
 
-    meta = {
-      description = "django-taggit is a reusable Django application for simple tagging";
-      homepage = https://github.com/alex/django-taggit/tree/master/;
-      license = licenses.bsd2;
-      maintainers = with maintainers; [ desiderius ];
-    };
-  };
-
-  django_treebeard = buildPythonPackage rec {
-    name = "django-treebeard-${version}";
-    version = "3.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/django-treebeard/${name}.tar.gz";
-      sha256 = "10p9rb2m1zccszg7590fjd0in6rabzsh86f5m7qm369mapc3b6dc";
-    };
-
-    buildInputs = with self; [ pytest ];
-    propagatedBuildInputs = with self; [ django ];
-
-    meta = {
-      description = "Efficient tree implementations for Django 1.6+";
-      homepage = https://tabo.pe/projects/django-treebeard/;
-      maintainers = with maintainers; [ desiderius ];
-      license = licenses.asl20;
-    };
-  };
+  django_treebeard = callPackage ../development/python-modules/django_treebeard { };
 
   django_pipeline = callPackage ../development/python-modules/django-pipeline { };
 
@@ -4522,304 +2122,43 @@ in {
 
   djmail = callPackage ../development/python-modules/djmail { };
 
-  pillowfight = buildPythonPackage rec {
-    name = "pillowfight-${version}";
-    version = "0.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pillowfight/pillowfight-${version}.tar.gz";
-      sha256 = "1mh1nhcjjgv7x134sv0krri59ng8bp2w6cwsxc698rixba9f3g0m";
-    };
-
-    propagatedBuildInputs = with self; [
-      pillow
-    ];
-    meta = with stdenv.lib; {
-      description = "Pillow Fight";
-      homepage = "https://github.com/beanbaginc/pillowfight";
-    };
-  };
+  pillowfight = callPackage ../development/python-modules/pillowfight { };
 
-  kaptan = buildPythonPackage rec {
-    name = "kaptan-${version}";
-    version = "0.5.8";
+  kaptan = callPackage ../development/python-modules/kaptan { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/k/kaptan/${name}.tar.gz";
-      sha256 = "1b8r86yyvdvyxd6f10mhkl6cr2jhxm80jjqr4zch96w9hs9rh5vq";
-    };
-
-    propagatedBuildInputs = with self; [ pyyaml ];
-
-    meta = with stdenv.lib; {
-      description = "Configuration manager for python applications";
-      homepage = https://emre.github.io/kaptan/;
-      license = licenses.bsd3;
-      platforms = platforms.linux;
-      maintainers = with maintainers; [ jgeerds ];
-    };
-  };
-
-  keepalive = buildPythonPackage rec {
-    name = "keepalive-${version}";
-    version = "0.5";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/k/keepalive/keepalive-${version}.tar.gz";
-      sha256 = "3c6b96f9062a5a76022f0c9d41e9ef5552d80b1cadd4fccc1bf8f183ba1d1ec1";
-    };
-
-    # No tests included
-    doCheck = false;
-
-    meta = with stdenv.lib; {
-      description = "An HTTP handler for `urllib2` that supports HTTP 1.1 and keepalive";
-      homepage = "https://github.com/wikier/keepalive";
-    };
-  };
+  keepalive = callPackage ../development/python-modules/keepalive { };
 
   keyrings-alt = callPackage ../development/python-modules/keyrings-alt {};
 
-  SPARQLWrapper = buildPythonPackage rec {
-    name = "SPARQLWrapper-${version}";
-    version = "1.7.6";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/S/SPARQLWrapper/SPARQLWrapper-${version}.tar.gz";
-      sha256 = "1y12hpsfjd779yi29bhvl6g4vszadjvd8jw38z5rg77b034vxjnw";
-    };
-
-    # break circular dependency loop
-    patchPhase = ''
-      sed -i '/rdflib/d' requirements.txt
-    '';
-
-    # Doesn't actually run tests
-    doCheck = false;
-
-    propagatedBuildInputs = with self; [
-      six isodate pyparsing html5lib keepalive
-    ];
-
-    meta = with stdenv.lib; {
-      description = "This is a wrapper around a SPARQL service. It helps in creating the query URI and, possibly, convert the result into a more manageable format";
-      homepage = "http://rdflib.github.io/sparqlwrapper";
-    };
-  };
+  SPARQLWrapper = callPackage ../development/python-modules/sparqlwrapper { };
 
   dulwich = callPackage ../development/python-modules/dulwich {
     inherit (pkgs) git glibcLocales;
   };
 
-  hg-git = buildPythonPackage rec {
-    name = "hg-git-${version}";
-    version = "0.8.11";
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/hg-git/${name}.tar.gz";
-      sha256 = "08kw1sj3sq1q1571hwkc51w20ks9ysmlg93pcnmd6gr66bz02dyn";
-    };
-
-    propagatedBuildInputs = with self; [ dulwich ];
-
-    meta = {
-      description = "Push and pull from a Git server using Mercurial";
-      homepage = http://hg-git.github.com/;
-      maintainers = with maintainers; [ koral ];
-      license = stdenv.lib.licenses.gpl2;
-    };
-  };
-
-  dtopt = buildPythonPackage rec {
-    name = "dtopt-0.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/dtopt/${name}.tar.gz";
-      sha256 = "06ae07a12294a7ba708abaa63f838017d1a2faf6147a1e7a14ca4fa28f86da7f";
-    };
-
-    meta = {
-      description = "Add options to doctest examples while they are running";
-      homepage = https://pypi.python.org/pypi/dtopt;
-    };
-    # Test contain Python 2 print
-    disabled = isPy3k;
-  };
-
-
-  ecdsa = buildPythonPackage rec {
-    name = "ecdsa-${version}";
-    version = "0.13";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/e/ecdsa/${name}.tar.gz";
-      sha256 = "1yj31j0asmrx4an9xvsaj2icdmzy6pw0glfpqrrkrphwdpi1xkv4";
-    };
+  hg-git = callPackage ../development/python-modules/hg-git { };
 
-    # Only needed for tests
-    buildInputs = with self; [ pkgs.openssl ];
+  dtopt = callPackage ../development/python-modules/dtopt { };
 
-    meta = {
-      description = "ECDSA cryptographic signature library";
-      homepage = "https://github.com/warner/python-ecdsa";
-      license = licenses.mit;
-      maintainers = with maintainers; [ aszlig ];
-    };
-  };
+  ecdsa = callPackage ../development/python-modules/ecdsa { };
 
   effect = callPackage ../development/python-modules/effect {};
 
-  elpy = buildPythonPackage rec {
-    name = "elpy-${version}";
-    version = "1.9.0";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/e/elpy/${name}.tar.gz";
-      sha256 = "419f7b05b19182bc1aedde1ae80812c1534e59a0493476aa01ea819e76ba26f0";
-    };
-    python2Deps = if isPy3k then [ ] else [ self.rope ];
-    propagatedBuildInputs = with self; [ flake8 autopep8 jedi importmagic ] ++ python2Deps;
-
-    doCheck = false; # there are no tests
-
-    meta = {
-      description = "Backend for the elpy Emacs mode";
-      homepage = "https://github.com/jorgenschaefer/elpy";
-    };
-  };
-
-
-  enum = buildPythonPackage rec {
-    name = "enum-0.4.4";
-    disabled = isPy3k;
+  elpy = callPackage ../development/python-modules/elpy { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/e/enum/${name}.tar.gz";
-      sha256 = "9bdfacf543baf2350df7613eb37f598a802f346985ca0dc1548be6494140fdff";
-    };
-
-    doCheck = !isPyPy;
-
-    buildInputs = with self; [ ];
-
-    propagatedBuildInputs = with self; [ ];
-
-    meta = {
-      homepage = https://pypi.python.org/pypi/enum/;
-      description = "Robust enumerated type support in Python";
-    };
-  };
+  enum = callPackage ../development/python-modules/enum { };
 
   enum-compat = callPackage ../development/python-modules/enum-compat { };
 
-  enum34 = if pythonAtLeast "3.4" then null else buildPythonPackage rec {
-    pname = "enum34";
-    version = "1.1.6";
-    name = "${pname}-${version}";
-
-    src = fetchPypi {
-      inherit pname version;
-      sha256 = "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1";
-    };
-
-    checkPhase = ''
-      ${python.interpreter} -m unittest discover
-    '';
-
-
-    meta = {
-      homepage = https://pypi.python.org/pypi/enum34;
-      description = "Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4";
-      license = "BSD";
-    };
-  };
-
-  epc = buildPythonPackage rec {
-    name = "epc-0.0.3";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/e/epc/${name}.tar.gz";
-      sha256 = "30b594bd4a4acbd5bda0d3fa3d25b4e8117f2ff8f24d2d1e3e36c90374f3c55e";
-    };
-
-    propagatedBuildInputs = with self; [ sexpdata ];
-    doCheck = false;
-
-    meta = {
-      description = "EPC (RPC stack for Emacs Lisp) implementation in Python";
-      homepage = "https://github.com/tkf/python-epc";
-    };
-  };
-
-  et_xmlfile = buildPythonPackage rec {
-    version = "1.0.1";
-    name = "et_xmlfile-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/e/et_xmlfile/${name}.tar.gz";
-      sha256="0nrkhcb6jdrlb6pwkvd4rycw34y3s931hjf409ij9xkjsli9fkb1";
-    };
-
-    buildInputs = with self; [ lxml pytest ];
-    checkPhase = ''
-      py.test $out
-    '';
-
-    meta = {
-      description = "An implementation of lxml.xmlfile for the standard library";
-      longDescription = ''
-        et_xmlfile is a low memory library for creating large XML files.
-
-        It is based upon the xmlfile module from lxml with the aim of allowing
-        code to be developed that will work with both libraries. It was developed
-        initially for the openpyxl project but is now a standalone module.
-
-        The code was written by Elias Rabel as part of the Python Düsseldorf
-        openpyxl sprint in September 2014.
-      '';
-      homepage = "https://pypi.python.org/pypi/et_xmlfile";
-      license = licenses.mit;
-      maintainers = with maintainers; [ sjourdois ];
-    };
-  };
-
-  eventlet = buildPythonPackage rec {
-    pname = "eventlet";
-    version = "0.20.0";
-    name = "${pname}-${version}";
-
-    src = fetchPypi {
-      inherit pname version;
-      sha256 = "15bq5ybbigxnp5xwkps53zyhlg15lmcnq3ny2dppj0r0bylcs5rf";
-    };
-
-    buildInputs = with self; [ nose httplib2 pyopenssl  ];
+  enum34 = callPackage ../development/python-modules/enum34 { };
 
-    doCheck = false;  # too much transient errors to bother
+  epc = callPackage ../development/python-modules/epc { };
 
-    propagatedBuildInputs = optionals (!isPyPy) [ self.greenlet ] ++
-      (with self; [ enum-compat ]) ;
+  et_xmlfile = callPackage ../development/python-modules/et_xmlfile { };
 
-    meta = {
-      homepage = https://pypi.python.org/pypi/eventlet/;
-      description = "A concurrent networking library for Python";
-    };
-  };
+  eventlet = callPackage ../development/python-modules/eventlet { };
 
-  exifread = buildPythonPackage rec {
-    name = "ExifRead-2.1.2";
-
-    meta = {
-      description = "Easy to use Python module to extract Exif metadata from tiff and jpeg files";
-      homepage    = "https://github.com/ianare/exif-py";
-      license     = "BSD";
-      maintainers = with maintainers; [ vozz ];
-    };
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/E/ExifRead/${name}.tar.gz";
-      sha256 = "1b90jf6m9vxh9nanhpyvqdq7hmfx5iggw1l8kq10jrs6xgr49qkr";
-    };
-  };
+  exifread = callPackage ../development/python-modules/exifread { };
 
   fastimport = callPackage ../development/python-modules/fastimport { };
 
@@ -4833,117 +2172,21 @@ in {
     inherit (pkgs) glibcLocales;
   };
 
-  feedparser = buildPythonPackage (rec {
-    name = "feedparser-5.2.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/feedparser/${name}.tar.gz";
-      sha256 = "1ycva69bqssalhqg45rbrfipz3l6hmycszy26k0351fhq990c0xx";
-    };
-
-    # lots of networking failures
-    doCheck = false;
-
-    meta = {
-      homepage = http://code.google.com/p/feedparser/;
-      description = "Universal feed parser";
-      license = licenses.bsd2;
-      maintainers = with maintainers; [ domenkozar ];
-    };
-  });
-
-  pyfribidi = buildPythonPackage rec {
-    version = "0.11.0";
-    name = "pyfribidi-${version}";
-    disabled = isPy3k || isPyPy;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pyfribidi/${name}.zip";
-      sha256 = "6f7d83c09eae0cb98a40b85ba3dedc31af4dbff8fc4425f244c1e9f44392fded";
-    };
+  feedparser = callPackage ../development/python-modules/feedparser { };
 
-    meta = {
-      description = "A simple wrapper around fribidi";
-      homepage = https://github.com/pediapress/pyfribidi;
-      license = stdenv.lib.licenses.gpl2;
-    };
-  };
+  pyfribidi = callPackage ../development/python-modules/pyfribidi { };
 
   docker_compose = callPackage ../development/python-modules/docker_compose {};
 
-  fdroidserver = buildPythonPackage rec {
-    version = "2016-05-31";
-    name = "fdroidserver-git-${version}";
-
-    disabled = ! isPy3k;
-
-    src = pkgs.fetchFromGitLab {
-      owner = "fdroid";
-      repo = "fdroidserver";
-      rev = "401649e0365e6e365fc48ae8a3af94768af865f3";
-      sha256 = "1mmi2ffpym1qw694yj938kc7b4xhq0blri7wkjaqddcyykjyr94d";
-    };
-
-    propagatedBuildInputs = with self; [ libcloud pyyaml paramiko pyasn1 pyasn1-modules pillow mwclient GitPython ];
-
-    meta = {
-      homepage = https://f-droid.org;
-      description = "Server and tools for F-Droid, the Free Software repository system for Android";
-      maintainers = with maintainers; [ ];
-      license = licenses.agpl3;
-    };
-  };
-
-  filebrowser_safe = buildPythonPackage rec {
-    version = "0.3.6";
-    name = "filebrowser_safe-${version}";
+  pyftpdlib = callPackage ../development/python-modules/pyftpdlib { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/filebrowser_safe/${name}.tar.gz";
-      sha256 = "02bn60fdslvng2ckn65fms3hjbzgsa8qa5161a8lr720wbx8gpj2";
-    };
+  fdroidserver = callPackage ../development/python-modules/fdroidserver { };
 
-    buildInputs = [ self.django ];
-
-    # There is no test embedded
-    doCheck = false;
-
-    meta = {
-      description = "A snapshot of django-filebrowser for the Mezzanine CMS";
-      longDescription = ''
-        filebrowser_safe was created to provide a snapshot of the FileBrowser
-        asset manager for Django, to be referenced as a dependency for the
-        Mezzanine CMS for Django.
-
-        At the time of filebrowser_safe's creation, FileBrowser was incorrectly
-        packaged on PyPI, and had also dropped compatibility with Django 1.1 -
-        filebrowser_safe was therefore created to address these specific
-        issues.
-      '';
-      homepage = https://github.com/stephenmcd/filebrowser-safe;
-      downloadPage = https://pypi.python.org/pypi/filebrowser_safe/;
-      license = licenses.free;
-      maintainers = with maintainers; [ prikhi ];
-      platforms = platforms.linux;
-    };
-  };
+  filebrowser_safe = callPackage ../development/python-modules/filebrowser_safe { };
 
   pycodestyle = callPackage ../development/python-modules/pycodestyle { };
 
-  filebytes = buildPythonPackage rec {
-    name = "filebytes-0.9.12";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/filebytes/${name}.tar.gz";
-      sha256 = "6cd1c4ca823f6541c963a317e55382609789802dedad08209f4d038369e3f0ac";
-    };
-    propagatedBuildInputs = [ ];
-    meta = with pkgs.stdenv.lib; {
-      homepage = "https://scoding.de/filebytes-introduction";
-      license = licenses.gpl2;
-      description = "Scripts to parse ELF, PE, Mach-O and OAT (Android Runtime)";
-      maintainers = with maintainers; [ bennofs ];
-    };
-  };
+  filebytes = callPackage ../development/python-modules/filebytes { };
 
   filelock = callPackage ../development/python-modules/filelock {};
 
@@ -4959,26 +2202,7 @@ in {
 
   flake8-import-order = callPackage ../development/python-modules/flake8-import-order { };
 
-  flaky = buildPythonPackage rec {
-    name = "flaky-${version}";
-    version = "3.1.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/flaky/${name}.tar.gz";
-      sha256 = "1x9ixika7wqjj52x8wnsh1vk7jadkdqpx01plj7mlh8slwyq4s41";
-    };
-
-    buildInputs = with self; [ mock pytest ];
-
-    # waiting for feedback https://github.com/box/flaky/issues/97
-    doCheck = false;
-
-    meta = {
-      homepage = https://github.com/box/flaky;
-      description = "Plugin for nose or py.test that automatically reruns flaky tests";
-      license = licenses.asl20;
-    };
-  };
+  flaky = callPackage ../development/python-modules/flaky { };
 
   flask = callPackage ../development/python-modules/flask { };
 
@@ -5038,57 +2262,11 @@ in {
 
   flask_wtf = callPackage ../development/python-modules/flask-wtf { };
 
-  wtforms = buildPythonPackage rec {
-    version = "2.1";
-    name = "wtforms-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/W/WTForms/WTForms-${version}.zip";
-      sha256 = "0vyl26y9cg409cfyj8rhqxazsdnd0jipgjw06civhrd53yyi1pzz";
-    };
-
-    # Django tests are broken "django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet."
-    # This is fixed in master I believe but not yet in 2.1;
-    doCheck = false;
-
-    propagatedBuildInputs = with self; [ Babel ];
-
-    meta = {
-      homepage = https://github.com/wtforms/wtforms;
-      description = "A flexible forms validation and rendering library for Python";
-      license = licenses.bsd3;
-    };
-  };
+  wtforms = callPackage ../development/python-modules/wtforms { };
 
   graph-tool = callPackage ../development/python-modules/graph-tool/2.x.x.nix { };
 
-  grappelli_safe = buildPythonPackage rec {
-    version = "0.3.13";
-    name = "grappelli_safe-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/grappelli_safe/${name}.tar.gz";
-      sha256 = "8b21b4724bce449cc4f22dc74ed0be9b3e841d968f3271850bf4836864304eb6";
-    };
-
-    meta = {
-      description = "A snapshot of django-grappelli for the Mezzanine CMS";
-      longDescription = ''
-        grappelli_safe was created to provide a snapshot of the Grappelli admin
-        skin for Django, to be referenced as a dependency for the Mezzanine CMS
-        for Django.
-
-        At the time of grappelli_safe's creation, Grappelli was incorrectly
-        packaged on PyPI, and had also dropped compatibility with Django 1.1 -
-        grappelli_safe was therefore created to address these specific issues.
-      '';
-      homepage = https://github.com/stephenmcd/grappelli-safe;
-      downloadPage = http://pypi.python.org/pypi/grappelli_safe/;
-      license = licenses.free;
-      maintainers = with maintainers; [ prikhi ];
-      platforms = platforms.linux;
-    };
-  };
+  grappelli_safe = callPackage ../development/python-modules/grappelli_safe { };
 
   pytorch = let
     # Fails with CUDA 9.1 and GCC 6.4:
@@ -5114,37 +2292,9 @@ in {
     cudaSupport = false;
   };
 
-  python2-pythondialog = buildPythonPackage rec {
-    name = "python2-pythondialog-${version}";
-    version = "3.3.0";
-    disabled = !isPy27;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/python2-pythondialog/python2-pythondialog-${version}.tar.gz";
-      sha256 = "1yhkagsh99bfi592ymczf8rnw8rk6n9hdqy3dd98m3yrx8zmjvry";
-    };
-
-    patchPhase = ''
-      substituteInPlace dialog.py --replace ":/bin:/usr/bin" ":$out/bin"
-    '';
-
-    meta = with stdenv.lib; {
-      homepage = "http://pythondialog.sourceforge.net/";
-    };
-  };
-
-  pyRFC3339 = buildPythonPackage rec {
-    name = "pyRFC3339-${version}";
-    version = "0.2";
+  python2-pythondialog = callPackage ../development/python-modules/python2-pythondialog { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pyRFC3339/pyRFC3339-${version}.tar.gz";
-      sha256 = "1pp648xsjaw9h1xq2mgwzda5wis2ypjmzxlksc1a8grnrdmzy155";
-    };
-
-    propagatedBuildInputs = with self; [ pytz ];
-    buildInputs = with self; [ nose ];
-  };
+  pyRFC3339 = callPackage ../development/python-modules/pyrfc3339 { };
 
   ConfigArgParse = callPackage ../development/python-modules/configargparse { };
 
@@ -5152,61 +2302,11 @@ in {
 
   vcversioner = callPackage ../development/python-modules/vcversioner { };
 
-  falcon = buildPythonPackage (rec {
-    name = "falcon-1.0.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/falcon/${name}.tar.gz";
-      sha256 = "ddce23a2dd0abba6d19775e9bf7ba64e184b15a0e7163e65f62af63354193f63";
-    };
-
-    buildInputs = with self; stdenv.lib.optionals doCheck [coverage ddt nose pyyaml requests testtools];
-    propagatedBuildInputs = with self; [ six python_mimeparse ];
-
-    # The travis build fails since the migration from multiprocessing to threading for hosting the API under test.
-    # OSError: [Errno 98] Address already in use
-    doCheck = false;
-
-    meta = {
-      description = "An unladen web framework for building APIs and app backends";
-      homepage = http://falconframework.org;
-      license = licenses.asl20;
-      maintainers = with maintainers; [ desiderius ];
-    };
-  });
-  hug = buildPythonPackage rec {
-    name = "hug-2.1.2";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/hug/${name}.tar.gz";
-      sha256 = "93325e13706594933a9afb0d4f0b0748134494299038f07df41152baf6f89f4c";
-    };
-    disabled = !isPy3k;
-
-    propagatedBuildInputs = with self; [ falcon requests ];
-
-    # tests are not shipped in the tarball
-    doCheck = false;
+  falcon = callPackage ../development/python-modules/falcon { };
 
-    meta = {
-      description = "A Python framework that makes developing APIs as simple as possible, but no simpler";
-      homepage = https://github.com/timothycrosley/hug;
-      license = licenses.mit;
-    };
-  };
-  flup = buildPythonPackage (rec {
-    name = "flup-1.0.2";
-    disabled = isPy3k;
+  hug = callPackage ../development/python-modules/hug { };
 
-    src = pkgs.fetchurl {
-      url = "http://www.saddi.com/software/flup/dist/${name}.tar.gz";
-      sha256 = "1nbx174g40l1z3a8arw72qz05a1qxi3didp9wm7kvkn1bxx33bab";
-    };
-
-    meta = {
-      homepage = "http://trac.saddi.com/flup";
-      description = "FastCGI Python module set";
-    };
-  });
+  flup = callPackage ../development/python-modules/flup { };
 
   fn = callPackage ../development/python-modules/fn { };
 
@@ -5219,119 +2319,11 @@ in {
 
   fonttools = callPackage ../development/python-modules/fonttools { };
 
-  foolscap = buildPythonPackage (rec {
-    name = "foolscap-${version}";
-    version = "0.12.6";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/foolscap/${name}.tar.gz";
-      sha256 = "1bpmqq6485mmr5jza9q2c55l9m1bfsvsbd9drsip7p5qcsi22jrz";
-    };
-
-    propagatedBuildInputs = with self; [ mock twisted pyopenssl service-identity ];
-
-    checkPhase = ''
-      # Either uncomment this, or remove this custom check phase entirely, if
-      # you wish to do battle with the foolscap tests. ~ C.
-      # trial foolscap
-    '';
-
-    meta = {
-      homepage = http://foolscap.lothar.com/;
-
-      description = "Foolscap, an RPC protocol for Python that follows the distributed object-capability model";
-
-      longDescription = ''
-        "Foolscap" is the name for the next-generation RPC protocol,
-        intended to replace Perspective Broker (part of Twisted).
-        Foolscap is a protocol to implement a distributed
-        object-capabilities model in Python.
-      '';
-
-      # See http://foolscap.lothar.com/trac/browser/LICENSE.
-      license = licenses.mit;
-
-      maintainers = [ ];
-    };
-  });
-
-  forbiddenfruit = buildPythonPackage rec {
-    version = "0.1.0";
-    name = "forbiddenfruit-${version}";
-
-    src = pkgs.fetchurl {
-      url= "mirror://pypi/f/forbiddenfruit/${name}.tar.gz";
-      sha256 = "0xra2kw6m8ag29ifwmhi5zqksh4cr0yy1waqd488rm59kcr3zl79";
-    };
-
-    meta = {
-      description = "Patch python built-in objects";
-      homepage = https://pypi.python.org/pypi/forbiddenfruit;
-      license = licenses.mit;
-    };
-  };
-
-  fs = buildPythonPackage rec {
-    name = "fs-0.5.4";
-
-    src = pkgs.fetchurl {
-      url    = "mirror://pypi/f/fs/${name}.tar.gz";
-      sha256 = "ba2cca8773435a7c86059d57cb4b8ea30fda40f8610941f7822d1ce3ffd36197";
-    };
-
-    LC_ALL = "en_US.UTF-8";
-    buildInputs = [ pkgs.glibcLocales ];
-    propagatedBuildInputs = [ self.six ];
-
-    checkPhase = ''
-      ${python.interpreter} -m unittest discover
-    '';
-
-    # Because 2to3 is used the tests in $out need to be run.
-    # Both when using unittest and pytest this resulted in many errors,
-    # some Python byte/str errors, and others specific to resources tested.
-    # Failing tests due to the latter is to be expected with this type of package.
-    # Tests are therefore disabled.
-    doCheck = false;
-
-    meta = {
-      description = "Filesystem abstraction";
-      homepage    = https://pypi.python.org/pypi/fs;
-      license     = licenses.bsd3;
-      maintainers = with maintainers; [ lovek323 ];
-      platforms   = platforms.unix;
-    };
-  };
-
-  fusepy = buildPythonPackage rec {
-    name = "fusepy-2.0.4";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/f/fusepy/${name}.tar.gz";
-      sha256 = "0v5grm4zyf58hsplwsxfbihddw95lz9w8cy3rpzbyha287swgx8h";
-    };
+  foolscap = callPackage ../development/python-modules/foolscap { };
 
-    propagatedBuildInputs = [ pkgs.fuse ];
+  forbiddenfruit = callPackage ../development/python-modules/forbiddenfruit { };
 
-    # No tests included
-    doCheck = false;
-
-    patchPhase = ''
-      substituteInPlace fuse.py --replace \
-        "find_library('fuse')" "'${pkgs.fuse}/lib/libfuse.so'"
-    '';
-
-    meta = {
-      description = "Simple ctypes bindings for FUSE";
-      longDescription = ''
-        Python module that provides a simple interface to FUSE and MacFUSE.
-        It's just one file and is implemented using ctypes.
-      '';
-      homepage = https://github.com/terencehonles/fusepy;
-      license = licenses.isc;
-      platforms = platforms.unix;
-    };
-  };
+  fusepy = callPackage ../development/python-modules/fusepy { };
 
   future = callPackage ../development/python-modules/future { };
   future15 = self.future.overridePythonAttrs (old: rec {
@@ -5346,291 +2338,45 @@ in {
 
   futures = callPackage ../development/python-modules/futures { };
 
-  gcovr = buildPythonPackage rec {
-    name = "gcovr-2.4";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/gcovr/${name}.tar.gz";
-      sha256 = "2c878e03c2eff2282e64035bec0a30532b2b1173aadf08486401883b79e4dab1";
-    };
-
-    meta = {
-      description = "A Python script for summarizing gcov data";
-      license = "BSD";
-    };
-  };
+  gcovr = callPackage ../development/python-modules/gcovr { };
 
   gdal = toPythonModule (pkgs.gdal.override {
     pythonPackages = self;
   });
 
-  gdrivefs = buildPythonPackage rec {
-    version = "0.14.9";
-    name = "gdrivefs-${version}";
-    namePrefix = "";
-    disabled = !isPy27;
-
-    src = pkgs.fetchurl {
-      url = "https://github.com/dsoprea/GDriveFS/archive/${version}.tar.gz";
-      sha256 = "1mc2r35nf5k8vzwdcdhi0l9rb97amqd5xb53lhydj8v8f4rndk7a";
-    };
-
-    buildInputs = with self; [ gipc greenlet httplib2 six ];
-    propagatedBuildInputs = with self; [ dateutil fusepy google_api_python_client ];
-
-    patchPhase = ''
-      substituteInPlace gdrivefs/resources/requirements.txt \
-        --replace "==" ">="
-    '';
-
-    meta = {
-      description = "Mount Google Drive as a local file system";
-      longDescription = ''
-        GDriveFS is a FUSE wrapper for Google Drive developed. Design goals:
-        - Thread for monitoring changes via "changes" functionality of API.
-        - Complete stat() implementation.
-        - Seamlessly work around duplicate-file allowances in Google Drive.
-        - Seamlessly manage file-type versatility in Google Drive
-          (Google Doc files do not have a particular format).
-        - Allow for the same file at multiple paths.
-      '';
-      homepage = https://github.com/dsoprea/GDriveFS;
-      license = licenses.gpl2;
-      platforms = platforms.unix;
-    };
-  };
-
-  genshi = buildPythonPackage {
-    name = "genshi-0.7";
-
-    src = pkgs.fetchurl {
-      url = http://ftp.edgewall.com/pub/genshi/Genshi-0.7.tar.gz;
-      sha256 = "0lkkbp6fbwzv0zda5iqc21rr7rdldkwh3hfabfjl9i4bwq14858x";
-    };
-
-    # FAIL: test_sanitize_remove_script_elem (genshi.filters.tests.html.HTMLSanitizerTestCase)
-    # FAIL: test_sanitize_remove_src_javascript (genshi.filters.tests.html.HTMLSanitizerTestCase)
-    doCheck = false;
-
-    buildInputs = with self; [ setuptools ];
-
-    meta = {
-      description = "Python components for parsing HTML, XML and other textual content";
-
-      longDescription = ''
-        Python library that provides an integrated set of
-        components for parsing, generating, and processing HTML, XML or other
-        textual content for output generation on the web.
-      '';
+  gdrivefs = callPackage ../development/python-modules/gdrivefs { };
 
-      license = "BSD";
-    };
-  };
+  genshi = callPackage ../development/python-modules/genshi { };
 
   gevent = callPackage ../development/python-modules/gevent { };
 
-  geventhttpclient = buildPythonPackage rec {
-    name = "geventhttpclient-${version}";
-    version = "1.3.1";
+  geventhttpclient = callPackage ../development/python-modules/geventhttpclient { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/geventhttpclient/${name}.tar.gz";
-      sha256 = "bd87af8854f5fb05738916c8973671f7035568aec69b7c842887d6faf9c0a01d";
-    };
-
-    buildInputs = with self; [ pytest ];
-    propagatedBuildInputs = with self; [ gevent certifi six backports_ssl_match_hostname ];
-
-    # Several tests fail that require network
-    doCheck = false;
-    checkPhase = ''
-      py.test $out
-    '';
-
-    meta = {
-      homepage = https://github.com/gwik/geventhttpclient;
-      description = "HTTP client library for gevent";
-      license = licenses.mit;
-      maintainers = with maintainers; [ koral ];
-    };
-  };
-
-  gevent-socketio = buildPythonPackage rec {
-    name = "gevent-socketio-0.3.6";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/gevent-socketio/${name}.tar.gz";
-      sha256 = "1zra86hg2l1jcpl9nsnqagy3nl3akws8bvrbpgdxk15x7ywllfak";
-    };
-
-    buildInputs = with self; [ versiontools gevent-websocket mock pytest ];
-    propagatedBuildInputs = with self; [ gevent ];
-
-  };
+  gevent-socketio = callPackage ../development/python-modules/gevent-socketio { };
 
   geopandas = callPackage ../development/python-modules/geopandas { };
 
   geojson = callPackage ../development/python-modules/geojson { };
 
-  gevent-websocket = buildPythonPackage rec {
-    name = "gevent-websocket-0.9.3";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/gevent-websocket/${name}.tar.gz";
-      sha256 = "07rqwfpbv13mk6gg8mf0bmvcf6siyffjpgai1xd8ky7r801j4xb4";
-    };
-
-    # SyntaxError in tests.
-    disabled = isPy3k;
-
-    propagatedBuildInputs = with self; [ gevent ];
-
-  };
-
-  genzshcomp = buildPythonPackage {
-    name = "genzshcomp-0.5.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/genzshcomp/genzshcomp-0.5.1.tar.gz";
-      sha256 = "c77d007cc32cdff836ecf8df6192371767976c108a75b055e057bb6f4a09cd42";
-    };
-
-    buildInputs = with self; [ setuptools ];
-
-    meta = {
-      description = "Automatically generated zsh completion function for Python's option parser modules";
-      license = "BSD";
-    };
-  };
+  gevent-websocket = callPackage ../development/python-modules/gevent-websocket { };
 
+  genzshcomp = callPackage ../development/python-modules/genzshcomp { };
 
   gflags = callPackage ../development/python-modules/gflags { };
 
   ghdiff = callPackage ../development/python-modules/ghdiff { };
 
-  gipc = buildPythonPackage rec {
-    name = "gipc-0.5.0";
-    disabled = !isPy27;
+  gipc = callPackage ../development/python-modules/gipc { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/gipc/${name}.zip";
-      sha256 = "08c35xzv7nr12d9xwlywlbyzzz2igy0yy6y52q2nrkmh5d4slbpc";
-    };
-
-    propagatedBuildInputs = with self; [ gevent ];
-
-    meta = {
-      description = "gevent-cooperative child processes and IPC";
-      longDescription = ''
-        Usage of Python's multiprocessing package in a gevent-powered
-        application may raise problems and most likely breaks the application
-        in various subtle ways. gipc (pronunciation "gipsy") is developed with
-        the motivation to solve many of these issues transparently. With gipc,
-        multiprocessing. Process-based child processes can safely be created
-        anywhere within your gevent-powered application.
-      '';
-      homepage = http://gehrcke.de/gipc;
-      license = licenses.mit;
-    };
-  };
-
-  git-sweep = buildPythonPackage rec {
-    name = "git-sweep-0.1.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/git-sweep/${name}.tar.gz";
-      sha256 = "1csp0zd049d643d409rfivbswwzrayb4i6gkypp5mc27fb1z2afd";
-    };
-
-    propagatedBuildInputs = with self; [ GitPython ];
-
-    meta = {
-      description = "A command-line tool that helps you clean up Git branches";
-      homepage = https://github.com/arc90/git-sweep;
-      license = licenses.mit;
-      maintainers = with maintainers; [ pSub ];
-    };
-  };
+  git-sweep = callPackage ../development/python-modules/git-sweep { };
 
   glances = callPackage ../development/python-modules/glances { };
 
-  github3_py = buildPythonPackage rec {
-    name = "github3.py-${version}";
-    version = "1.1.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/github3.py/${name}.tar.gz";
-      sha256 = "1cxaqdqmz9w2afc0cw2jyv783fp0grydbik0frzj79azzkhyg4gf";
-    };
-
-    buildInputs = with self; [ unittest2 pytest mock betamax betamax-matchers dateutil ];
-
-    propagatedBuildInputs = with self; [ requests pyopenssl uritemplate_py
-      ndg-httpsclient requests_toolbelt pyasn1 ];
-
-    postPatch = ''
-      sed -i -e 's/mock ==1.0.1/mock>=1.0.1/' setup.py
-      sed -i -e 's/unittest2 ==0.5.1/unittest2>=0.5.1/' setup.py
-    '';
-
-    # TODO: only disable the tests that require network
-    doCheck = false;
-
-    meta = with stdenv.lib; {
-      homepage = http://github3py.readthedocs.org/en/master/;
-      description = "A wrapper for the GitHub API written in python";
-      license = licenses.bsd3;
-      maintainers = with maintainers; [ pSub ];
-    };
-  };
-
-  github-webhook = buildPythonPackage rec {
-    name = "github-webhook-${version}";
-    version = "unstable-2016-03-11";
-
-    # There is a PyPI package but an older one.
-    src = pkgs.fetchgit {
-      url = "https://github.com/bloomberg/python-github-webhook.git";
-      rev = "ca1855479ee59c4373da5425dbdce08567605d49";
-      sha256 = "0mqwig9281iyzbphp1d21a4pqdrf98vs9k8lqpqx6spzgqaczx5f";
-    };
-
-    propagatedBuildInputs = with self; [ flask ];
-    # No tests
-    doCheck = false;
-
-    meta = {
-      description = "A framework for writing webhooks for GitHub";
-      license = licenses.mit;
-      homepage = https://github.com/bloomberg/python-github-webhook;
-    };
-  };
-
-  goobook = buildPythonPackage rec {
-    name = "goobook-1.9";
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url    = "mirror://pypi/g/goobook/${name}.tar.gz";
-      sha256 = "02xmq8sjavza17av44ks510934wrshxnsm6lvhvazs45s92b671i";
-    };
-
-    buildInputs = with self; [ ];
-
-    preConfigure = ''
-      sed -i '/distribute/d' setup.py
-    '';
+  github3_py = callPackage ../development/python-modules/github3_py { };
 
-    meta = {
-      description = "Search your google contacts from the command-line or mutt";
-      homepage    = https://pypi.python.org/pypi/goobook;
-      license     = licenses.gpl3;
-      maintainers = with maintainers; [ lovek323 hbunke ];
-      platforms   = platforms.unix;
-    };
+  github-webhook = callPackage ../development/python-modules/github-webhook { };
 
-    propagatedBuildInputs = with self; [ oauth2client gdata simplejson httplib2 keyring six rsa ];
-  };
+  goobook = callPackage ../development/python-modules/goobook { };
 
   googleapis_common_protos = callPackage ../development/python-modules/googleapis_common_protos { };
 
@@ -5640,31 +2386,7 @@ in {
 
   google_api_python_client = callPackage ../development/python-modules/google-api-python-client { };
 
-  google_apputils = buildPythonPackage rec {
-    name = "google-apputils-0.4.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/google-apputils/${name}.tar.gz";
-      sha256 = "1sxsm5q9vr44qzynj8l7p3l7ffb0zl1jdqhmmzmalkx941nbnj1b";
-    };
-
-    preConfigure = ''
-      sed -i '/ez_setup/d' setup.py
-    '';
-
-    propagatedBuildInputs = with self; [ pytz gflags dateutil mox ];
-
-    checkPhase = ''
-      ${python.executable} setup.py google_test
-    '';
-
-    doCheck = true;
-
-    meta = {
-      description = "Google Application Utilities for Python";
-      homepage = http://code.google.com/p/google-apputils-python;
-    };
-  };
+  google_apputils = callPackage ../development/python-modules/google_apputils { };
 
   google_auth = callPackage ../development/python-modules/google_auth { };
 
@@ -5672,7 +2394,7 @@ in {
 
   google_cloud_speech = callPackage ../development/python-modules/google_cloud_speech { };
 
-  gpgme = toPythonModule (pkgs.gpgme.override { withPython=true; });
+  gpgme = toPythonModule (pkgs.gpgme.override { pythonSupport=true; });
 
   gphoto2 = callPackage ../development/python-modules/gphoto2 {
     inherit (pkgs) pkgconfig;
@@ -5692,51 +2414,9 @@ in {
 
   grpcio-tools = callPackage ../development/python-modules/grpcio-tools { };
 
-  gspread = buildPythonPackage rec {
-    version = "0.2.3";
-    name = "gspread-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/gspread/${name}.tar.gz";
-      sha256 = "dba45ef9e652dcd8cf561ae65569bd6ecd18fcc77b991521490698fb2d847106";
-    };
-
-    meta = {
-      description = "Google Spreadsheets client library";
-      homepage = "https://github.com/burnash/gspread";
-      license = licenses.mit;
-    };
-  };
-
-  gyp = buildPythonPackage rec {
-    name = "gyp-${version}";
-    version = "2015-06-11";
+  gspread = callPackage ../development/python-modules/gspread { };
 
-    src = pkgs.fetchgit {
-      url = "https://chromium.googlesource.com/external/gyp.git";
-      rev = "fdc7b812f99e48c00e9a487bd56751bbeae07043";
-      sha256 = "1imgxsl4mr1662vsj2mlnpvvrbz71yk00w8p85vi5bkgmc6awgiz";
-    };
-
-    prePatch = optionals pkgs.stdenv.isDarwin ''
-      sed -i 's/raise.*No Xcode or CLT version detected.*/version = "7.0.0"/' pylib/gyp/xcode_emulation.py
-    '';
-
-    patches = optionals pkgs.stdenv.isDarwin [
-      ../development/python-modules/gyp/no-darwin-cflags.patch
-      ../development/python-modules/gyp/no-xcode.patch
-    ];
-
-    disabled = isPy3k;
-
-    meta = {
-      description = "A tool to generate native build files";
-      homepage = https://chromium.googlesource.com/external/gyp/+/master/README.md;
-      license = licenses.bsd3;
-      maintainers = with maintainers; [ codyopel ];
-      platforms = platforms.all;
-    };
-  };
+  gyp = callPackage ../development/python-modules/gyp { };
 
   guessit = callPackage ../development/python-modules/guessit { };
 
@@ -5744,17 +2424,7 @@ in {
 
   gunicorn = callPackage ../development/python-modules/gunicorn { };
 
-  hawkauthlib = buildPythonPackage rec {
-    name = "hawkauthlib-${version}";
-    version = "0.1.1";
-    src = pkgs.fetchgit {
-      url = https://github.com/mozilla-services/hawkauthlib.git;
-      rev = "refs/tags/v${version}";
-      sha256 = "0mr1mpx4j9q7sch9arwfvpysnpf2p7ijy7072wilxm8pnj0bwvsi";
-    };
-
-    propagatedBuildInputs = with self; [ requests webob ];
-  };
+  hawkauthlib = callPackage ../development/python-modules/hawkauthlib { };
 
   hdbscan = callPackage ../development/python-modules/hdbscan { };
 
@@ -5762,67 +2432,13 @@ in {
 
   hcs_utils = callPackage ../development/python-modules/hcs_utils { };
 
-  hetzner = buildPythonPackage rec {
-    name = "hetzner-${version}";
-    version = "0.8.1";
-
-    src = pkgs.fetchFromGitHub {
-      repo = "hetzner";
-      owner = "aszlig";
-      rev = "v${version}";
-      sha256 = "1xd1klvjskv0pg8ginih597jkk491a55b8dq80dsm61m5sbsx3vq";
-    };
-
-    meta = {
-      homepage = "https://github.com/RedMoonStudios/hetzner";
-      description = "High-level Python API for accessing the Hetzner robot";
-      license = licenses.bsd3;
-      maintainers = with maintainers; [ aszlig ];
-    };
-  };
-
-
-  htmllaundry = buildPythonPackage rec {
-    name = "htmllaundry-2.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/htmllaundry/${name}.tar.gz";
-      sha256 = "e428cba78d5a965e959f5dac2eb7d5f7d627dd889990d5efa8d4e03f3dd768d9";
-    };
-
-    buildInputs = with self; [ nose ];
-    propagatedBuildInputs = with self; [ six lxml ];
-
-    # some tests fail, probably because of changes in lxml
-    # not relevant for me, if releavnt for you, fix it...
-    doCheck = false;
-
-    meta = {
-      description = "Simple HTML cleanup utilities";
-      license = licenses.bsd3;
-    };
-  };
+  hetzner = callPackage ../development/python-modules/hetzner { };
 
+  htmllaundry = callPackage ../development/python-modules/htmllaundry { };
 
   html5lib = callPackage ../development/python-modules/html5lib { };
 
-  http_signature = buildPythonPackage (rec {
-    name = "http_signature-0.1.4";
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/http_signature/${name}.tar.gz";
-      sha256 = "14acc192ef20459d5e11b4e800dd3a4542f6bd2ab191bf5717c696bf30936c62";
-    };
-
-    propagatedBuildInputs = with self; [pycrypto];
-
-    meta = {
-      homepage = https://github.com/atl/py-http-signature;
-      description = "";
-      license = licenses.mit;
-    };
-  });
+  http_signature = callPackage ../development/python-modules/http_signature { };
 
   httpbin = callPackage ../development/python-modules/httpbin { };
 
@@ -5832,261 +2448,35 @@ in {
 
   hypothesis = callPackage ../development/python-modules/hypothesis { };
 
-  colored = buildPythonPackage rec {
-    name = "colored-${version}";
-    version = "1.1.5";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/c/colored/${name}.tar.gz";
-      sha256 = "1r1vsypk8v7az82d66bidbxlndx1h7xd4m43hpg1a6hsjr30wrm3";
-    };
-
-    # No proper test suite
-    doCheck = false;
-  };
-
+  colored = callPackage ../development/python-modules/colored { };
 
-  xdis = buildPythonPackage rec {
-    name = "xdis-${version}";
-    version = "3.2.4";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/x/xdis/${name}.tar.gz";
-      sha256 = "0g2lh70837vigcbc1i58349wp2xzrhlsg2ahc92sn8d3jwxja4dk";
-    };
-    propagatedBuildInputs = with self; [ nose six ];
+  xdis = callPackage ../development/python-modules/xdis { };
 
-    meta = {
-      description = "Python cross-version byte-code disassembler and marshal routines";
-      homepage = https://github.com/rocky/python-xdis/;
-      license = licenses.mit;
-    };
-  };
+  uncompyle6 = callPackage ../development/python-modules/uncompyle6 { };
 
-  uncompyle6 = buildPythonPackage rec {
-    name = "uncompyle6-${version}";
-    version = "2.8.3";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/u/uncompyle6/${name}.tar.gz";
-      sha256 = "0hx5sji6qjvnq1p0zhvyk5hgracpv2w6iar1j59qwllxv115ffi1";
-    };
-    propagatedBuildInputs = with self; [ spark_parser xdis ];
-    meta = {
-      description = "Python cross-version byte-code deparser";
-      homepage = https://github.com/rocky/python-uncompyle6/;
-      license = licenses.mit;
-    };
-  };
+  lsi = callPackage ../development/python-modules/lsi { };
 
-  lsi = buildPythonPackage rec {
-    name = "lsi-${version}";
-    version = "0.2.2";
-    disabled = isPy3k;
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/l/lsi/${name}.tar.gz";
-      sha256 = "0429iilb06yhsmvj3xp6wyhfh1rp4ndxlhwrm80r97z0w7plrk94";
-    };
-    propagatedBuildInputs = [
-      self.colored
-      self.boto
-      pkgs.openssh
-      pkgs.which
-    ];
-    meta = {
-      description = "CLI for querying and SSHing onto AWS EC2 instances";
-      homepage = https://github.com/NarrativeScience/lsi;
-      maintainers = [maintainers.adnelson];
-      license = licenses.mit;
-    };
-  };
+  hkdf = callPackage ../development/python-modules/hkdf { };
 
-  hkdf = buildPythonPackage rec {
-    name = "hkdf-${version}";
-    version = "0.0.3";
+  httpretty = callPackage ../development/python-modules/httpretty { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/hkdf/${name}.tar.gz";
-      sha256 = "1jhxk5vhxmxxjp3zj526ry521v9inzzl8jqaaf0ma65w6k332ak2";
-    };
-
-    buildInputs = with self; [ nose ];
-
-    checkPhase = ''
-      nosetests
-    '';
-
-    meta = {
-      description = "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)";
-      homepage = "https://github.com/casebeer/python-hkdf";
-      license = licenses.bsd2;
-    };
-  };
-
-  httpretty = buildPythonPackage rec {
-    name = "httpretty-${version}";
-    version = "0.8.10";
-    doCheck = false;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/httpretty/${name}.tar.gz";
-      sha256 = "1nmdk6d89z14x3wg4yxywlxjdip16zc8bqnfb471z1365mr74jj7";
-    };
-
-    buildInputs = with self; [ tornado requests httplib2 sure nose coverage certifi ];
-
-    propagatedBuildInputs = with self; [ urllib3 ];
-
-    postPatch = ''
-      sed -i -e 's/==.*$//' *requirements.txt
-      # XXX: Drop this after version 0.8.4 is released.
-      patch httpretty/core.py <<DIFF
-      ***************
-      *** 566 ****
-      !                 'content-length': len(self.body)
-      --- 566 ----
-      !                 'content-length': str(len(self.body))
-      DIFF
-
-      # Explicit encoding flag is required with python3, unless locale is set.
-      ${if !self.isPy3k then "" else
-        "patch -p0 -i ${../development/python-modules/httpretty/setup.py.patch}"}
-    '';
-
-    meta = {
-      homepage = "https://falcao.it/HTTPretty/";
-      description = "HTTP client request mocking tool";
-      license = licenses.mit;
-    };
-  };
-
-  icalendar = buildPythonPackage rec {
-    version = "3.9.0";
-    name = "icalendar-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/icalendar/${name}.tar.gz";
-      sha256 = "93d0b94eab23d08f62962542309916a9681f16de3d5eca1c75497f30f1b07792";
-    };
-
-    buildInputs = with self; [ setuptools ];
-    propagatedBuildInputs = with self; [ dateutil pytz ];
-
-    meta = {
-      description = "A parser/generator of iCalendar files";
-      homepage = "http://icalendar.readthedocs.org/";
-      license = licenses.bsd2;
-      maintainers = with maintainers; [ olcai ];
-    };
-  };
-
-  imageio = buildPythonPackage rec {
-    name = "imageio-${version}";
-    version = "1.6";
-
-    src = pkgs.fetchurl {
-      url = "https://github.com/imageio/imageio/archive/v${version}.tar.gz";
-      sha256 = "195snkk3fsbjqd5g1cfsd9alzs5q45gdbi2ka9ph4yxqb31ijrbv";
-    };
-
-    buildInputs = with self; [ pytest ];
-    propagatedBuildInputs = with self; [ numpy ];
-
-    checkPhase = ''
-      py.test
-    '';
-
-    # Tries to write in /var/tmp/.imageio
-    doCheck = false;
+  icalendar = callPackage ../development/python-modules/icalendar { };
 
-    meta = {
-      description = "Library for reading and writing a wide range of image, video, scientific, and volumetric data formats";
-      homepage = http://imageio.github.io/;
-      license = licenses.bsd2;
-    };
-  };
+  imageio = callPackage ../development/python-modules/imageio { };
 
   imgaug = callPackage ../development/python-modules/imgaug { };
 
   inflection = callPackage ../development/python-modules/inflection { };
 
-  influxdb = buildPythonPackage rec {
-    name = "influxdb-4.0.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/influxdb/${name}.tar.gz";
-      sha256 = "0injsml6zmb3hkgc03117fdlg573kbfgjbijpd5npf0vsy0xnpvz";
-    };
-
-    # ImportError: No module named tests
-    doCheck = false;
-    propagatedBuildInputs = with self; [ requests dateutil pytz six ];
-
-    meta = {
-      description = "Python client for InfluxDB";
-      homepage = https://github.com/influxdb/influxdb-python;
-      license = licenses.mit;
-    };
-  };
-
-  infoqscraper = buildPythonPackage rec {
-    name = pname + "-" + version;
-    version = "0.1.0";
-    pname = "infoqscraper";
-
-    src = pkgs.fetchFromGitHub {
-      owner = "cykl";
-      repo = pname;
-      rev = "v" + version;
-      sha256 = "07mxp4mla7fwfc032f3mxrhjarnhkjqdxxibf9ba87c93z3dq8jj";
-    };
-
-    # requires network
-    doCheck = false;
-
-    buildInputs = with self; [ html5lib ];
-    propagatedBuildInputs = (with self; [ six beautifulsoup4 ])
-                         ++ (with pkgs; [ ffmpeg swftools rtmpdump ]);
-
-    meta = {
-      description = "Discover presentations and/or create a movie consisting of slides and audio track from an infoq url";
-      homepage = "https://github.com/cykl/infoqscraper/wiki";
-      license = licenses.mit;
-      maintainers = with maintainers; [ edwtjo ];
-    };
-  };
-
-  inifile = buildPythonPackage rec {
-    name = "inifile-0.3";
+  influxdb = callPackage ../development/python-modules/influxdb { };
 
-    meta = {
-      description = "A small INI library for Python";
-      homepage    = "https://github.com/mitsuhiko/python-inifile";
-      license     = "BSD";
-      maintainers = with maintainers; [ vozz ];
-    };
+  infoqscraper = callPackage ../development/python-modules/infoqscraper { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/inifile/${name}.tar.gz";
-      sha256 = "0zgd53czc1irwx6b5zip8xlmyfr40hz2pd498d8yv61znj6lm16h";
-    };
-  };
+  inifile = callPackage ../development/python-modules/inifile { };
 
   interruptingcow = callPackage ../development/python-modules/interruptingcow {};
 
-  iptools = buildPythonPackage rec {
-    version = "0.6.1";
-    name = "iptools-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/iptools/iptools-${version}.tar.gz";
-      sha256 = "0f03875a5bed740ba4bf44decb6a78679cca914a1ee8a6cc468114485c4d98e3";
-    };
-
-    buildInputs = with self; [ nose ];
-
-    meta = {
-      description = "Utilities for manipulating IP addresses including a class that can be used to include CIDR network blocks in Django's INTERNAL_IPS setting";
-      homepage = https://pypi.python.org/pypi/iptools;
-    };
-  };
+  iptools = callPackage ../development/python-modules/iptools { };
 
   ipy = callPackage ../development/python-modules/IPy { };
 
@@ -6105,89 +2495,15 @@ in {
 
   ipywidgets = callPackage ../development/python-modules/ipywidgets { };
 
-  ipaddr = buildPythonPackage rec {
-    name = "ipaddr-${version}";
-    version = "2.1.11";
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/ipaddr/${name}.tar.gz";
-      sha256 = "1dwq3ngsapjc93fw61rp17fvzggmab5x1drjzvd4y4q0i255nm8v";
-    };
-
-    meta = {
-      description = "Google's IP address manipulation library";
-      homepage = http://code.google.com/p/ipaddr-py/;
-      license = licenses.asl20;
-    };
-  };
-
-  ipaddress = if (pythonAtLeast "3.3") then null else buildPythonPackage rec {
-    name = "ipaddress-1.0.18";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/ipaddress/${name}.tar.gz";
-      sha256 = "1q8klj9d84cmxgz66073x1j35cplr3r77vx1znhxiwl5w74391ax";
-    };
-
-    checkPhase = ''
-      ${python.interpreter} test_ipaddress.py
-    '';
-
-    meta = {
-      description = "Port of the 3.3+ ipaddress module to 2.6, 2.7, and 3.2";
-      homepage = https://github.com/phihag/ipaddress;
-      license = licenses.psfl;
-    };
-  };
-
-  ipdb = buildPythonPackage rec {
-    name = "ipdb-${version}";
-    version = "0.8.1";
-
-    disabled = isPyPy;  # setupterm: could not find terminfo database
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/ipdb/${name}.zip";
-      sha256 = "1763d1564113f5eb89df77879a8d3213273c4d7ff93dcb37a3070cdf0c34fd7c";
-    };
-    propagatedBuildInputs = with self; [ ipython ];
-  };
-
-  ipdbplugin = buildPythonPackage {
-    name = "ipdbplugin-1.4";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/ipdbplugin/ipdbplugin-1.4.tar.gz";
-      sha256 = "4778d78b5d0af1a2a6d341aed9e72eb73b1df6b179e145b4845d3a209137029c";
-    };
-    propagatedBuildInputs = with self; [ self.nose self.ipython ];
-  };
-
-  pythonIRClib = buildPythonPackage rec {
-    name = "irclib-${version}";
-    version = "0.4.8";
-
-    src = pkgs.fetchurl {
-      url = "mirror://sourceforge/python-irclib/python-irclib-${version}.tar.gz";
-      sha256 = "1x5456y4rbxmnw4yblhb4as5791glcw394bm36px3x6l05j3mvl1";
-    };
+  ipaddr = callPackage ../development/python-modules/ipaddr { };
 
-    patches = [(pkgs.fetchurl {
-      url = "http://trac.uwc.ac.za/trac/python_tools/browser/xmpp/resources/irc-transport/irclib.py.diff?rev=387&format=raw";
-      name = "irclib.py.diff";
-      sha256 = "5fb8d95d6c95c93eaa400b38447c63e7a176b9502bc49b2f9b788c9905f4ec5e";
-    })];
+  ipaddress = callPackage ../development/python-modules/ipaddress { };
 
-    patchFlags = "irclib.py";
+  ipdb = callPackage ../development/python-modules/ipdb { };
 
-    propagatedBuildInputs = with self; [ paver ];
+  ipdbplugin = callPackage ../development/python-modules/ipdbplugin { };
 
-    disabled = isPy3k;
-    meta = {
-      description = "Python IRC library";
-      homepage = https://bitbucket.org/jaraco/irc;
-      license = with licenses; [ lgpl21 ];
-    };
-  };
+  pythonIRClib = callPackage ../development/python-modules/pythonirclib { };
 
   iso-639 = callPackage ../development/python-modules/iso-639 {};
 
@@ -6203,73 +2519,15 @@ in {
 
   jellyfish = callPackage ../development/python-modules/jellyfish { };
 
-  j2cli = buildPythonPackage rec {
-    name = "j2cli-${version}";
-    version = "0.3.1-0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/j/j2cli/${name}.tar.gz";
-      sha256 = "0y3w1x9935qzx8w6m2r6g4ghyjmxn33wryiif6xb56q7cj9w1433";
-    };
-
-    disabled = !isPy27;
-
-    buildInputs = [ self.nose ];
-
-    propagatedBuildInputs = with self; [ jinja2 pyyaml ];
-
-    meta = {
-      homepage = https://github.com/kolypto/j2cli;
-      description = "Jinja2 Command-Line Tool";
-      license = licenses.bsd3;
-      longDescription = ''
-        J2Cli is a command-line tool for templating in shell-scripts,
-        leveraging the Jinja2 library.
-      '';
-      platforms = platforms.all;
-      maintainers = with maintainers; [ rushmorem ];
-    };
-  };
+  j2cli = callPackage ../development/python-modules/j2cli { };
 
   jinja2 = callPackage ../development/python-modules/jinja2 { };
 
-  jinja2_time = buildPythonPackage rec {
-    version = "0.2.0";
-    name = "jinja2-time-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/j/jinja2-time/${name}.tar.gz";
-      sha256 = "0h0dr7cfpjnjj8bgl2vk9063a53649pn37wnlkd8hxjy656slkni";
-    };
-
-    propagatedBuildInputs = with self; [ arrow jinja2 ];
-
-    meta = {
-      homepage = https://github.com/hackebrot/jinja2-time;
-      description = "Jinja2 Extension for Dates and Times";
-      license = licenses.mit;
-    };
-  };
+  jinja2_time = callPackage ../development/python-modules/jinja2_time { };
 
   jinja2_pluralize = callPackage ../development/python-modules/jinja2_pluralize { };
 
-  jmespath = buildPythonPackage rec {
-    name = "jmespath-0.9.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/j/jmespath/${name}.tar.gz";
-      sha256 = "0g9xvl69y7nr3w7ag4fsp6sm4fqf6vrqjw7504x2hzrrsh3ampq8";
-    };
-
-    buildInputs = with self; [ nose ];
-    propagatedBuildInputs = with self; [ ply ];
-
-    meta = {
-      homepage = https://github.com/boto/jmespath;
-      description = "JMESPath allows you to declaratively specify how to extract elements from a JSON document";
-      license = "BSD";
-    };
-  };
+  jmespath = callPackage ../development/python-modules/jmespath { };
 
   journalwatch = callPackage ../tools/system/journalwatch {
     inherit (self) systemd pytest;
@@ -6295,49 +2553,6 @@ in {
 
   jupyterhub-ldapauthenticator = callPackage ../development/python-modules/jupyterhub-ldapauthenticator { };
 
-  jsonpath_rw = buildPythonPackage rec {
-    name = "jsonpath-rw-${version}";
-    version = "1.4.0";
-    disabled = isPyPy;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/j/jsonpath-rw/${name}.tar.gz";
-      sha256 = "05c471281c45ae113f6103d1268ec7a4831a2e96aa80de45edc89b11fac4fbec";
-    };
-
-    propagatedBuildInputs = with self; [
-      ply
-      six
-      decorator
-    ];
-
-    # ImportError: No module named tests
-    doCheck = false;
-
-    meta = {
-      homepage = https://github.com/kennknowles/python-jsonpath-rw;
-      description = "A robust and significantly extended implementation of JSONPath for Python, with a clear AST for metaprogramming";
-      license = licenses.asl20;
-    };
-  };
-
-  kerberos = buildPythonPackage rec {
-    name = "kerberos-1.2.4";
-
-    src = pkgs.fetchurl {
-      url = "https://pypi.python.org/packages/source/k/kerberos/${name}.tar.gz";
-      sha256 = "11q9jhzdl88jh8jgn7cycq034m36g2ncxds7mr3vqkngpcirkx6n";
-    };
-
-    buildInputs = [ pkgs.kerberos ];
-
-    meta = {
-      description = "Kerberos high-level interface";
-      homepage = https://pypi.python.org/pypi/kerberos;
-      license = licenses.asl20;
-    };
-  };
-
   keyring = callPackage ../development/python-modules/keyring { };
 
   keyutils = callPackage ../development/python-modules/keyutils { inherit (pkgs) keyutils; };
@@ -6367,128 +2582,27 @@ in {
 
   lark-parser = callPackage ../development/python-modules/lark-parser { };
 
-  lazy-object-proxy = buildPythonPackage rec {
-    name = "lazy-object-proxy-${version}";
-    version = "1.2.1";
+  jsonpath_rw = callPackage ../development/python-modules/jsonpath_rw { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/l/lazy-object-proxy/${name}.tar.gz";
-      sha256 = "22ed751a2c63c6cf718674fd7461b1dfc45215bab4751ca32b6c9b8cb2734cb3";
-    };
-
-    buildInputs = with self; [ pytest ];
-    checkPhase = ''
-      py.test tests
-    '';
+  kerberos = callPackage ../development/python-modules/kerberos { };
 
-    # Broken tests. Seem to be fixed upstream according to Travis.
-    doCheck = false;
-
-    meta = {
-      description = "A fast and thorough lazy object proxy";
-      homepage = https://github.com/ionelmc/python-lazy-object-proxy;
-      license = with licenses; [ bsd2 ];
-    };
-
-  };
+  lazy-object-proxy = callPackage ../development/python-modules/lazy-object-proxy { };
 
   ldaptor = callPackage ../development/python-modules/ldaptor { };
 
-  le = buildPythonPackage rec {
-    name = "le-${version}";
-    version = "1.4.29";
-
-    src = pkgs.fetchurl {
-      url = "https://github.com/logentries/le/archive/v${version}.tar.gz";
-      sha256 = "d29738937cb6e714b6ec2ae74b66b1983482ffd54b4faa40767af18509521d4c";
-    };
-
-    disabled = isPy3k;
-
-    doCheck = false;
-
-    propagatedBuildInputs = with self; [ simplejson psutil ];
+  le = callPackage ../development/python-modules/le { };
 
-    meta = {
-      homepage = "https://github.com/logentries/le";
-      description = "Logentries agent";
-    };
-  };
-
-  lektor = buildPythonPackage rec {
-    name = "lektor-${version}";
-
-    version = "2.3";
-
-    src = pkgs.fetchgit {
-      url = "https://github.com/lektor/lektor";
-      rev = "refs/tags/${version}";
-      sha256 = "1n0ylh1sbpvi9li3g6a7j7m28njfibn10y6s2gayjxwm6fpphqxy";
-    };
-
-    LC_ALL="en_US.UTF-8";
-
-    meta = {
-      description = "A static content management system";
-      homepage    = "https://www.getlektor.com/";
-      license     = "BSD";
-      maintainers = with maintainers; [ vozz ];
-    };
-
-    # No tests included in archive
-    doCheck = false;
-
-    propagatedBuildInputs = with self; [
-      click watchdog exifread requests mistune inifile Babel jinja2
-      flask pyopenssl ndg-httpsclient pkgs.glibcLocales
-    ];
-  };
+  lektor = callPackage ../development/python-modules/lektor { };
 
   python-oauth2 = callPackage ../development/python-modules/python-oauth2 { };
 
   python_openzwave = callPackage ../development/python-modules/python_openzwave { };
 
-  python-Levenshtein = buildPythonPackage rec {
-    name = "python-Levenshtein-${version}";
-    version = "0.12.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/python-Levenshtein/${name}.tar.gz";
-      sha256 = "1c9ybqcja31nghfcc8xxbbz9h60s9qi12b9hr4jyl69xbvg12fh3";
-    };
+  python-Levenshtein = callPackage ../development/python-modules/python-levenshtein { };
 
-    # No tests included in archive
-    doCheck = false;
-
-    meta = {
-      description = "Functions for fast computation of Levenshtein distance and string similarity";
-      homepage    = "https://github.com/ztane/python-Levenshtein";
-      license     = licenses.gpl2;
-      maintainers = with maintainers; [ aske ];
-    };
-  };
-
-  libcloud = buildPythonPackage (rec {
-    name = "libcloud-1.2.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/a/apache-libcloud/apache-${name}.tar.bz2";
-      sha256 = "0qlhyz5f32xg8i10biyzqscks8d28vklk63hvj45vzy1amw60kqz";
-    };
-
-    buildInputs = with self; [ mock ];
+  fs = callPackage ../development/python-modules/fs { };
 
-    propagatedBuildInputs = with self; [ pycrypto ];
-    preConfigure = "cp libcloud/test/secrets.py-dist libcloud/test/secrets.py";
-
-    # failing tests for 26 and 27
-    doCheck = false;
-
-    meta = {
-      description = "A unified interface to many cloud providers";
-      homepage = http://incubator.apache.org/libcloud/;
-    };
-  });
+  libcloud = callPackage ../development/python-modules/libcloud { };
 
   libgpuarray = callPackage ../development/python-modules/libgpuarray {
     clblas = pkgs.clblas.override { boost = self.boost; };
@@ -6509,59 +2623,18 @@ in {
   libplist = disabledIf isPy3k
     (toPythonModule (pkgs.libplist.override{python2Packages=self; })).py;
 
-  libxml2 = disabledIf isPy3k
-    (toPythonModule (pkgs.libxml2.override{pythonSupport=true; python2=python;})).py;
+  libxml2 = toPythonModule (pkgs.libxml2.override{pythonSupport=true; python2=python;}).py;
 
   libxslt = disabledIf isPy3k
     (toPythonModule (pkgs.libxslt.override{pythonSupport=true; python2=python; inherit (self) libxml2;})).py;
 
   limits = callPackage ../development/python-modules/limits { };
 
-  limnoria = buildPythonPackage rec {
-    name = "limnoria-${version}";
-    version = "2016.05.06";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/l/limnoria/${name}.tar.gz";
-      sha256 = "09kbii5559d09jjb6cryj8rva1050r54dvb67hlcvxhy8g3gr1y3";
-    };
-
-    patchPhase = ''
-      sed -i 's/version=version/version="${version}"/' setup.py
-    '';
-    buildInputs = with self; [ pkgs.git ];
-    propagatedBuildInputs = with self; [  ];
-
-    doCheck = false;
-
-    meta = {
-      description = "A modified version of Supybot, an IRC bot";
-      homepage = http://supybot.fr.cr;
-      license = licenses.bsd3;
-      maintainers = with maintainers; [ goibhniu ];
-    };
-  };
+  limnoria = callPackage ../development/python-modules/limnoria { };
 
   line_profiler = callPackage ../development/python-modules/line_profiler { };
 
-  linode = buildPythonPackage rec {
-    name = "linode-${version}";
-    version = "0.4";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/l/linode/linode-${version}.tar.gz";
-      sha256 = "db3c2a7fab8966d903a63f16c515bff241533e4ef2d746aa7aae4a49bba5e573";
-    };
-
-    propagatedBuildInputs = with self; [ requests ];
-
-    meta = {
-      homepage = "https://github.com/ghickman/linode";
-      description = "A thin python wrapper around Linode's API";
-      license = licenses.mit;
-      maintainers = with maintainers; [ nslqqq ];
-    };
-  };
+  linode = callPackage ../development/python-modules/linode { };
 
   linode-api = callPackage ../development/python-modules/linode-api { };
 
@@ -6583,75 +2656,15 @@ in {
 
   lxml = callPackage ../development/python-modules/lxml {inherit (pkgs) libxml2 libxslt;};
 
-  lxc = buildPythonPackage (rec {
-    name = "python-lxc-unstable-2016-08-25";
-    disabled = !isPy27;
-
-    src = pkgs.fetchFromGitHub {
-      owner = "lxc";
-      repo = "python2-lxc";
-      rev = "0553f05d23b56b59bf3015fa5e45bfbfab9021ef";
-      sha256 = "0p9kb20xvq91gx2wfs3vppb7vsp8kmd90i3q95l4nl1y4aismdn4";
-    };
-
-    buildInputs = [ pkgs.lxc ];
-
-    meta = {
-      description = "Out of tree python 2.7 binding for liblxc";
-      homepage = https://github.com/lxc/python2-lxc;
-      license = licenses.lgpl2;
-      maintainers = with maintainers; [ mic92 ];
-    };
-  });
+  lxc = callPackage ../development/python-modules/lxc { };
 
   py_scrypt = callPackage ../development/python-modules/py_scrypt { };
 
   python_magic = callPackage ../development/python-modules/python-magic { };
 
-  magic = buildPythonPackage rec {
-    name = "${pkgs.file.name}";
-
-    src = pkgs.file.src;
-
-    patchPhase = ''
-      substituteInPlace python/magic.py --replace "find_library('magic')" "'${pkgs.file}/lib/libmagic${stdenv.hostPlatform.extensions.sharedLibrary}'"
-    '';
-
-    buildInputs = with self; [ pkgs.file ];
+  magic = callPackage ../development/python-modules/magic { };
 
-    preConfigure = "cd python";
-
-    # No test suite
-    doCheck = false;
-
-    meta = {
-      description = "A Python wrapper around libmagic";
-      homepage = http://www.darwinsys.com/file/;
-    };
-  };
-
-  m2crypto = buildPythonPackage rec {
-    version = "0.24.0";
-    name = "m2crypto-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/M/M2Crypto/M2Crypto-${version}.tar.gz";
-      sha256 = "1s2y0pf2zg7xf4nfwrw7zhwbk615r5a7bgi5wwkwzh6jl50n99c0";
-    };
-
-    buildInputs = with self; [ pkgs.swig2 pkgs.openssl ];
-
-    preConfigure = ''
-      substituteInPlace setup.py --replace "self.openssl = '/usr'" "self.openssl = '${pkgs.openssl.dev}'"
-    '';
-
-    doCheck = false; # another test that depends on the network.
-
-    meta = {
-      description = "A Python crypto and SSL toolkit";
-      homepage = http://chandlerproject.org/Projects/MeTooCrypto;
-    };
-  };
+  m2crypto = callPackage ../development/python-modules/m2crypto { };
 
   Mako = callPackage ../development/python-modules/Mako { };
 
@@ -6677,145 +2690,23 @@ in {
 
   marisa-trie = callPackage ../development/python-modules/marisa-trie { };
 
-  markupsafe = buildPythonPackage rec {
-    name = "markupsafe-${version}";
-    version = "1.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/M/MarkupSafe/MarkupSafe-${version}.tar.gz";
-      sha256 = "0rdn1s8x9ni7ss8rfiacj7x1085lx8mh2zdwqslnw8xc3l4nkgm6";
-    };
-
-    meta = {
-      description = "Implements a XML/HTML/XHTML Markup safe string";
-      homepage = http://dev.pocoo.org;
-      license = licenses.bsd3;
-      maintainers = with maintainers; [ domenkozar garbas ];
-    };
-  };
+  markupsafe = callPackage ../development/python-modules/markupsafe { };
 
   marshmallow = callPackage ../development/python-modules/marshmallow { };
 
   marshmallow-sqlalchemy = callPackage ../development/python-modules/marshmallow-sqlalchemy { };
 
-  manuel = buildPythonPackage rec {
-    name = "manuel-${version}";
-    version = "1.8.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/manuel/${name}.tar.gz";
-      sha256 = "1diyj6a8bvz2cdf9m0g2bbx9z2yjjnn3ylbg1zinpcjj6vldfx59";
-    };
+  manuel = callPackage ../development/python-modules/manuel { };
 
-    propagatedBuildInputs = with self; [ six zope_testing ];
-
-    meta = {
-      description = "A documentation builder";
-      homepage = https://pypi.python.org/pypi/manuel;
-      license = licenses.zpl20;
-    };
-  };
-
-  mapsplotlib = buildPythonPackage rec {
-    name = "mapsplotlib-${version}";
-    version = "1.0.6";
-
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/mapsplotlib/${name}.tar.gz";
-      sha256 = "09gpws3x0jd88n636baxx5izjffrpjy4j6jl8l7vj29yzvrdr2bp";
-    };
-
-    propagatedBuildInputs = with self; [ matplotlib scipy pandas requests pillow ];
-
-    meta = {
-      description = "Custom Python plots on a Google Maps background";
-      homepage = https://github.com/tcassou/mapsplotlib;
-      maintainers = [ maintainers.rob ];
-    };
-  };
+  mapsplotlib = callPackage ../development/python-modules/mapsplotlib { };
 
   markdown = callPackage ../development/python-modules/markdown { };
 
   markdownsuperscript = callPackage ../development/python-modules/markdownsuperscript {};
 
-  markdown-macros = buildPythonPackage rec {
-    name = "markdown-macros-${version}";
-    version = "0.1.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/markdown-macros/${name}.tar.gz";
-      sha256 = "1lzvrb7nci22yp21ab2qqc9p0fhkazqj29vw0wln2r4ckb2nbawv";
-    };
-
-    patches = [
-      # Fixes a bug with markdown>2.4
-      (pkgs.fetchpatch {
-        url = "https://github.com/wnielson/markdown-macros/pull/1.patch";
-        sha256 = "17njbgq2srzkf03ar6yn92frnsbda3g45cdi529fdh0x8mmyxci0";
-      })
-    ];
-
-    prePatch = ''
-      substituteInPlace setup.py --replace "distribute" "setuptools"
-    '';
-
-    propagatedBuildInputs = with self; [ markdown ];
-
-    doCheck = false;
-
-    meta = {
-      description = "An extension for python-markdown that makes writing trac-like macros easy";
-      homepage = https://github.com/wnielson/markdown-macros;
-      license = licenses.mit;
-      maintainers = [ maintainers.abigailbuccaneer ];
-    };
-  };
-
-  mathics = if (versionOlder self.django.version "1.8") ||
-               (versionAtLeast self.django.version "1.9")
-            then throw "mathics only supports django-1.8.x"
-            else buildPythonPackage rec {
-    name = "mathics-${version}";
-    version = "0.9";
-    src = pkgs.fetchFromGitHub {
-      owner = "mathics";
-      repo = "Mathics";
-      rev = "v${version}";
-      sha256 = "0xzz7j8xskj5y6as178mjmm0i2xbhd4q4mwmdnvghpd2aqq3qx1c";
-    };
-
-    buildInputs = with self; [ pexpect ];
-
-    prePatch = ''
-      substituteInPlace setup.py --replace "sympy==0.7.6" "sympy"
-    '';
-
-    postFixup = ''
-      wrapPythonProgramsIn $out/bin $out
-      patchPythonScript $out/${python.sitePackages}/mathics/manage.py
-    '';
-
-    propagatedBuildInputs = with self; [
-      cython
-      sympy
-      django
-      ply
-      mpmath
-      dateutil
-      colorama
-      six
-    ];
-
-    meta = {
-      description = "A general-purpose computer algebra system";
-      homepage = http://www.mathics.org;
-      license = licenses.gpl3;
-      maintainers = [ maintainers.benley ];
-    };
-  };
+  markdown-macros = callPackage ../development/python-modules/markdown-macros { };
 
+  mathics = callPackage ../development/python-modules/mathics { };
 
   matplotlib = callPackage ../development/python-modules/matplotlib {
     stdenv = if stdenv.isDarwin then pkgs.clangStdenv else pkgs.stdenv;
@@ -6829,186 +2720,31 @@ in {
 
   mccabe = callPackage ../development/python-modules/mccabe { };
 
-  mechanize = buildPythonPackage (rec {
-    name = "mechanize-0.3.5";
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/mechanize/${name}.tar.gz";
-      sha256 = "0rki9nl4y42q694parafcsdcdqvkdjckrbg6n0691302lfsrkyfl";
-    };
-
-    propagatedBuildInputs = with self; [ html5lib ];
-
-    doCheck = false;
-
-    meta = {
-      description = "Stateful programmatic web browsing in Python";
-
-      homepage = http://wwwsearch.sourceforge.net/;
-
-      license = "BSD-style";
-    };
-  });
+  mechanize = callPackage ../development/python-modules/mechanize { };
 
   MechanicalSoup = callPackage ../development/python-modules/MechanicalSoup { };
 
-  meld3 = buildPythonPackage rec {
-    name = "meld3-1.0.0";
-
-    src = pkgs.fetchurl {
-      url = mirror://pypi/m/meld3/meld3-1.0.0.tar.gz;
-      sha256 = "57b41eebbb5a82d4a928608962616442e239ec6d611fe6f46343e765e36f0b2b";
-    };
-
-    doCheck = false;
-
-    meta = {
-      description = "An HTML/XML templating engine used by supervisor";
-      homepage = https://github.com/supervisor/meld3;
-      license = licenses.free;
-    };
-  };
+  meld3 = callPackage ../development/python-modules/meld3 { };
 
   meliae = callPackage ../development/python-modules/meliae {};
 
   meinheld = callPackage ../development/python-modules/meinheld { };
 
-  memcached = buildPythonPackage rec {
-    name = "memcached-1.51";
-
-    src = if isPy3k then pkgs.fetchurl {
-      url = "mirror://pypi/p/python3-memcached/python3-${name}.tar.gz";
-      sha256 = "0na8b369q8fivh3y0nvzbvhh3lgvxiyyv9xp93cnkvwfsr8mkgkw";
-    } else pkgs.fetchurl {
-      url = "http://ftp.tummy.com/pub/python-memcached/old-releases/python-${name}.tar.gz";
-      sha256 = "124s98m6hvxj6x90d7aynsjfz878zli771q96ns767r2mbqn7192";
-    };
-
-    meta = {
-      description = "Python API for communicating with the memcached distributed memory object cache daemon";
-      homepage = http://www.tummy.com/Community/software/python-memcached/;
-    };
-  };
-
-
-  memory_profiler = buildPythonPackage rec {
-    name = "memory_profiler-${version}";
-    version = "0.41";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/memory_profiler/${name}.tar.gz";
-      sha256 = "dce6e931c281662a500b142595517d095267216472c2926e5ec8edab89898d10";
-    };
-
-    # Tests don't import profile
-    doCheck = false;
+  memcached = callPackage ../development/python-modules/memcached { };
 
-    meta = {
-      description = "A module for monitoring memory usage of a python program";
-      homepage = https://pypi.python.org/pypi/memory_profiler;
-      license = licenses.bsd3;
-    };
-  };
+  memory_profiler = callPackage ../development/python-modules/memory_profiler { };
 
   metaphone = callPackage ../development/python-modules/metaphone { };
 
-  mezzanine = buildPythonPackage rec {
-    version = "3.1.10";
-    name = "mezzanine-${version}";
-
-    src = pkgs.fetchurl {
-      url = "https://github.com/stephenmcd/mezzanine/archive/${version}.tar.gz";
-      sha256 = "1cd7d3dji8q4mvcnf9asxn8j109pd5g5d5shr6xvn0iwr35qprgi";
-    };
-    patches = [ ../development/python-modules/mezzanine/writable_settings.patch ];
-
-    disabled = isPyPy;
-
-    buildInputs = with self; [ pyflakes pep8 ];
-    propagatedBuildInputs = with self; [
-      django filebrowser_safe grappelli_safe bleach tzlocal beautifulsoup4
-      requests requests_oauthlib future pillow
-    ];
-
-    # Tests Fail Due to Syntax Warning, Fixed for v3.1.11+
-    doCheck = false;
-    # sed calls will be unecessary in v3.1.11+
-    preConfigure = ''
-      sed -i 's/==/>=/' setup.py
-    '';
-
-    LC_ALL="en_US.UTF-8";
-
-    meta = {
-      description = ''
-        A content management platform built using the Django framework
-      '';
-      longDescription = ''
-        Mezzanine is a powerful, consistent, and flexible content management
-        platform. Built using the Django framework, Mezzanine provides a
-        simple yet highly extensible architecture that encourages diving in and
-        hacking on the code. Mezzanine is BSD licensed and supported by a
-        diverse and active community.
-
-        In some ways, Mezzanine resembles tools such as Wordpress that provide
-        an intuitive interface for managing pages, blog posts, form data, store
-        products, and other types of content. But Mezzanine is also different.
-        Unlike many other platforms that make extensive use of modules or
-        reusable applications, Mezzanine provides most of its functionality by
-        default. This approach yields a more integrated and efficient platform.
-      '';
-      homepage = http://mezzanine.jupo.org/;
-      downloadPage = https://github.com/stephenmcd/mezzanine/releases;
-      license = licenses.free;
-      maintainers = with maintainers; [ prikhi ];
-      platforms = platforms.linux;
-      broken = true; # broken dependency of django within filebrowser_safe
-    };
-  };
+  mezzanine = callPackage ../development/python-modules/mezzanine { };
 
   micawber = callPackage ../development/python-modules/micawber { };
 
   milksnake = callPackage ../development/python-modules/milksnake { };
 
-  minimock = buildPythonPackage rec {
-    version = "1.2.8";
-    name = "minimock-${version}";
-
-    src = pkgs.fetchurl {
-      url = "https://bitbucket.org/jab/minimock/get/${version}.zip";
-      sha256 = "c88fa8a7120623f23990a7f086a9657f6ced09025a55e3be8649a30b4945441a";
-    };
-
-    buildInputs = with self; [ nose ];
-
-    checkPhase = "./test";
-
-    meta = {
-      description = "A minimalistic mocking library for python";
-      homepage = https://pypi.python.org/pypi/MiniMock;
-    };
-  };
-
-  moviepy = buildPythonPackage rec {
-    name = "moviepy-${version}";
-    version = "0.2.2.11";
+  minimock = callPackage ../development/python-modules/minimock { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/moviepy/${name}.tar.gz";
-      sha256 = "d937d817e534efc54eaee2fc4c0e70b48fcd81e1528cd6425f22178704681dc3";
-    };
-
-    # No tests
-    doCheck = false;
-    propagatedBuildInputs = with self; [ numpy decorator imageio tqdm ];
-
-    meta = {
-      description = "Video editing with Python";
-      homepage = http://zulko.github.io/moviepy/;
-      license = licenses.mit;
-    };
-  };
+  moviepy = callPackage ../development/python-modules/moviepy { };
 
   mozterm = callPackage ../development/python-modules/mozterm { };
 
@@ -7016,177 +2752,33 @@ in {
 
   multidict = callPackage ../development/python-modules/multidict { };
 
-  munch = buildPythonPackage rec {
-    name = "munch-${version}";
-    version = "2.0.4";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/munch/${name}.tar.gz";
-      sha256 = "1420683a94f3a2ffc77935ddd28aa9ccb540dd02b75e02ed7ea863db437ab8b2";
-    };
-
-    meta = {
-      description = "A dot-accessible dictionary (a la JavaScript objects)";
-      license = licenses.mit;
-      homepage = https://github.com/Infinidat/munch;
-    };
-  };
+  munch = callPackage ../development/python-modules/munch { };
 
   nototools = callPackage ../data/fonts/noto-fonts/tools.nix { };
 
-  rainbowstream = buildPythonPackage rec {
-    name = "rainbowstream-${version}";
-    version = "1.3.7";
-
-    src = pkgs.fetchurl {
-      url    = "mirror://pypi/r/rainbowstream/${name}.tar.gz";
-      sha256 = "0zpi1x3b535pwx8rkq57nnrb5d5ma65vvlalar9vi6ilp124x1w2";
-    };
-
-    patches = [
-      ../development/python-modules/rainbowstream/image.patch
-    ];
-
-    postPatch = ''
-      clib=$out/${python.sitePackages}/rainbowstream/image.so
-      substituteInPlace rainbowstream/c_image.py \
-        --replace @CLIB@ $clib
-      sed -i 's/requests.*"/requests"/' setup.py
-    '';
-
-    LC_ALL="en_US.UTF-8";
-
-    postInstall = ''
-      mkdir -p $out/lib
-      cc -fPIC -shared -o $clib rainbowstream/image.c
-      for prog in "$out/bin/"*; do
-        wrapProgram "$prog" \
-          --prefix PYTHONPATH : "$PYTHONPATH"
-      done
-    '';
-
-    buildInputs = with self; [
-      pkgs.libjpeg pkgs.freetype pkgs.zlib pkgs.glibcLocales
-      pillow twitter pyfiglet requests arrow dateutil pysocks
-      pocket
-    ];
-
-    meta = {
-      description = "Streaming command-line twitter client";
-      homepage    = "http://www.rainbowstream.org/";
-      license     = licenses.mit;
-      maintainers = with maintainers; [ thoughtpolice ];
-    };
-  };
+  rainbowstream = callPackage ../development/python-modules/rainbowstream { };
 
   pendulum = callPackage ../development/python-modules/pendulum { };
 
-  pocket = buildPythonPackage rec {
-    name = "pocket-${version}";
-    version = "0.3.6";
-
-    src = pkgs.fetchurl {
-      url    = "mirror://pypi/p/pocket/${name}.tar.gz";
-      sha256 = "1fc9vc5nyzf1kzmnrs18dmns7nn8wjfrg7br1w4c5sgs35mg2ywh";
-    };
-
-    buildInputs = with self; [
-      requests
-    ];
-
-    meta = {
-      description = "Wrapper for the pocket API";
-      homepage    = "https://github.com/tapanpandita/pocket";
-      license     = licenses.bsd3;
-      maintainers = with maintainers; [ ericsagnes ];
-    };
-  };
+  pocket = callPackage ../development/python-modules/pocket { };
 
   mistune = callPackage ../development/python-modules/mistune { };
 
   brotlipy = callPackage ../development/python-modules/brotlipy { };
 
-  sortedcollections = buildPythonPackage rec {
-    name = "sortedcollections-${version}";
-    version = "0.4.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/s/sortedcollections/${name}.tar.gz";
-      sha256 = "12dlzln9gyv8smsy2k6d6dmr0ywrpwyrr1cjy649ia5h1g7xdvwa";
-    };
-    buildInputs = [ self.sortedcontainers ];
-
-    # wants to test all python versions with tox:
-    doCheck = false;
-
-    meta = {
-      description = "Python Sorted Collections";
-      homepage = http://www.grantjenks.com/docs/sortedcollections/;
-      license = licenses.asl20;
-    };
-  };
+  sortedcollections = callPackage ../development/python-modules/sortedcollections { };
 
   hyperframe = callPackage ../development/python-modules/hyperframe { };
 
   h2 = callPackage ../development/python-modules/h2 { };
 
-  editorconfig = buildPythonPackage rec {
-    name = "EditorConfig-${version}";
-    version = "0.12.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/e/editorconfig/${name}.tar.gz";
-      sha256 = "1qxqy9wfrpb2ldrk5nzidkpymc55lpf9lg3m8c8a5531jmbwhlwb";
-    };
-
-    meta = {
-      description = "EditorConfig File Locator and Interpreter for Python";
-      homepage = https://editorconfig.org/;
-      license = licenses.psfl;
-    };
-  };
-
-  mock = buildPythonPackage (rec {
-    name = "mock-2.0.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/mock/${name}.tar.gz";
-      sha256 = "1flbpksir5sqrvq2z0dp8sl4bzbadg21sj4d42w3klpdfvgvcn5i";
-    };
-
-    buildInputs = with self; [ unittest2 ];
-    propagatedBuildInputs = with self; [ funcsigs six pbr ];
-
-    checkPhase = ''
-      ${python.interpreter} -m unittest discover
-    '';
+  editorconfig = callPackage ../development/python-modules/editorconfig { };
 
-    meta = {
-      description = "Mock objects for Python";
-      homepage = http://python-mock.sourceforge.net/;
-      license = stdenv.lib.licenses.bsd2;
-    };
-  });
+  mock = callPackage ../development/python-modules/mock { };
 
   mock-open = callPackage ../development/python-modules/mock-open { };
 
-  modestmaps = buildPythonPackage rec {
-    name = "ModestMaps-1.4.6";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/M/ModestMaps/${name}.tar.gz";
-      sha256 = "0vyi1m9q4pc34i6rq5agb4x3qicx5sjlbxwmxfk70k2l5mnbjca3";
-    };
-
-    disabled = !isPy27;
-    propagatedBuildInputs = with self; [ pillow ];
-
-    meta = {
-      description = "A library for building interactive maps";
-      homepage = http://modestmaps.com;
-      license = stdenv.lib.licenses.bsd3;
-    };
-  };
+  modestmaps = callPackage ../development/python-modules/modestmaps { };
 
   # Needed here because moinmoin is loaded as a Python library.
   moinmoin = callPackage ../development/python-modules/moinmoin { };
@@ -7195,125 +2787,17 @@ in {
 
   moto = callPackage ../development/python-modules/moto {};
 
-  mox = buildPythonPackage rec {
-    name = "mox-0.5.3";
+  mox = callPackage ../development/python-modules/mox { };
 
-    src = pkgs.fetchurl {
-      url = "http://pymox.googlecode.com/files/${name}.tar.gz";
-      sha256 = "4d18a4577d14da13d032be21cbdfceed302171c275b72adaa4c5997d589a5030";
-    };
+  mozsvc = callPackage ../development/python-modules/mozsvc { };
 
-    # error: invalid command 'test'
-    doCheck = false;
+  mpmath = callPackage ../development/python-modules/mpmath { };
 
-    meta = {
-      homepage = http://code.google.com/p/pymox/;
-      description = "A mock object framework for Python";
-    };
-  };
+  mpd = callPackage ../development/python-modules/mpd { };
 
-  mozsvc = buildPythonPackage rec {
-    name = "mozsvc-${version}";
-    version = "0.8";
+  mpd2 = callPackage ../development/python-modules/mpd2 { };
 
-    src = pkgs.fetchgit {
-      url = https://github.com/mozilla-services/mozservices.git;
-      rev = "refs/tags/${version}";
-      sha256 = "1zci2ikk83mf7va88c83dr6snfh4ddjqw0lsg3y29qk5nxf80vx2";
-    };
-
-    patches = singleton (pkgs.fetchurl {
-      url = https://github.com/nbp/mozservices/commit/f86c0b0b870cd8f80ce90accde9e16ecb2e88863.diff;
-      sha256 = "1lnghx821f6dqp3pa382ka07cncdz7hq0mkrh44d0q3grvrlrp9n";
-    });
-
-    doCheck = false; # lazy packager
-    propagatedBuildInputs = with self; [ pyramid simplejson konfig ];
-
-    meta = {
-      homepage = https://github.com/mozilla-services/mozservices;
-      description = "Various utilities for Mozilla apps";
-    };
-  };
-
-  mpmath = buildPythonPackage rec {
-    name = "mpmath-0.19";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/mpmath/${name}.tar.gz";
-      sha256 = "08ijsr4ifrqv3cjc26mkw0dbvyygsa99in376hr4b96ddm1gdpb8";
-    };
-
-    meta = {
-      homepage    = http://mpmath.googlecode.com;
-      description = "A pure-Python library for multiprecision floating arithmetic";
-      license     = licenses.bsd3;
-      maintainers = with maintainers; [ lovek323 ];
-      platforms   = platforms.unix;
-    };
-
-    # error: invalid command 'test'
-    doCheck = false;
-  };
-
-
-  mpd = buildPythonPackage rec {
-    name = "python-mpd-0.3.0";
-
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/python-mpd/python-mpd-0.3.0.tar.gz";
-      sha256 = "02812eba1d2e0f46e37457f5a6fa23ba203622e4bcab0a19b265e66b08cd21b4";
-    };
-
-    meta = with pkgs.stdenv.lib; {
-      description = "An MPD (Music Player Daemon) client library written in pure Python";
-      homepage = http://jatreuman.indefero.net/p/python-mpd/;
-      license = licenses.gpl3;
-    };
-  };
-
-  mpd2 = buildPythonPackage rec {
-    name = "mpd2-${version}";
-    version = "0.5.5";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/python-mpd2/python-mpd2-${version}.tar.bz2";
-      sha256 = "1gfrxf71xll1w6zb69znqg5c9j0g7036fsalkvqprh2id640cl3a";
-    };
-
-    buildInputs = with self; [ mock ];
-    patchPhase = ''
-      sed -i -e '/tests_require/d' \
-          -e 's/cmdclass.*/test_suite="mpd_test",/' setup.py
-    '';
-
-    meta = {
-      description = "A Python client module for the Music Player Daemon";
-      homepage = "https://github.com/Mic92/python-mpd2";
-      license = licenses.lgpl3Plus;
-      maintainers = with maintainers; [ rvl mic92 ];
-    };
-  };
-
-  mpv = buildPythonPackage rec {
-    name = "mpv-0.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/mpv/${name}.tar.gz";
-      sha256 = "0b9kd70mshdr713f3l1lbnz1q0vlg2y76h5d8liy1bzqm7hjcgfw";
-    };
-    buildInputs = [ pkgs.mpv ];
-    patchPhase = "substituteInPlace mpv.py --replace libmpv.so ${pkgs.mpv}/lib/libmpv.so";
-
-    meta = with pkgs.stdenv.lib; {
-      description = "A python interface to the mpv media player";
-      homepage = "https://github.com/jaseg/python-mpv";
-      license = licenses.agpl3;
-    };
-
-  };
+  mpv = callPackage ../development/python-modules/mpv { };
 
   mrbob = callPackage ../development/python-modules/mrbob {};
 
@@ -7328,103 +2812,21 @@ in {
     '';
   };
 
-  msrplib = buildPythonPackage rec {
-    pname = "python-msrplib";
-    name = "${pname}-${version}";
-    version = "0.19";
-
-    src = pkgs.fetchdarcs {
-      url = "http://devel.ag-projects.com/repositories/${pname}";
-      rev = "release-${version}";
-      sha256 = "0jqvvssbwzq7bwqn3wrjfnpj8zb558mynn2visnlrcma6b57yhwd";
-    };
-
-    propagatedBuildInputs = with self; [ eventlib application gnutls ];
-  };
+  msrplib = callPackage ../development/python-modules/msrplib { };
 
   multipledispatch = callPackage ../development/python-modules/multipledispatch { };
 
   multiprocess = callPackage ../development/python-modules/multiprocess { };
 
-  munkres = buildPythonPackage rec {
-    name = "munkres-1.0.6";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/munkres/${name}.tar.gz";
-      sha256 = "c78f803b9b776bfb20a25c9c7bb44adbf0f9202c2024d51aa5969d21e560208d";
-    };
-
-    # error: invalid command 'test'
-    doCheck = false;
-
-    meta = {
-      homepage = http://bmc.github.com/munkres/;
-      description = "Munkres algorithm for the Assignment Problem";
-      license = licenses.bsd3;
-      maintainers = with maintainers; [ domenkozar ];
-    };
-  };
+  munkres = callPackage ../development/python-modules/munkres { };
 
+  musicbrainzngs = callPackage ../development/python-modules/musicbrainzngs { };
 
-  musicbrainzngs = buildPythonPackage rec {
-    name = "musicbrainzngs-0.5";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/m/musicbrainzngs/${name}.tar.gz";
-      sha256 = "281388ab750d2996e9feca4580fd4215d616a698e02cd6719cb9b8562945c489";
-    };
-
-    buildInputs = [ pkgs.glibcLocales ];
-
-    LC_ALL="en_US.UTF-8";
-
-    meta = {
-      homepage = http://alastair/python-musicbrainz-ngs;
-      description = "Python bindings for musicbrainz NGS webservice";
-      license = licenses.bsd2;
-      maintainers = with maintainers; [ domenkozar ];
-    };
-  };
-
-  mutag = buildPythonPackage rec {
-    disabled = ! isPy3k;
-    name = "mutag-0.0.2-2ffa0258ca";
-    src = pkgs.fetchgit {
-      url = "https://github.com/aroig/mutag.git";
-      sha256 = "0axdnwdypfd74a9dnw0g25m16xx1yygyl828xy0kpj8gyqdc6gb1";
-      rev = "2ffa0258cadaf79313241f43bf2c1caaf197d9c2";
-    };
-
-    propagatedBuildInputs = with self; [ pyparsing ];
-
-    meta = {
-      homepage = https://github.com/aroig/mutag;
-      license = licenses.gpl3;
-      maintainers = with maintainers; [ ];
-    };
-  };
+  mutag = callPackage ../development/python-modules/mutag { };
 
   mutagen = callPackage ../development/python-modules/mutagen { };
 
-
-  muttils = buildPythonPackage (rec {
-    name = "muttils-1.3";
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = https://www.blacktrash.org/hg/muttils/archive/8bb26094df06.tar.bz2;
-      sha256 = "1a4kxa0fpgg6rdj5p4kggfn8xpniqh8v5kbiaqc6wids02m7kag6";
-    };
-
-    # Tests don't work
-    doCheck = false;
-
-    meta = {
-      description = "Utilities for use with console mail clients, like mutt";
-      homepage = https://www.blacktrash.org/hg/muttils;
-      license = licenses.gpl2Plus;
-    };
-  });
+  muttils = callPackage ../development/python-modules/muttils { };
 
   mygpoclient = callPackage ../development/python-modules/mygpoclient { };
 
@@ -7436,241 +2838,37 @@ in {
 
   mypy-protobuf = callPackage ../development/python-modules/mypy-protobuf { };
 
-  neuronpy = buildPythonPackage rec {
-    name = "neuronpy-${version}";
-    version = "0.1.6";
-    disabled = !isPy27;
-
-    propagatedBuildInputs = with self; [ numpy matplotlib scipy ];
-
-    meta = {
-      description = "Interfaces and utilities for the NEURON simulator and analysis of neural data";
-      maintainers = [ maintainers.nico202 ];
-      license = licenses.mit;
-    };
-
-    #No tests included
-    doCheck = false;
-
-    src = pkgs.fetchurl {
-      url = "https://pypi.python.org/packages/source/n/neuronpy/neuronpy-${version}.tar.gz";
-      sha256 = "1clhc2b5fy2l8nfrji4dagmj9419nj6kam090yqxhq5c28sngk25";
-    };
-  };
-
-  pint = buildPythonPackage rec {
-    name = "pint-${version}";
-    version = "0.7.2";
-
-    meta = {
-      description = "Physical quantities module";
-      license = licenses.bsd3;
-      homepage = "https://github.com/hgrecco/pint/";
-    };
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pint/Pint-${version}.tar.gz";
-      sha256 = "1bbp5s34gcb9il2wyz4spznshahwbjvwi5bhjm7bnxk358spvf9q";
-    };
-  };
+  neuronpy = callPackage ../development/python-modules/neuronpy { };
 
-  pygal = buildPythonPackage rec {
-    pname = "pygal";
-    version = "2.3.1";
-    name = "${pname}-${version}";
-
-    doCheck = !isPyPy;  # one check fails with pypy
+  pint = callPackage ../development/python-modules/pint { };
 
-    src = fetchPypi {
-      inherit pname version;
-      sha256 = "7ba5a191233d0c2d8bf4b4d26b06e42bd77483a59ba7d3e5b884d81d1a870667";
-    };
-
-    buildInputs = with self; [ flask pyquery pytest ];
-    propagatedBuildInputs = with self; [ cairosvg tinycss cssselect ] ++ optionals (!isPyPy) [ lxml ];
-
-    meta = {
-      description = "Sexy and simple python charting";
-      homepage = http://www.pygal.org;
-      license = licenses.lgpl3;
-      maintainers = with maintainers; [ sjourdois ];
-    };
-  };
+  pygal = callPackage ../development/python-modules/pygal { };
 
   pytaglib = callPackage ../development/python-modules/pytaglib { };
 
   pyte = callPackage ../development/python-modules/pyte { };
 
-  graphviz = buildPythonPackage rec {
-    name = "graphviz-${version}";
-    version = "0.9";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/g/graphviz/${name}.zip";
-      sha256 = "14r9brj4r31b3qy1nnn34v3l4h0n39bqxg9sn2fz4p3pp5mglnl6";
-    };
-
-    propagatedBuildInputs = [ pkgs.graphviz ];
-
-    meta = {
-      description = "Simple Python interface for Graphviz";
-      homepage = https://github.com/xflr6/graphviz;
-      license = licenses.mit;
-    };
-  };
+  graphviz = callPackage ../development/python-modules/graphviz { };
 
   pygraphviz = callPackage ../development/python-modules/pygraphviz { };
 
   pymc3 = callPackage ../development/python-modules/pymc3 { };
 
-  pympler = buildPythonPackage rec {
-    pname = "Pympler";
-    version = "0.4.3";
-    name = "${pname}-${version}";
+  pympler = callPackage ../development/python-modules/pympler { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/P/${pname}/${name}.tar.gz";
-      sha256 = "0mhyxqlkha98y8mi5zqcjg23r30mgdjdzs05lghbmqfdyvzjh1a3";
-    };
-
-  # Remove test asizeof.flatsize(), broken and can be missed as
-  # test is only useful on python 2.5, see https://github.com/pympler/pympler/issues/22
-   patchPhase = ''
-     substituteInPlace ./test/asizeof/test_asizeof.py --replace "n, e = test_flatsize" "#n, e = test_flatsize"
-     substituteInPlace ./test/asizeof/test_asizeof.py --replace "self.assert_(n," "#self.assert_(n,"
-     substituteInPlace ./test/asizeof/test_asizeof.py --replace "self.assert_(not e" "#self.assert_(not e"
-    '';
-
-    doCheck = stdenv.hostPlatform.isLinux;
-
-    meta = {
-      description = "Tool to measure, monitor and analyze memory behavior";
-      homepage = https://pythonhosted.org/Pympler/;
-      license = licenses.asl20;
-    };
-  };
-
-  pymysqlsa = self.buildPythonPackage rec {
-    name = "pymysqlsa-${version}";
-    version = "1.0";
-
-    propagatedBuildInputs = with self; [ pymysql sqlalchemy ];
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pymysql_sa/pymysql_sa-1.0.tar.gz";
-      sha256 = "a2676bce514a29b2d6ab418812259b0c2f7564150ac53455420a20bd7935314a";
-    };
-
-    meta = {
-      description = "PyMySQL dialect for SQL Alchemy";
-      homepage = https://pypi.python.org/pypi/pymysql_sa;
-      license = licenses.mit;
-    };
-  };
+  pymysqlsa = callPackage ../development/python-modules/pymysqlsa { };
 
   monosat = disabledIf (!isPy3k) (pkgs.monosat.python { inherit buildPythonPackage; inherit (self) cython; });
 
-  monotonic = buildPythonPackage rec {
-    pname = "monotonic";
-    version = "1.3";
-    name = "${pname}-${version}";
-
-    __propagatedImpureHostDeps = stdenv.lib.optional stdenv.isDarwin "/usr/lib/libc.dylib";
+  monotonic = callPackage ../development/python-modules/monotonic { };
 
-    src = fetchPypi {
-      inherit pname version;
-      sha256 = "06vw7jwq96106plhlc5vz1v1xvjismdgw9wjyzvzf0ylglnrwiib";
-    };
-
-    patchPhase = optionalString stdenv.isLinux ''
-      substituteInPlace monotonic.py --replace \
-        "ctypes.util.find_library('c')" "'${stdenv.glibc.out}/lib/libc.so.6'"
-    '';
-  };
-
-  MySQL_python = buildPythonPackage rec {
-    name = "MySQL-python-1.2.5";
-
-    disabled = isPy3k;
-
-    # plenty of failing tests
-    doCheck = false;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/M/MySQL-python/${name}.zip";
-      sha256 = "0x0c2jg0bb3pp84njaqiic050qkyd7ymwhfvhipnimg58yv40441";
-    };
-
-    buildInputs = with self; [ nose ];
-
-    propagatedBuildInputs = with self; [ pkgs.mysql.connector-c ];
-
-    meta = {
-      description = "MySQL database binding for Python";
-
-      homepage = https://sourceforge.net/projects/mysql-python;
-    };
-  };
+  MySQL_python = callPackage ../development/python-modules/mysql_python { };
 
   mysql-connector = callPackage ../development/python-modules/mysql-connector { };
 
-  namebench = buildPythonPackage (rec {
-    name = "namebench-1.3.1";
-    disabled = isPy3k || isPyPy;
-
-    src = pkgs.fetchurl {
-      url = "http://namebench.googlecode.com/files/${name}-source.tgz";
-      sha256 = "09clbcd6wxgk4r6qw7hb78h818mvca7lijigy1mlq5y1f3lgkk1h";
-    };
-
-    # error: invalid command 'test'
-    doCheck = false;
-
-    propagatedBuildInputs = [ self.tkinter ];
-
-    # namebench expects to be run from its own source tree (it uses relative
-    # paths to various resources), make it work.
-    postInstall = ''
-      sed -i "s|import os|import os; os.chdir(\"$out/namebench\")|" "$out/bin/namebench.py"
-    '';
-
-    meta = {
-      homepage = http://namebench.googlecode.com/;
-      description = "Find fastest DNS servers available";
-      license = with licenses; [
-        asl20
-        # third-party program licenses (embedded in the sources)
-        "LGPL" # Crystal_Clear
-        free # dns
-        asl20 # graphy
-        "BSD" # jinja2
-      ];
-      longDescription = ''
-        It hunts down the fastest DNS servers available for your computer to
-        use. namebench runs a fair and thorough benchmark using your web
-        browser history, tcpdump output, or standardized datasets in order
-        to provide an individualized recommendation. namebench is completely
-        free and does not modify your system in any way.
-      '';
-    };
-  });
-
-
-  nameparser = buildPythonPackage rec {
-    name = "nameparser-${version}";
-    version = "0.3.4";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/n/nameparser/${name}.tar.gz";
-      sha256 = "1zi94m99ziwwd6kkip3w2xpnl05r2cfv9iq68inz7np81c3g8vag";
-    };
+  namebench = callPackage ../development/python-modules/namebench { };
 
-    meta = {
-      description = "A simple Python module for parsing human names into their individual components";
-      homepage = https://github.com/derek73/python-nameparser;
-      license = licenses.lgpl21Plus;
-    };
-  };
+  nameparser = callPackage ../development/python-modules/nameparser { };
 
   nbconvert = callPackage ../development/python-modules/nbconvert { };
 
@@ -7680,119 +2878,15 @@ in {
 
   nbxmpp = callPackage ../development/python-modules/nbxmpp { };
 
-  sleekxmpp = buildPythonPackage rec {
-    name = "sleekxmpp-${version}";
-    version = "1.3.3";
-
-    patches = [
-      # Fix https://github.com/etingof/pyasn1/issues/112
-      (pkgs.fetchpatch {
-        url = "https://github.com/kdschlosser/SleekXMPP/commit/597014ba5ca258763e96ee37729ac933c5af1602.patch";
-        sha256 = "176v3f3pr0bx48wv1kf9jn2pwxdn7qpqyc2chwv1m8gbppsfaikf";
-      })
-    ];
-
-    propagatedBuildInputs = with self; [ dnspython pyasn1 pyasn1-modules gevent ];
-    checkInputs = [ pkgs.gnupg ];
-    checkPhase = "${python.interpreter} testall.py";
-    doCheck = false; # Tests failed all this time and upstream doesn't seem to care.
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/s/sleekxmpp/${name}.tar.gz";
-      sha256 = "0samiq1d97kk8g9pszfbrbfw9zc41zp6017dbkwha9frf7gc24yj";
-    };
-
-    meta = {
-      description = "XMPP library for Python";
-      license = licenses.mit;
-      homepage = http://sleekxmpp.com/;
-    };
-  };
-
-  slixmpp = buildPythonPackage rec {
-    name = "slixmpp-${version}";
-    version = "1.2.4.post1";
-
-    disabled = pythonOlder "3.4";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/s/slixmpp/${name}.tar.gz";
-      sha256 = "0v6430dczai8a2nmznhja2dxl6pxa8c5j20nhc5737bqjg7245jk";
-    };
-
-    patchPhase = ''
-      substituteInPlace slixmpp/thirdparty/gnupg.py \
-        --replace "gpgbinary='gpg'" "gpgbinary='${pkgs.gnupg1}/bin/gpg'"
-    '';
+  sleekxmpp = callPackage ../development/python-modules/sleekxmpp { };
 
-    propagatedBuildInputs = with self ; [ aiodns pyasn1 pkgs.gnupg1 pyasn1-modules];
+  slixmpp = callPackage ../development/python-modules/slixmpp { };
 
-    meta = {
-      description = "Elegant Python library for XMPP";
-      license = licenses.mit;
-      homepage = https://dev.louiz.org/projects/slixmpp;
-    };
-  };
+  netaddr = callPackage ../development/python-modules/netaddr { };
 
-  netaddr = buildPythonPackage rec {
-    pname = "netaddr";
-    version = "0.7.19";
-    name = "${pname}-${version}";
+  netifaces = callPackage ../development/python-modules/netifaces { };
 
-    src = fetchPypi {
-      inherit pname version;
-      sha256 = "38aeec7cdd035081d3a4c306394b19d677623bf76fa0913f6695127c7753aefd";
-    };
-
-    LC_ALL = "en_US.UTF-8";
-    buildInputs = with self; [ pkgs.glibcLocales pytest ];
-
-    checkPhase = ''
-      py.test netaddr/tests
-    '';
-
-    patches = [
-      (pkgs.fetchpatch {
-        url = https://github.com/drkjam/netaddr/commit/2ab73f10be7069c9412e853d2d0caf29bd624012.patch;
-        sha256 = "0s1cdn9v5alpviabhcjmzc0m2pnpq9dh2fnnk2x96dnry1pshg39";
-      })
-    ];
-
-    meta = {
-      homepage = https://github.com/drkjam/netaddr/;
-      description = "A network address manipulation library for Python";
-    };
-  };
-
-  netifaces = buildPythonPackage rec {
-    version = "0.10.6";
-    name = "netifaces-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/n/netifaces/${name}.tar.gz";
-      sha256 = "1q7bi5k2r955rlcpspx4salvkkpk28jky67fjbpz2dkdycisak8c";
-    };
-
-    meta = {
-      homepage = https://alastairs-place.net/projects/netifaces/;
-      description = "Portable access to network interfaces from Python";
-    };
-  };
-
-  hpack = buildPythonPackage rec {
-    name = "hpack-${version}";
-    version = "2.3.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/h/hpack/hpack-${version}.tar.gz";
-      sha256 = "1ad0fx4d7a52zf441qzhjc7vwy9v3qdrk1zyf06ikz8y2nl9mgai";
-    };
-
-    meta = with stdenv.lib; {
-      description = "========================================";
-      homepage = "http://hyper.rtfd.org";
-    };
-  };
+  hpack = callPackage ../development/python-modules/hpack { };
 
   nevow = callPackage ../development/python-modules/nevow { };
 
@@ -7802,326 +2896,51 @@ in {
 
   nimfa = callPackage ../development/python-modules/nimfa {};
 
-  nipy = buildPythonPackage rec {
-    version = "0.4.0";
-    name = "nipy-${version}";
-
-    disabled = pythonOlder "2.6";
-
-    checkPhase = ''    # wants to be run in a different directory
-      mkdir nosetests
-      cd nosetests
-      ${python.interpreter} -c "import nipy; nipy.test()"
-      rm -rf .
-    '';
-    # failing test:
-    # nipy.algorithms.statistics.models.tests.test_olsR.test_results(11.593139639404727, 11.593140144880794, 6)  # disagrees by 1 at 6th decimal place
-    # erroring tests:
-    # nipy.modalities.fmri.fmristat.tests.test_FIAC.test_altprotocol
-    # nipy.modalities.fmri.fmristat.tests.test_FIAC.test_agreement
-    # nipy.tests.test_scripts.test_nipy_4d_realign   # because `nipy_4d_realign` script isn't found at test time; works from nix-shell, so could be patched
-    # nipy.tests.test_scripts.test_nipy_3_4d         # ditto re.: `nipy_3_4d` script
-    doCheck = false;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/n/nipy/${name}.tar.gz";
-      sha256 = "1hnbn2i4fjxflaaz082s2c57hfp59jfra1zayz1iras5p2dy21nr";
-    };
-
-    buildInputs = stdenv.lib.optional doCheck [ self.nose ];
-
-    propagatedBuildInputs = with self; [
-      matplotlib
-      nibabel
-      numpy
-      scipy
-      sympy
-    ];
-
-    meta = {
-      homepage = http://nipy.org/nipy/;
-      description = "Software for structural and functional neuroimaging analysis";
-      license = licenses.bsd3;
-    };
-  };
+  nipy = callPackage ../development/python-modules/nipy { };
 
   nipype = callPackage ../development/python-modules/nipype {
     inherit (pkgs) which;
   };
 
-  nixpkgs = buildPythonPackage rec {
-    disabled = ! pythonAtLeast "3.5";
-    pname = "nixpkgs";
-    version = "0.2.2";
-    src = fetchPypi {
-      inherit pname version;
-      sha256 = "0gsrd99kkv99jsrh3hckz7ns1zwndi9vvh4465v4gnpz723dd6fj";
-    };
-    buildInputs = with self; [ pbr ];
-    propagatedBuildInputs = with self; [ pythonix ];
-    meta = {
-      description = "Allows to `from nixpkgs import` stuff in interactive Python sessions";
-      homepage = http://github.com/t184256/nixpkgs-python-importer;
-      license = licenses.mit;
-      maintainers = with maintainers; [ t184256 ];
-    };
-  };
+  nixpkgs = callPackage ../development/python-modules/nixpkgs { };
 
   nodeenv = callPackage ../development/python-modules/nodeenv { };
 
-  nose = buildPythonPackage rec {
-    version = "1.3.7";
-    name = "nose-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/n/nose/${name}.tar.gz";
-      sha256 = "f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98";
-    };
-
-    propagatedBuildInputs = [ self.coverage ];
-
-    doCheck = false;  # lot's of transient errors, too much hassle
-    checkPhase = if python.is_py3k or false then ''
-      ${python}/bin/${python.executable} setup.py build_tests
-    '' else "" + ''
-      rm functional_tests/test_multiprocessing/test_concurrent_shared.py* # see https://github.com/nose-devs/nose/commit/226bc671c73643887b36b8467b34ad485c2df062
-      ${python}/bin/${python.executable} selftest.py
-    '';
-
-    meta = {
-      description = "A unittest-based testing framework for python that makes writing and running tests easier";
-    };
-  };
+  nose = callPackage ../development/python-modules/nose { };
 
   nose-exclude = callPackage ../development/python-modules/nose-exclude { };
 
-  nose2 = buildPythonPackage rec {
-    name = "nose2-0.5.0";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/n/nose2/${name}.tar.gz";
-      sha256 = "0595rh6b6dncbj0jigsyrgrh6h8fsl6w1fr69h76mxv9nllv0rlr";
-    };
-    meta = {
-      description = "nose2 is the next generation of nicer testing for Python";
-    };
-    propagatedBuildInputs = with self; [ six ];
-    # AttributeError: 'module' object has no attribute 'collector'
-    doCheck = false;
-  };
-
-  nose-cover3 = buildPythonPackage rec {
-    name = "nose-cover3-${version}";
-    version = "0.1.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/n/nose-cover3/${name}.tar.gz";
-      sha256 = "1la4hhc1yszjpcchvkqk5xmzlb2g1b3fgxj9wwc58qc549whlcc1";
-    };
-
-    propagatedBuildInputs = with self; [ nose ];
-
-    # No tests included
-    doCheck = false;
-
-    meta = {
-      description = "Coverage 3.x support for Nose";
-      homepage = https://github.com/ask/nosecover3;
-      license = licenses.lgpl21;
-    };
-  };
-
-  nosexcover = buildPythonPackage (rec {
-    name = "nosexcover-1.0.10";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/n/nosexcover/${name}.tar.gz";
-      sha256 = "f5b3a7c936c4f703f15418c1f325775098184b69fa572f868edb8a99f8f144a8";
-    };
-
-    propagatedBuildInputs = with self; [ coverage nose ];
-
-    meta = {
-      description = "Extends nose.plugins.cover to add Cobertura-style XML reports";
-
-      homepage = https://github.com/cmheisel/nose-xcover/;
-
-      license = licenses.bsd3;
-    };
-  });
-
-  nosejs = buildPythonPackage {
-    name = "nosejs-0.9.4";
-    src = pkgs.fetchurl {
-      url = mirror://pypi/N/NoseJS/NoseJS-0.9.4.tar.gz;
-      sha256 = "0qrhkd3sga56qf6k0sqyhwfcladwi05gl6aqmr0xriiq1sgva5dy";
-    };
-    buildInputs = with self; [ nose ];
-
-    checkPhase = ''
-      nosetests -v
-    '';
-
-  };
+  nose2 = callPackage ../development/python-modules/nose2 { };
 
-  nose-cprof = buildPythonPackage rec {
-    name = "nose-cprof-${version}";
-    version = "0.1.4";
+  nose-cover3 = callPackage ../development/python-modules/nose-cover3 { };
 
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/n/nose-cprof/${name}.tar.gz";
-      sha256 = "0ayy5mbjly9aa9dkgpz0l06flspnxmnj6wxdl6zr59byrrr8fqhw";
-    };
+  nosexcover = callPackage ../development/python-modules/nosexcover { };
 
-    meta = {
-      description = "A python nose plugin to profile using cProfile rather than the default Hotshot profiler";
-    };
+  nosejs = callPackage ../development/python-modules/nosejs { };
 
-    buildInputs = with self; [ nose ];
-  };
+  nose-cprof = callPackage ../development/python-modules/nose-cprof { };
 
   nose_warnings_filters = callPackage ../development/python-modules/nose_warnings_filters { };
 
   notebook = callPackage ../development/python-modules/notebook { };
 
-  notify = pkgs.stdenv.mkDerivation (rec {
-    name = "python-notify-0.1.1";
-
-    src = pkgs.fetchurl {
-      url = http://www.galago-project.org/files/releases/source/notify-python/notify-python-0.1.1.tar.bz2;
-      sha256 = "1kh4spwgqxm534qlzzf2ijchckvs0pwjxl1irhicjmlg7mybnfvx";
-    };
-
-    patches = singleton (pkgs.fetchurl {
-      name = "libnotify07.patch";
-      url = "http://src.fedoraproject.org/cgit/notify-python.git/plain/"
-          + "libnotify07.patch?id2=289573d50ae4838a1658d573d2c9f4c75e86db0c";
-      sha256 = "1lqdli13mfb59xxbq4rbq1f0znh6xr17ljjhwmzqb79jl3dig12z";
-    });
-
-    postPatch = ''
-      sed -i -e '/^PYGTK_CODEGEN/s|=.*|="${self.pygtk}/bin/pygtk-codegen-2.0"|' \
-        configure
-    '';
-
-    nativeBuildInputs = [ pkgs.pkgconfig ];
-    buildInputs = with self; [ python pkgs.libnotify pygobject2 pygtk pkgs.glib pkgs.gtk2 pkgs.dbus-glib ];
-
-    postInstall = "cd $out/lib/python*/site-packages && ln -s gtk-*/pynotify .";
-
-    meta = {
-      description = "Python bindings for libnotify";
-      homepage = http://www.galago-project.org/;
-    };
-  });
+  notify = callPackage ../development/python-modules/notify { };
 
   notify2 = callPackage ../development/python-modules/notify2 {};
 
-  notmuch = buildPythonPackage rec {
-    name = "python-${pkgs.notmuch.name}";
-
-    src = pkgs.notmuch.src;
-
-    sourceRoot = pkgs.notmuch.pythonSourceRoot;
-
-    buildInputs = with self; [ python pkgs.notmuch ];
-
-    postPatch = ''
-      sed -i -e '/CDLL/s@"libnotmuch\.@"${pkgs.notmuch}/lib/libnotmuch.@' \
-        notmuch/globals.py
-    '';
-
-    meta = {
-      description = "A Python wrapper around notmuch";
-      homepage = https://notmuchmail.org/;
-      maintainers = with maintainers; [ garbas ];
-    };
-  };
+  notmuch = callPackage ../development/python-modules/notmuch { };
 
   emoji = callPackage ../development/python-modules/emoji { };
 
-  ntfy = buildPythonPackage rec {
-    version = "1.2.0";
-    name = "ntfy-${version}";
-    src = pkgs.fetchFromGitHub {
-      owner = "dschep";
-      repo = "ntfy";
-      rev = "v${version}";
-      sha256 = "0yjxwisxpxy3vpnqk9nw5k3db3xx6wyf6sk1px9m94s30glcq2cc";
-    };
-
-    propagatedBuildInputs = with self; [ appdirs pyyaml requests dbus-python emoji sleekxmpp mock ];
+  ntfy = callPackage ../development/python-modules/ntfy { };
 
-    meta = {
-      description = "A utility for sending notifications, on demand and when commands finish";
-      homepage = http://ntfy.rtfd.org/;
-      license = licenses.gpl3;
-      maintainers = with maintainers; [ kamilchm ];
-    };
-  };
-
-  ntplib = buildPythonPackage rec {
-    name = "ntplib-0.3.3";
-    src = pkgs.fetchurl {
-      url = mirror://pypi/n/ntplib/ntplib-0.3.3.tar.gz;
-      sha256 = "c4621b64d50be9461d9bd9a71ba0b4af06fbbf818bbd483752d95c1a4e273ede";
-    };
-
-    # Require networking
-    doCheck = false;
-
-    meta = {
-      description = "Python NTP library";
-      license = licenses.mit;
-    };
-  };
+  ntplib = callPackage ../development/python-modules/ntplib { };
 
   numba = callPackage ../development/python-modules/numba { };
 
   numexpr = callPackage ../development/python-modules/numexpr { };
 
-  Nuitka = let
-    # scons is needed but using it requires Python 2.7
-    # Therefore we create a separate env for it.
-    scons = pkgs.python27.withPackages(ps: [ pkgs.scons ]);
-  in buildPythonPackage rec {
-    version = "0.5.25";
-    name = "Nuitka-${version}";
-
-    # Latest version is not yet on PyPi
-    src = pkgs.fetchurl {
-      url = "https://github.com/kayhayen/Nuitka/archive/${version}.tar.gz";
-      sha256 = "11psz0pyj56adv4b3f47hl8jakvp2mc2c85s092a5rsv1la1a0aa";
-    };
-
-    buildInputs = with self; stdenv.lib.optionals doCheck [ vmprof pyqt4 ];
-
-    propagatedBuildInputs = [ scons ];
-
-    postPatch = ''
-      patchShebangs tests/run-tests
-    '' + stdenv.lib.optionalString stdenv.isLinux ''
-      substituteInPlace nuitka/plugins/standard/ImplicitImports.py --replace 'locateDLL("uuid")' '"${pkgs.utillinux.out}/lib/libuuid.so"'
-    '';
-
-    # We do not want any wrappers here.
-    postFixup = '''';
-
-    checkPhase = ''
-      tests/run-tests
-    '';
-
-    # Problem with a subprocess (parts)
-    doCheck = false;
-
-    # Requires CPython
-    disabled = isPyPy;
-
-    meta = {
-      description = "Python compiler with full language support and CPython compatibility";
-      license = licenses.asl20;
-      homepage = http://nuitka.net/;
-    };
-  };
+  Nuitka = callPackage ../development/python-modules/nuitka { };
 
   numpy = callPackage ../development/python-modules/numpy {
     blas = pkgs.openblasCompat;
@@ -8135,323 +2954,47 @@ in {
 
   nwdiag = callPackage ../development/python-modules/nwdiag { };
 
-  dynd = buildPythonPackage rec {
-    version = "0.7.2";
-    name = "dynd-${version}";
-    disabled = isPyPy || !isPy3k; # tests fail on python2, 2018-04-11
-
-    src = pkgs.fetchFromGitHub {
-      owner = "libdynd";
-      repo = "dynd-python";
-      rev = "v${version}";
-      sha256 = "19igd6ibf9araqhq9bxmzbzdz05vp089zxvddkiik3b5gb7l17nh";
-    };
-
-    # setup.py invokes git on build but we're fetching a tarball, so
-    # can't retrieve git version. We hardcode:
-    preConfigure = ''
-      substituteInPlace setup.py --replace "ver = check_output(['git', 'describe', '--dirty'," "ver = '${version}'"
-      substituteInPlace setup.py --replace "'--always', '--match', 'v*']).decode('ascii').strip('\n')" ""
-    '';
-
-    # Python 3 works but has a broken import test that I couldn't
-    # figure out.
-    doCheck = !isPy3k;
-    buildInputs = with pkgs; [ cmake libdynd.dev self.cython ];
-    propagatedBuildInputs = with self; [ numpy pkgs.libdynd ];
-
-    meta = {
-      homepage = http://libdynd.org;
-      license = licenses.bsd2;
-      description = "Python exposure of dynd";
-      maintainers = with maintainers; [ teh ];
-    };
-  };
+  dynd = callPackage ../development/python-modules/dynd { };
 
   langcodes = callPackage ../development/python-modules/langcodes { };
 
-  livestreamer = buildPythonPackage rec {
-    version = "1.12.2";
-    name = "livestreamer-${version}";
-    disabled = isPyPy;
+  livestreamer = callPackage ../development/python-modules/livestreamer { };
 
-    src = pkgs.fetchurl {
-      url = "https://github.com/chrippa/livestreamer/archive/v${version}.tar.gz";
-      sha256 = "1fp3d3z2grb1ls97smjkraazpxnvajda2d1g1378s6gzmda2jvjd";
-    };
+  livestreamer-curses = callPackage ../development/python-modules/livestreamer-curses { };
 
-    buildInputs = [ pkgs.makeWrapper ];
+  oauth = callPackage ../development/python-modules/oauth { };
 
-    propagatedBuildInputs = with self; [ pkgs.rtmpdump pycrypto requests ]
-      ++ optionals isPy27 [ singledispatch futures ]
-      ++ optionals isPy33 [ singledispatch ];
-
-    postInstall = ''
-      wrapProgram $out/bin/livestreamer --prefix PATH : ${pkgs.rtmpdump}/bin
-    '';
-
-    meta = {
-      homepage = http://livestreamer.tanuki.se;
-      description = ''
-        Livestreamer is CLI program that extracts streams from various
-        services and pipes them into a video player of choice.
-      '';
-      license = licenses.bsd2;
-      maintainers = with maintainers; [ fuuzetsu ];
-    };
-  };
-
-  livestreamer-curses = buildPythonPackage rec {
-    version = "1.5.2";
-    name = "livestreamer-curses-${version}";
-    disabled = isPyPy;
-
-    src = pkgs.fetchurl {
-      url = "https://github.com/gapato/livestreamer-curses/archive/v${version}.tar.gz";
-      sha256 = "1v49sym6mrci9dxy0a7cpbp4bv6fg2ijj6rwk4wzg18c2x4qzkhn";
-    };
-
-    propagatedBuildInputs = with self; [ livestreamer ];
-
-    meta = {
-      homepage = https://github.com/gapato/livestreamer-curses;
-      description = "Curses frontend for livestreamer";
-      license = licenses.mit;
-    };
-  };
-
-  oauth = buildPythonPackage (rec {
-    name = "oauth-1.0.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/o/oauth/oauth-1.0.1.tar.gz";
-      sha256 = "0pdgi35hczsslil4890xqawnbpdazkgf2v1443847h5hy2gq2sg7";
-    };
-
-    # No tests included in archive
-    doCheck = false;
-
-    meta = {
-      homepage = http://code.google.com/p/oauth;
-      description = "Library for OAuth version 1.0a";
-      license = licenses.mit;
-      platforms = platforms.all;
-    };
-  });
-
-  oauth2 = buildPythonPackage (rec {
-    name = "oauth2-${version}";
-    version = "1.9.0.post1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/o/oauth2/${name}.tar.gz";
-      sha256 = "c006a85e7c60107c7cc6da1b184b5c719f6dd7202098196dfa6e55df669b59bf";
-    };
-
-    propagatedBuildInputs = with self; [ httplib2 ];
-
-    buildInputs = with self; [ mock coverage ];
-
-    # ServerNotFoundError: Unable to find the server at oauth-sandbox.sevengoslings.net
-    doCheck = false;
-
-    meta = {
-      homepage = "https://github.com/simplegeo/python-oauth2";
-      description = "Library for OAuth version 1.0";
-      license = licenses.mit;
-      maintainers = with maintainers; [ garbas ];
-      platforms = platforms.linux;
-    };
-  });
+  oauth2 = callPackage ../development/python-modules/oauth2 { };
 
   oauth2client = callPackage ../development/python-modules/oauth2client { };
 
-  oauthlib = buildPythonPackage rec {
-    version = "2.0.0";
-    name = "oauthlib-${version}";
-
-    src = pkgs.fetchurl {
-      url = "https://github.com/idan/oauthlib/archive/v${version}.tar.gz";
-      sha256 = "02b645a8rqh4xfs1cmj8sss8wqppiadd1ndq3av1cdjz2frfqcjf";
-    };
-
-    buildInputs = with self; [ mock nose unittest2 ];
+  oauthlib = callPackage ../development/python-modules/oauthlib { };
 
-    propagatedBuildInputs = with self; [ cryptography blinker pyjwt ];
+  obfsproxy = callPackage ../development/python-modules/obfsproxy { };
 
-    meta = {
-      homepage = https://github.com/idan/oauthlib;
-      downloadPage = https://github.com/idan/oauthlib/releases;
-      description = "A generic, spec-compliant, thorough implementation of the OAuth request-signing logic";
-      maintainers = with maintainers; [ prikhi ];
-    };
-  };
-
-
-  obfsproxy = buildPythonPackage ( rec {
-    name = "obfsproxy-${version}";
-    version = "0.2.13";
-
-    src = pkgs.fetchgit {
-      url = meta.repositories.git;
-      rev = "refs/tags/${name}";
-      sha256 = "04ja1cl8xzqnwrd2gi6nlnxbmjri141bzwa5gybvr44d8h3k2nfa";
-    };
-
-    postPatch = ''
-      substituteInPlace setup.py --replace "version=versioneer.get_version()" "version='${version}'"
-      substituteInPlace setup.py --replace "argparse" ""
-    '';
-
-    propagatedBuildInputs = with self;
-      [ pyptlib argparse twisted pycrypto pyyaml ];
-
-    # No tests in archive
-    doCheck = false;
-
-    meta = {
-      description = "A pluggable transport proxy";
-      homepage = https://www.torproject.org/projects/obfsproxy;
-      repositories.git = https://git.torproject.org/pluggable-transports/obfsproxy.git;
-      maintainers = with maintainers; [ phreedom thoughtpolice ];
-    };
-  });
-
-  objgraph = buildPythonPackage rec {
-    name = "objgraph-${version}";
-    version = "2.0.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/o/objgraph/${name}.tar.gz";
-      sha256 = "841de52715774ec1d0e97d9b4462d6e3e10406155f9b61f54ba7db984c45442a";
-    };
-
-    # Tests fail with PyPy.
-    disabled = isPyPy;
-
-    propagatedBuildInputs = with self; [pkgs.graphviz];
-
-    meta = {
-      description = "Draws Python object reference graphs with graphviz";
-      homepage = https://mg.pov.lt/objgraph/;
-      license = licenses.mit;
-    };
-  };
+  objgraph = callPackage ../development/python-modules/objgraph { };
 
   odo = callPackage ../development/python-modules/odo { };
 
-  offtrac = buildPythonPackage rec {
-    name = "offtrac-0.1.0";
-    meta.maintainers = with maintainers; [ ];
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/o/offtrac/${name}.tar.gz";
-      sha256 = "06vd010pa1z7lyfj1na30iqzffr4kzj2k2sba09spik7drlvvl56";
-    };
-    doCheck = false;
-  };
+  offtrac = callPackage ../development/python-modules/offtrac { };
 
   openpyxl = callPackage ../development/python-modules/openpyxl { };
 
   opentimestamps = callPackage ../development/python-modules/opentimestamps { };
 
-  ordereddict = buildPythonPackage rec {
-    name = "ordereddict-${version}";
-    version = "1.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/o/ordereddict/${name}.tar.gz";
-      sha256 = "07qvy11nvgxpzarrni3wrww3vpc9yafgi2bch4j2vvvc42nb8d8w";
-    };
-
-    meta = {
-      description = "A drop-in substitute for Py2.7's new collections.OrderedDict that works in Python 2.4-2.6";
-      license = licenses.bsd3;
-      maintainers = with maintainers; [ garbas ];
-    };
-  };
+  ordereddict = callPackage ../development/python-modules/ordereddict { };
 
   orderedset = callPackage ../development/python-modules/orderedset { };
 
-  python-otr = buildPythonPackage rec {
-    name = "${pname}-${version}";
-    pname = "python-otr";
-    version = "1.2.0";
-
-    disabled = isPy3k;
-
-    src = pkgs.fetchFromGitHub {
-      owner = "AGProjects";
-      repo = pname;
-      rev = "release-" + version;
-      sha256 = "0p3b1n8jlxwd65gbk2k5007fkhdyjwcvr4982s42hncivxvabzzy";
-    };
-
-    propagatedBuildInputs = with self; [ zope_interface cryptography application gmpy2 ];
-
-    meta = {
-      description = "A pure python implementation of OTR";
-      homepage = https://github.com/AGProjects/otr;
-      license = licenses.lgpl21Plus;
-      platforms = platforms.linux;
-      maintainers = with maintainers; [ edwtjo ];
-    };
-  };
+  python-otr = callPackage ../development/python-modules/python-otr { };
 
   plone-testing = callPackage ../development/python-modules/plone-testing { };
 
   ply = callPackage ../development/python-modules/ply { };
 
-  plyvel = buildPythonPackage (rec {
-    name = "plyvel-0.9";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/plyvel/${name}.tar.gz";
-      sha256 = "1scq75qyks9vmjd19bx57f2y60mkdr44ajvb12p3cjg439l96zaq";
-    };
-
-    buildInputs = with self; [ pkgs.leveldb ]
-                            ++ optional isPy3k pytest;
-
-    # no tests for python2
-    doCheck = isPy3k;
-
-    meta = {
-      description = "Fast and feature-rich Python interface to LevelDB";
-      homepage = https://github.com/wbolster/plyvel;
-      license = licenses.bsd3;
-    };
-  });
+  plyvel = callPackage ../development/python-modules/plyvel { };
 
-  osc = buildPythonPackage {
-    name = "osc-0.162.0-55-gb730f88";
-    disabled = isPy3k;
-    src = pkgs.fetchFromGitHub {
-      owner = "openSUSE";
-      repo = "osc";
-      rev = "b730f880cfe85a8547f569355a21706f27ebfa78";
-      sha256 = "0hh9j5zd2kc0804d2jmf1q3w5xm9l9s69hhgysbncrv5fw0414lh";
-    };
-    buildInputs = with pkgs; [ bashInteractive ]; # needed for bash-completion helper
-    propagatedBuildInputs = with self; [ urlgrabber m2crypto pyyaml lxml ];
-    postInstall = ''
-      ln -s $out/bin/osc-wrapper.py $out/bin/osc
-      install -D -m444 osc.fish $out/etc/fish/completions/osc.fish
-      install -D -m555 dist/osc.complete $out/share/bash-completion/helpers/osc-helper
-      mkdir -p $out/share/bash-completion/completions
-      cat >>$out/share/bash-completion/completions/osc <<EOF
-      test -z "\$BASH_VERSION" && return
-      complete -o default _nullcommand >/dev/null 2>&1 || return
-      complete -r _nullcommand >/dev/null 2>&1         || return
-      complete -o default -C $out/share/bash-completion/helpers/osc-helper osc
-      EOF
-    '';
-    meta = {
-      description = "opensuse-commander with svn like handling";
-      maintainers = [ maintainers.peti ];
-      license = licenses.gpl2;
-    };
-  };
+  osc = callPackage ../development/python-modules/osc { };
 
   rfc3986 = callPackage ../development/python-modules/rfc3986 { };
 
@@ -8462,143 +3005,27 @@ in {
   cmd2_9 = callPackage ../development/python-modules/cmd2 {};
   cmd2 = if isPy27 then self.cmd2_8 else self.cmd2_9;
 
- warlock = buildPythonPackage rec {
-   name = "warlock-${version}";
-   version = "1.2.0";
-
-   src = pkgs.fetchurl {
-     url = "mirror://pypi/w/warlock/${name}.tar.gz";
-     sha256 = "0npgi4ks0nww2d6ci791iayab0j6kz6dx3jr7bhpgkql3s4if3bw";
-   };
-
-   propagatedBuildInputs = with self; [
-     six jsonpatch jsonschema jsonpointer
-   ];
-   buildInputs = with self; [
-
-   ];
-
-   meta = with stdenv.lib; {
-     homepage = https://github.com/bcwaldon/warlock;
-   };
- };
-
+  warlock = callPackage ../development/python-modules/warlock { };
 
   pecan = callPackage ../development/python-modules/pecan { };
 
   kaitaistruct = callPackage ../development/python-modules/kaitaistruct { };
 
-  Kajiki = buildPythonPackage rec {
-    name = "Kajiki-${version}";
-    version = "0.5.5";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/K/Kajiki/${name}.tar.gz";
-      sha256 = "effcae388e25c3358eb0bbd733448509d11a1ec500e46c69241fc673021f0517";
-    };
-
-    propagatedBuildInputs = with self; [
-      Babel pytz nine
-    ];
-    meta = with stdenv.lib; {
-      description = "Kajiki provides fast well-formed XML templates";
-      homepage = "https://github.com/nandoflorestan/kajiki";
-    };
-  };
+  Kajiki = callPackage ../development/python-modules/kajiki { };
 
   WSME = callPackage ../development/python-modules/WSME { };
 
-  zake = buildPythonPackage rec {
-    name = "zake-${version}";
-    version = "0.2.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/z/zake/${name}.tar.gz";
-      sha256 = "1rp4xxy7qp0s0wnq3ig4ji8xsl31g901qkdp339ndxn466cqal2s";
-    };
-
-    propagatedBuildInputs = with self; [ kazoo six ];
-    buildInputs = with self; [ testtools ];
-    checkPhase = ''
-      ${python.interpreter} -m unittest discover zake/tests
-    '';
-
-    meta = with stdenv.lib; {
-      homepage = "https://github.com/yahoo/Zake";
-    };
-  };
-
-  kazoo = buildPythonPackage rec {
-    name = "kazoo-${version}";
-    version = "2.2.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/k/kazoo/${name}.tar.gz";
-      sha256 = "10pb864if9qi2pq9lfb9m8f7z7ss6rml80gf1d9h64lap5crjnjj";
-    };
-
-    propagatedBuildInputs = with self; [
-      six
-    ];
-    buildInputs = with self; [
-      eventlet gevent nose mock coverage pkgs.openjdk8
-    ];
-
-    # not really needed
-    preBuild = ''
-      sed -i '/flake8/d' setup.py
-    '';
-
-    preCheck = ''
-      sed -i 's/test_unicode_auth/noop/' kazoo/tests/test_client.py
-    '';
+  zake = callPackage ../development/python-modules/zake { };
 
-    # tests take a long time to run and leave threads hanging
-    doCheck = false;
-    #ZOOKEEPER_PATH = "${pkgs.zookeeper}";
-
-    meta = with stdenv.lib; {
-      homepage = "https://kazoo.readthedocs.org";
-    };
-  };
+  kazoo = callPackage ../development/python-modules/kazoo { };
 
   FormEncode = callPackage ../development/python-modules/FormEncode { };
 
-  pycountry = buildPythonPackage rec {
-    name = "pycountry-${version}";
-    version = "1.17";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pycountry/${name}.tar.gz";
-      sha256 = "1qvhq0c9xsh6d4apcvjphfzl6xnwhnk4jvhr8x2fdfnmb034lc26";
-    };
-  };
-
-  nine = buildPythonPackage rec {
-    name = "nine-${version}";
-    version = "0.3.4";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/n/nine/${name}.tar.gz";
-      sha256 = "1zrsbm0hajfvklkhgysp81hy632a3bdakp31m0lcpd9xbp5265zy";
-    };
+  pycountry = callPackage ../development/python-modules/pycountry { };
 
-    meta = with stdenv.lib; {
-      description = "Let's write Python 3 right now!";
-      homepage = "https://github.com/nandoflorestan/nine";
-    };
-  };
+  nine = callPackage ../development/python-modules/nine { };
 
-
-  logutils = buildPythonPackage rec {
-    name = "logutils-${version}";
-    version = "0.3.3";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/l/logutils/${name}.tar.gz";
-      sha256 = "173w55fg3hp5dhx7xvssmgqkcv5fjlaik11w5dah2fxygkjvhhj0";
-    };
-  };
+  logutils = callPackage ../development/python-modules/logutils { };
 
   ldappool = callPackage ../development/python-modules/ldappool { };
 
@@ -8750,24 +3177,7 @@ in {
 
   bottleneck = callPackage ../development/python-modules/bottleneck { };
 
-  paho-mqtt = buildPythonPackage rec {
-    name = "paho-mqtt-${version}";
-    version = "1.1";
-
-    disabled = isPyPy;
-
-    src = pkgs.fetchurl {
-        url = "mirror://pypi/p/paho-mqtt/${name}.tar.gz";
-        sha256 = "07i6k9mw66kgbvjgsrcsd2sjji9ckym50dcxnmhjqfkfzsg64yhg";
-    };
-
-    meta = {
-      homepage = "https://eclipse.org/paho/";
-      description = "mqtt library for machine to machine and internet of things";
-      license = licenses.epl10;
-      maintainers = with maintainers; [ mog ];
-    };
-  };
+  paho-mqtt = callPackage ../development/python-modules/paho-mqtt { };
 
   pamqp = buildPythonPackage rec {
     version = "1.6.1";
@@ -8806,43 +3216,7 @@ in {
     };
   };
 
-  paramiko = buildPythonPackage rec {
-    pname = "paramiko";
-    version = "2.1.1";
-    name = "${pname}-${version}";
-
-    src = fetchPypi {
-      inherit pname version;
-      sha256 = "0xdmamqgx2ymhdm46q8flpj4fncj4wv2dqxzz0bc2dh7mnkss7fm";
-    };
-
-    propagatedBuildInputs = with self; [ cryptography pyasn1 ];
-
-    __darwinAllowLocalNetworking = true;
-
-    # https://github.com/paramiko/paramiko/issues/449
-    doCheck = !(isPyPy || isPy33);
-    checkPhase = ''
-      # test_util needs to resolve an hostname, thus failing when the fw blocks it
-      sed '/UtilTest/d' -i test.py
-
-      ${python}/bin/${python.executable} test.py --no-sftp --no-big-file
-    '';
-
-    meta = {
-      homepage = "https://github.com/paramiko/paramiko/";
-      description = "Native Python SSHv2 protocol library";
-      license = licenses.lgpl21Plus;
-      maintainers = with maintainers; [ aszlig ];
-
-      longDescription = ''
-        This is a library for making SSH2 connections (client or server).
-        Emphasis is on using SSH2 as an alternative to SSL for making secure
-        connections between python scripts. All major ciphers and hash methods
-        are supported. SFTP client and server mode are both supported too.
-      '';
-    };
-  };
+  paramiko = callPackage ../development/python-modules/paramiko { };
 
   parameterized = callPackage ../development/python-modules/parameterized { };
 
@@ -11664,6 +6038,8 @@ in {
     propagatedBuildInputs = [ self.cffi ];
   };
 
+  safe = callPackage ../development/python-modules/safe { };
+
   sampledata = callPackage ../development/python-modules/sampledata { };
 
   sasmodels = callPackage ../development/python-modules/sasmodels { };
@@ -14943,28 +9319,7 @@ EOF
     };
   };
 
-  Logbook = buildPythonPackage rec {
-    name = "Logbook-${version}";
-    version = "1.0.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/L/Logbook/${name}.tar.gz";
-      sha256 = "0whqbx5p0zkf7gmb5ssnsnhm4kn4drd4x7fbhdi8dnxklqajbnl7";
-    };
-
-    buildInputs = [ self.pytest ] ++ optionals (!isPy3k) [ self.mock ];
-
-    checkPhase = ''
-      find tests -name \*.pyc -delete
-      py.test tests
-    '';
-
-    meta = {
-      homepage = https://pythonhosted.org/Logbook/;
-      description = "A logging replacement for Python";
-      license = licenses.bsd3;
-    };
-  };
+  Logbook = callPackage ../development/python-modules/Logbook { };
 
   libversion = callPackage ../development/python-modules/libversion {
     inherit (pkgs) libversion;
@@ -15049,6 +9404,8 @@ EOF
     };
   };
 
+  speedtest-cli = callPackage ../development/python-modules/speedtest-cli { };
+
   pushbullet = callPackage ../development/python-modules/pushbullet { };
 
   power = buildPythonPackage rec {
@@ -15748,35 +10105,7 @@ EOF
     };
   };
 
-  poezio = buildPythonApplication rec {
-    name = "poezio-${version}";
-    version = "0.11";
-
-    disabled = pythonOlder "3.4";
-
-    buildInputs = with self; [ pytest ];
-    propagatedBuildInputs = with self ; [ aiodns slixmpp pyinotify potr mpd2 ];
-
-    src = pkgs.fetchurl {
-      url = "http://dev.louiz.org/attachments/download/118/${name}.tar.gz";
-      sha256 = "07cn3717swarjv47yw8x95bvngz4nvlyyy9m7ck9fhycjgdy82r0";
-    };
-
-    patches = [
-      ../development/python-modules/poezio/fix_gnupg_import.patch
-    ];
-
-    checkPhase = ''
-      py.test
-    '';
-
-    meta = {
-      description = "Free console XMPP client";
-      homepage = https://poez.io;
-      license = licenses.mit;
-      maintainers = [ maintainers.lsix ];
-    };
-  };
+  poezio = callPackage ../applications/networking/instant-messengers/poezio { };
 
   potr = callPackage ../development/python-modules/potr {};
 
diff --git a/pkgs/top-level/splice.nix b/pkgs/top-level/splice.nix
index 82a781083e2c..ec6ed357c688 100644
--- a/pkgs/top-level/splice.nix
+++ b/pkgs/top-level/splice.nix
@@ -112,7 +112,9 @@ let
     inherit (pkgs.stdenv) buildPlatform targetPlatform hostPlatform;
   };
 
-  splicedPackagesWithXorg = splicedPackages // splicedPackages.xorg;
+  splicedPackagesWithXorg = splicedPackages // builtins.removeAttrs splicedPackages.xorg [
+    "callPackage" "newScope" "overrideScope" "packages"
+  ];
 
 in