Skip to content

Instantly share code, notes, and snippets.

@dstufft
dstufft / ua.py
Created April 26, 2012 19:51
A List of Every User Agent Ever Used To Download a File from PyPI
This file has been truncated, but you can view the full file.
""
""Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.0.14) Gecko/2009090216 Firefox/3.0.14""
"'"
"''"
"'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)'"
"'Mozilla/4.0 (compatible; MSIE 6.1; Windows NT 5.2)'"
"'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727)'"
"'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727)'"
#!/bin/bash
set -e
DOMAINS=""
while read d; do
DOMAINS="$DOMAINS -d $d"
done < /etc/letsencrypt/domains
letsencrypt certonly \
-n --agree-tos --email donald@stufft.io --webroot -w /var/www/letsencrypt \
PEP 426 (Withdrawn) - Metadata for Python Software Packages 2.0
PEP 440 - Version Identification and Dependency Specification
PEP 449 - Removal of the PyPI Mirror Auto Discovery and Naming Scheme
PEP 453 - Explicit bootstrapping of pip in Python installations
PEP 464 - Removal of the PyPI Mirror Authenticity API
PEP 470 - Removing External Hosting Support on PyPI
PEP 477 - Backport ensurepip (PEP 453) to Python 2.7
PEP 481 (Withdrawn) - Migrate CPython to Git, Github, and Phabricator
- I won the spiritual victory though, since PEP 512 by Brett Cannon moved CPython to Github
PEP 503 - Simple Repository API
name version downloads
pip 22.1.2 2896110493
pip 21.0.1 2138411315
pip 22.0.4 1595433981
pip 21.3.1 1348723894
pip 20.0.2 1030557836
requests 2.26.0 811592632
pip 20.2.2 651539904
pip 20.1 532628196
pip 21.2.4 467888698
import requests
import zlib
import struct
import json
import html5lib
import re
import pprint
_gzip_header = b"\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff"
@dstufft
dstufft / convert.py
Last active November 24, 2021 18:02
#!/usr/bin/env python3
import argparse
import os
import os.path
import shutil
import sys
import zipfile
import tarfile
import tempfile
import gzip
#!/usr/bin/env python
"""
Distutils/setuptools installer for M2Crypto.
Copyright (c) 1999-2004, Ng Pheng Siong. All rights reserved.
Portions created by Open Source Applications Foundation (OSAF) are
Copyright (C) 2004-2007 OSAF. All Rights Reserved.
@dstufft
dstufft / desc.txt
Last active April 1, 2021 12:58
A list of package versions that are only installable externally from PyPI and the script to generate missing.json.
Unscientific Study.
- Took 54 hours, state of PyPI changed during it (and since).
- Might have bugs, reasonably sure it's accurate though.
- Lists only the versions that pip's PackageFinder could not locate a version on PyPI but
could outside of PyPI.
- List won't update, projects may have resolved since posting it.
Some statistics:
[package]
name = "Django"
# version = ... # This is omitted, ``setup.py`` must be executed to read it.
summary = """
A high-level Python Web framework that encourages rapid development and\
clean, pragmatic design.\
"""
url = "http://www.djangoproject.com/"
author = "Django Software Foundation"
author-email = "foundation@djangoproject.com"
@dstufft
dstufft / gist:997475
Created May 29, 2011 04:48
Configuration Files for Nginx + Gunicorn + Supervisord
We couldn’t find that file to show.