{"id":1438,"library":"curlify","title":"Curlify","description":"Curlify is a Python library that converts `requests` request objects into equivalent cURL commands. This is particularly useful for debugging network requests by quickly generating a cURL command that can be executed directly in a terminal. The current version is 3.0.0, and it maintains an active release cadence, primarily focusing on Python version compatibility and minor enhancements.","status":"active","version":"3.0.0","language":"en","source_language":"en","source_url":"https://github.com/ofw/curlify","tags":["requests","curl","cli","debugging","networking"],"install":[{"cmd":"pip install curlify","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Curlify operates on `requests` request objects; `requests` is a core dependency for its functionality.","package":"requests","optional":false}],"imports":[{"symbol":"curlify","correct":"from curlify import curlify"}],"quickstart":{"code":"import requests\nfrom curlify import curlify\n\n# Create a requests.Request object\nr = requests.Request(\n    'GET', \n    'http://httpbin.org/get',\n    headers={'User-Agent': 'curlify-test-agent'},\n    params={'key': 'value'},\n    data={'body_key': 'body_value'}\n)\n\n# Prepare the request to get a PreparedRequest object\nprepared_request = r.prepare()\n\n# Convert the prepared request to a curl command\ncurl_command = curlify(prepared_request)\nprint(f\"Generated cURL command:\\n{curl_command}\")","lang":"python","description":"This quickstart demonstrates how to create a `requests.Request` object, prepare it using `.prepare()`, and then convert the resulting `PreparedRequest` object into a cURL command string using `curlify`."},"warnings":[{"fix":"Upgrade Python to 3.7 or newer, or pin `curlify` to a version less than 3.0.0 (e.g., `pip install 'curlify<3.0.0'`).","message":"Python 3.6 support was dropped in `curlify` version 3.0.0. Users on Python 3.6 or older will need to upgrade their Python version or stick to `curlify<3.0.0`.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Always call the `.prepare()` method on your `requests.Request` object before passing it to `curlify`. For example: `prepared_req = requests.Request(...).prepare()` then `curlify(prepared_req)`.","message":"The `curlify` function expects a `requests.PreparedRequest` object, not a raw `requests.Request` object or a `requests.Response` object. Passing the incorrect object type will result in an `AttributeError` or an incomplete cURL command.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}