Skip to main content

简书非官方 SDK - 创造可能性

Project description

JKit

许可证 简书主页

PyPI 最新版 支持的 Python 版本

Ruff Pyright Black

创造可能性。

[!WARNING] JKit v3 正在 Alpha 测试中,可能随时进行重大变更。

快速上手

pip install jkit --pre
import asyncio

from jkit import User


async def main() -> None:
    user = User.from_url("https://www.jianshu.com/u/622a3993108c")

    info = await user.info
    print(f"用户昵称:{info.name}")
    print(
        f"性别:{info.gender.value},会员等级:{info.membership_info.type.value}\n"
        f"会员过期时间:{info.membership_info.expired_at}"
    )


asyncio.run(main())
用户昵称:任真
性别:女,会员等级:白金会员
会员过期时间:2024-04-12 14:24:24

亮点

  • 完全异步操作
  • 基于 msgspec 的数据模型和自动校验

获取简书鉴权 Token

目前仅支持电脑端操作。

登录简书账号后,打开浏览器开发者工具(F12),选择「存储」(Storage)选项卡,找到域名 https://www.jianshu.com 下存储的 Cookies 列表。

获取键 remember_user_token 对应的值,然后初始化 JianshuCredential 对象,代码如下所示:

from jkit.credential import JianshuCredential

credential = JianshuCredential(
    token="<remember_user_token>"
)

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

jkit-3.0.0a16.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

jkit-3.0.0a16-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file jkit-3.0.0a16.tar.gz.

File metadata

  • Download URL: jkit-3.0.0a16.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1016-azure

File hashes

Hashes for jkit-3.0.0a16.tar.gz
Algorithm Hash digest
SHA256 76f2a5949268cc4f88d799b2b2b71a2cafdfda55521b765d4920595543cd6182
MD5 793566a6de2933846ecf82a839ed9c29
BLAKE2b-256 2ed608165ef675ea797fdae8ad65df9a51a54aaeff3ba4e3809f0243e0b4e8d5

See more details on using hashes here.

File details

Details for the file jkit-3.0.0a16-py3-none-any.whl.

File metadata

  • Download URL: jkit-3.0.0a16-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/6.5.0-1016-azure

File hashes

Hashes for jkit-3.0.0a16-py3-none-any.whl
Algorithm Hash digest
SHA256 3ee1b6b4ffa25e56108ba28988f3612649f787fca94caf961af1f60bc6a805e3
MD5 70b1e1dff5252a03f5875f7353bc2e19
BLAKE2b-256 4d5ad12ecf14ac37d1a45bc8221bb75e4fa2b9efb860e886087c8f4d2a86742f

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