Skip to main content

Python SDK for getting data quickly

Project description

Qdata - Python SDK for index and search

为什么给项目改了名

  • 想做一个提供更多数据的SDK包,但不一定有时间。。。
  • 老的代码包可以在old_baiduindex里找到
  • 会根据我自己个人的数据需求,往里面添加不同的数据源,如果恰好帮助到你,很开心
  • 老的数据源会尽力维护

Data Source

Install

pip uninstall pycrypto  # 避免与pycryptodome冲突
pip install --upgrade qdata

Examples

百度指数

./examples/test_baidu_index.py

获取百度指数时不要太暴力,可以参考以下代码,进行百度指数数据的获取

import time

from qdata.baidu_index import get_search_index
from qdata.baidu_index.common import split_keywords


keywords_list = [['张艺兴', '汪峰'], ['百度'], ['疫情', '杭州'], ['北京', '疫情'], ['猫粮'], ['流浪猫']]
cookies = """xxx"""

for keywords in split_keywords(keywords_list):
    for index in get_search_index(
        keywords_list=keywords,
        start_date='2018-01-01',
        end_date='2019-05-01',
        cookies=cookies
    ):
        print(index)
    time.sleep(15)

百度搜索

./examples/test_baidu_search.py

百度登录(获取百度Cookie)

./examples/test_baidu_login.py

  • 目前只提供二维码登录,密码账号登录也可以做,但不做,因为没必要。
  • 幸好工作不做爬虫,心太累了。

天眼查

./examples/test_tianyancha.py

  • 老婆做汇报着急用

Changelog

  • 2021/03/25 上线
  • 2021/03/26 更新百度登录功能
  • 2021/04/07 百度指数新增:实时百度指数
  • 2021/04/13 添加天眼查高级搜索公司数数据
  • 2021/05/18 修正打包问题
  • 2022/05/12 百度指数添加Cipher-Text(不确定部分逻辑)
  • 2022/05/16 一些小的改动
  • 2022/05/30 修正百度指数加密逻辑

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

qdata-0.2.2.tar.gz (56.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qdata-0.2.2-py3-none-any.whl (61.0 kB view details)

Uploaded Python 3

File details

Details for the file qdata-0.2.2.tar.gz.

File metadata

  • Download URL: qdata-0.2.2.tar.gz
  • Upload date:
  • Size: 56.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.9

File hashes

Hashes for qdata-0.2.2.tar.gz
Algorithm Hash digest
SHA256 7de4ab9996aebf76986dbe86cf45d62d2b3f696a4bb23ea666ca383bd114edcc
MD5 9bab92ec793b9c41bb79ea996f31d880
BLAKE2b-256 0f52265f47698bcd62f9e1ff3f18ab0b8d0060dbaf19128c244b8e719a5c638d

See more details on using hashes here.

File details

Details for the file qdata-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: qdata-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 61.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.9

File hashes

Hashes for qdata-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 58e718e4190fee4975d08311e1fcb4d308b71fef17d7e1b033a3b56d4e1ce66c
MD5 9727d5b8cc4939eec756e43d841fb82b
BLAKE2b-256 5f14b508b6e1b63279936b4aef576f98d51efc31343f3fd20b612c699115ef15

See more details on using hashes here.

Supported by

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