Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Availability through PyCharm #322

Closed
michaeletro opened this issue Jan 7, 2022 · 6 comments
Closed

Availability through PyCharm #322

michaeletro opened this issue Jan 7, 2022 · 6 comments
Labels

Comments

@michaeletro
Copy link

It would be great if this was available through PyCharm. Having trouble downloading the package and love the website emulator

@verhovsky
Copy link
Member

Could you share exactly what you're having trouble with when downloading the package?

I agree, this definitely needs to be packaged as an extension. I'll make one for VS Code.

@michaeletro
Copy link
Author

michaeletro commented Jan 7, 2022 via email

@verhovsky
Copy link
Member

verhovsky commented Jan 7, 2022

curlconverter can be used from the command line, not just JavaScript. It also has a JSON output, which outputs a representation of the input command after the first step of parsing.

You can call the command line tool from Python through subprocess and pipe your input command like this

import subprocess
import json

def parse_curl(command):
    result = subprocess.run(['curlconverter', '--language', 'json', '-'], text=True, input=command, capture_output=True)
    return json.loads(result.stdout)

print(parse_curl("curl --data helloworld example.com"))  # {'url': 'http://example.com', 'raw_url': 'http://example.com', 'method': 'post', 'data': {'helloworld': ''}}

Note that you'll need to install the preview version of curlconverter for the new command line interface, which you can do with

npm install -g curlconverter@next

http://curlconverter.com/ also links to other projects that try to do the same thing. There is a Python uncurl library, but I've never used it.

am getting an error message stating I need to request permission to pull

if I understood correctly, I bet it's because you're pulling (cloning) over SSH and don't have an SSH key configured for github. The fastest thing would be to use HTTP:

Screen Shot 2022-01-07 at 3 51 19 AM

i.e.

git clone https://github.com/curlconverter/curlconverter.git

@verhovsky
Copy link
Member

I created the VS Code extension: #147 (comment)

@michaeletro
Copy link
Author

michaeletro commented Jan 11, 2022 via email

@verhovsky
Copy link
Member

I'm closing this as wontfix because there's a VS Code extension now and I'm not going to work on a PyCharm extension.

If someone wants to make one, they obviously can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants