Metadata-Version: 2.1
Name: kkba
Version: 0.8.16
Summary: A Library to Convert Curl to Python Requests File
Home-page: https://github.com/kaikeba/kkba
Author: dylan
Author-email: shddylan@163.com
License: UNKNOWN
Keywords: curl pypi
Platform: any
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyperclip (>=1.8.0)
Requires-Dist: rich (>=9.13.0)
Requires-Dist: requests

# KKBA
![](https://img.shields.io/badge/python-3.6-brightgreen)
## Intruoduction
A low-code tool that generates python crawler code based on curl or url

## Requirement
```shell
Python >= 3.6
```

## Install
```Shell
pip install kkba
```
## Usage

Copy the curl command or url from the browser, without pasting, execute the command directly:  kkba [options]

```shell
kkba [options]

# After the command execution, the crawler directory will be generated in the current directory (including the crawler articles and readme files).

```

## Example
[开课吧传送门](https://www.kaikeba.com/open/)
<br/>
```shell
# 1. Copy curl or url
# 2. Excute commands
kkba -F
```
```python
# use proxy,support 蜻蜓、快代理、阿布云, For detailed usage, you can view the source code
from kkba.proxy import Proxy

p = Proxy(crawlerType='requests', proxyType='xxx', username='xxx', password='xxx')
proxies = p.get_proxy()
```

![sample graph](https://everpic.oss-cn-beijing.aliyuncs.com/kkba-s4-ezgif.com-gif-maker.gif "sample graph")

## Help Document
```Shell
kkba -h
```

```text
爬虫生成器

usage: kkba [options]

optional arguments:
  -F,               推荐: 将粘贴板curl或者url，生成feapder异步爬虫代码，相当于scrapy的用法
  -s                将粘贴板curl或者url，生成scrapy单文件项目
  -f,               将粘贴板curl或者url，生成feapder同步爬虫代码，相当于requests的用法
  -r,               将粘贴板curl或者url，生成requests爬虫代码
  -h, --help        帮助文档
  -v, --version     查看版本

```
### Genrates feapder spider code
```shell
# install fepader
pip install feapder

# generates feapder spiders code
kkba -F
```

### Generates scrapy single file code
```shell
# install scrapy
pip install scrapy

# generates scrapy single spiders code
kkba -F
```

## Thanks
[curl2pyreqs](https://github.com/knightz1224/curl2pyreqs) 令狐 向娜


