Skip to main content

Convert curl commands to Python requests code or JSON.

Project description

curl_parsers

介绍

curl命令转python代码,支持json格式数据转换

安装教程

  1. pip install curl_parsers
  2. 或者下载源码,解压后运行

使用说明

  1. 终端命令行输入:
方法一:
python -m curl_parsers.cli 'curl -X POST https://api.example.com/submit' --output python
python -m curl_parsers.cli 'curl -X POST https://api.example.com/submit' --output json

方法二:
uncurl 'curl -X POST https://api.example.com/submit' --output python
uncurl 'curl -X POST https://api.example.com/submit' --output json
  1. 调用函数:
from curl_parsers import parse_curl, to_python, to_json

curl_cmd = "curl -X POST https://api.example.com/submit"
print(parse_curl(curl_cmd))  # 解析curl命令并返回字典数据
print(to_python(curl_cmd))  # 转换为python代码
print(to_json(curl_cmd))  # 转换为json格式数据

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

curl_parsers-0.1.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

curl_parsers-0.1.3-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file curl_parsers-0.1.3.tar.gz.

File metadata

  • Download URL: curl_parsers-0.1.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for curl_parsers-0.1.3.tar.gz
Algorithm Hash digest
SHA256 bde71ab05f71d628bf83d93c60cb1cc8853cf1e03796a7dd86c41df096e25706
MD5 5f17d4aac2c7ee89df5409e852aff681
BLAKE2b-256 7208ef6999068b59f6ff1455e54430d9c26623505e68f6f994890aea67d6091c

See more details on using hashes here.

File details

Details for the file curl_parsers-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for curl_parsers-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c67641ab6a76a3a4c497fa6fc2cf2306a33c8e12a5e5370a664fbdff62e2d60d
MD5 b83fa9edb02575d926eb114a10010da0
BLAKE2b-256 6023f4b60fbb18acbe14477226aa2a5fc301a327ad98e21ad8bd9c93c8da8747

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page