Skip to content

Instantly share code, notes, and snippets.

@barsof
barsof / curl2requests.py
Last active January 18, 2022 10:14 — forked from rgov/curl2requests.py
Convert a CURL command line to the equivalent Python Requests invocation
#!/usr/bin/env python
import argparse
import pprint
import shlex
import urllib
from urllib import parse
# Lex the curl command into its constituent arguments
example = '''
curl 'http://seethroughny.net/tools/required/reports/payroll?action=get' \