Skip to main content

爬虫业务中,常用的工具集

Project description

kkbtools

Introduction

公司爬虫业务中,常用的工具集

Requirement

Python >= 3.6

Install

pip install kkbtools

Usage

安装后将需要用到的类导入即可,更多方法,请查看源码

from kkbtools import PandasPro, Tools, OssUpload

Example

from kkbtools import PandasPro, Tools, OssUpload

# 将 list[dict] 数据插入excel
PandasPro.insert_lists_dict_to_excel([{'a': 1, 'b': 2}, {'a': 3, 'b': 4}], 'test')

# 将mysql数据插入excel中,数据库连接信息,默认读取环境变量 ~/.bash_profile
PandasPro.mysql_to_execl('test')

# 获取一天前时间戳,默认00:0:0:00时刻
# 1649734882
print(Tools.get_off_days_timestamp(-1))

# 拆分可迭代对象
# [[1, 2], [3, 4], [5]]
print(Tools.cut([1, 2, 3, 4, 5], 2))

# 把文件上传到oss中,生成直链后,发送到钉钉群,并删除本地文件
OssUpload.send_file_and_remove_oss('test.xlsx', 'https://此处写钉钉群连接')

# 依次为文件路径,Webhook地址,需要发送的消息,钉钉安全设置自定义关键字
# 这种方式直接发送文件到群里,文件有效期2小时,不经过oss存储,发送完毕后,删除本地文件
OssUpload.send_file_and_remove_ding('test.xlsx', 'https://此处写钉钉群连接')

Help Document

kkbtools [-h] [--help]
# 待完善。。。

Thanks

wshuo

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

kkbtools-0.1.4.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

kkbtools-0.1.4-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file kkbtools-0.1.4.tar.gz.

File metadata

  • Download URL: kkbtools-0.1.4.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.2

File hashes

Hashes for kkbtools-0.1.4.tar.gz
Algorithm Hash digest
SHA256 dbc6f32a0b626cffa72c2b71a5842feefc942dde7883d6d1180c308414bd2c3c
MD5 f843f355e84a0a2ade67e36575c39961
BLAKE2b-256 64db73bb18fce13423667ddcbb0c05f6dda24d8937c89a4ab5870d217330cff2

See more details on using hashes here.

File details

Details for the file kkbtools-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: kkbtools-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.2

File hashes

Hashes for kkbtools-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1639b5e296d3df47b89ce0a737578fc938cd12b3d1bc44b7de325e36122fe144
MD5 7c82cce4e526dd9d100af64902a57181
BLAKE2b-256 b48e0839ee1f3c34fcaf8db30eefb385a6ae250ad37926cc1e1b6f981ec95b9d

See more details on using hashes here.

Supported by

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