Package: chaty
python-wechatyConnecting ChatbotsWechaty is a Conversational SDK for Chatbot Makers that can help you create a bot in 9 lines of Python.Voice of the Developers"Wechaty is a great solution, I believe there would be much more users recognize it."link—@Gcaufy, Tencent Engineer, Author ofWePY"太好用，好用的想哭"—@xinbenlv, Google Engineer, Founder of HaoShiYou.org"最好的微信开发库"link—@Jarvis, Baidu Engineer"Wechaty让运营人员更多的时间思考如何进行活动策划、留存用户，商业变现"link—@lijiarui, Founder & CEO of Juzi.BOT."If you know js ... try Wechaty, it's easy to use."—@Urinx Uri Lee, Author ofWeixinBot(Python)See more atWiki:Voice Of DeveloperJoin UsWechaty is used in many ChatBot projects by thousands of developers. If you want to talk with other developers, just scan the following QR Code in WeChat with secret codepython wechaty, join ourWechaty Python Developers' Home.Scan now, because other Wechaty Python developers want to talk with you too! (secret code:python wechaty)The World's Shortest Python ChatBot: 9 lines of CodefromwechatyimportWechatyimportasyncioasyncdefmain():bot=Wechaty()bot.on('scan',lambdastatus,qrcode,data:print('Scan QR Code to login:{}\nhttps://wechaty.js.org/qrcode/{}'.format(status,qrcode)))bot.on('login',lambdauser:print('User{}logged in'.format(user)))bot.on('message',lambdamessage:print('Message:{}'.format(message)))awaitbot.start()asyncio.run(main())Python Wechaty Developing PlanWe already have Wechaty in TypeScript, It will be not too hard to translate the TypeScript(TS) to Python(PY) becausewechatyhas only 3,000 lines of the TS code, they are well designed and de-coupled by thewechaty-puppetabstraction. So after we have translated those 3,000 lines of TypeScript code, we will almost be done.As we have already a ecosystem of Wechaty in TypeScript, so we will not have to implement everything in Python, especially, in the Feb 2020, we have finished thewechaty-grpcservice abstracting module with thewechaty-puppet-serviceimplmentation.The following diagram shows out that we can reuse almost everything in TypeScript, and what we need to do is only the block located at the top right of the diagram:Wechaty (Python).+--------------------------+ +--------------------------+
  |                          | |                          |
  |   Wechaty (TypeScript)   | |    Wechaty (Python)      |
  |                          | |                          |
  +--------------------------+ +--------------------------+

  +-------------------------------------------------------+
  |                 Wechaty Puppet Service                |
  |                                                       |
  |                (wechaty-puppet-service)               |
  +-------------------------------------------------------+

+---------------------  wechaty-grpc  ----------------------+

  +-------------------------------------------------------+
  |                Wechaty Puppet Abstract                |
  |                                                       |
  |                   (wechaty-puppet)                    |
  +-------------------------------------------------------+

  +--------------------------+ +--------------------------+
  |      Pad Protocol        | |      Web Protocol        |
  |                          | |                          |
  | wechaty-puppet-padplus   | |(wechaty-puppet-puppeteer)|
  +--------------------------+ +--------------------------+
  +--------------------------+ +--------------------------+
  |    Windows Protocol      | |       Mac Protocol       |
  |                          | |                          |
  | (wechaty-puppet-windows) | | (wechaty-puppet-macpro)  |
  +--------------------------+ +--------------------------+Example: How to Translate TypeScript to PythonThere's a 100 lines class namedImagein charge of downloading the WeChat image to different sizes.It is a great example for demonstrating how do we translate the TypeScript to Python in Wechaty Way:Image Class Source CodeTypeScript:https://github.com/wechaty/wechaty/blob/master/src/user/image.tsPython:https://github.com/wechaty/python-wechaty/blob/master/src/wechaty/user/image.pyIf you are interested in the translation and want to look at how it works, it will be a good start from reading and comparing those twoImageclass files in TypeScript and Python at the same time.To-do ListTS: TypeScriptSLOC: Source Lines Of CodeWechaty Internal ModulesClass Wechaty @wj-mCatTS SLOC(1160):https://github.com/wechaty/wechaty/blob/master/src/wechaty.tsCodeUnit TestsDocumentationClass ContactTS SLOC(804):https://github.com/wechaty/wechaty/blob/master/src/user/contact.tsCodeUnit TestsDocumentationClass ContactSelfTS SLOC(199):https://github.com/wechaty/wechaty/blob/master/src/user/contact-self.tsCodeUnit TestsDocumentationClass MessageTS SLOC(1054):https://github.com/wechaty/wechaty/blob/master/src/user/message.tsCodeUnit TestsDocumentationClass RoomTS SLOC(1194):https://github.com/wechaty/wechaty/blob/master/src/user/room.tsCodeUnit TestsDocumentationClass Image @wj-mCatTS SLOC(60):https://github.com/wechaty/wechaty/blob/master/src/user/image.tsCodeUnit TestsDocumentationClass Accessory @huanTS SLOC(179):https://github.com/wechaty/wechaty/blob/master/src/accessory.tsCodeUnit TestsDocumentationClass Config @wj-mCatTS SLOC(187):https://github.com/wechaty/wechaty/blob/master/src/config.tsCodeUnit TestsDocumentationClass FavoriteTS SLOC(52):https://github.com/wechaty/wechaty/blob/master/src/user/favorite.tsCodeUnit TestsDocumentationClass FriendshipTS SLOC(417):https://github.com/wechaty/wechaty/blob/master/src/user/friendship.tsCodeUnit TestsDocumentationClass MiniProgramTS SLOC(70):https://github.com/wechaty/wechaty/blob/master/src/user/mini-program.tsCodeUnit TestsDocumentationClass RoomInvitationTS SLOC(317):https://github.com/wechaty/wechaty/blob/master/src/user/room-invitation.tsCodeUnit TestsDocumentationClass TagTS SLOC(190):https://github.com/wechaty/wechaty/blob/master/src/user/tag.tsCodeUnit TestsDocumentationClass UrlLinkTS SLOC(107):https://github.com/wechaty/wechaty/blob/master/src/user/url-link.tsCodeUnit TestsDocumentationWechaty External ModulesClass FileBoxTS SLOC(638):https://github.com/huan/file-box/blob/master/src/file-box.tsCodeUnit TestsDocumentationClass MemoryCardTS SLOC(376):https://github.com/huan/memory-card/blob/master/src/memory-card.tsCodeUnit TestsDocumentationClass WechatyPuppetTS SLOC(1115):https://github.com/wechaty/wechaty-puppet/blob/master/src/puppet.tsCodeUnit TestsDocumentationClass WechatyPuppetHostieTS SLOC(909):https://github.com/wechaty/wechaty-puppet-service/blob/master/src/client/puppet-service.tsUsageWIP...RequirementsPython 3.7+Installpip3installwechatySee AlsoPackaging Python ProjectsStatic & Instance of ClassStatic variables and methods in PythonTypingsPEP 526 -- Syntax for Variable Annotations - Class and instance variable annotationsPython Type Checking (Guide)byGeir Arne HjelleHistoryv0.6 (Jun 19, 2020)Python Wechaty Scala WechatyBETAReleased!Read more from our Multi-language Wechaty Beta Release event from our blog:Multi Language Wechaty Beta Release Announcement!v0.4 (Mar 15, 2020) masterWelcome@huangaszaqfor joining the project!#42Add a friendly exception message for PyPI users.#24v0.1 (Mar 8, 2020)Welcome@wj-Mcatfor joining the project!#4Starting translate TypeScript of Wechaty to PythonDevOps SetupType Checking: mypy & pytypeUnit Testing: pytestLinting: pylint, pycodestyle, and flake8CI/CD: GitHub ActionsPublish to PyPI automatically after the tests passed.v0.0.1 (Aug 25, 2018)Project created, publish a empty modulewechatyon PyPI.Related ProjectsWechaty- Conversatioanl AI Chatot SDK for Wechaty Individual Accounts (TypeScript)Python Wechaty- Python WeChaty Conversational AI Chatbot SDK for Wechat Individual Accounts (Python)Go Wechaty- Go WeChaty Conversational AI Chatbot SDK for Wechat Individual Accounts (Go)Java Wechaty- Java WeChaty Conversational AI Chatbot SDK for Wechat Individual Accounts (Java)Scala Wechaty- Scala WeChaty Conversational AI Chatbot SDK for WechatyIndividual Accounts (Scala)Badge[![Wechaty in Python](https://img.shields.io/badge/Wechaty-Python-blue)](https://github.com/wechaty/python-wechaty)Stargazers over timeContributorsCommitters@huangaszaq-  Chunhong HUANG (黄纯洪)Creators@wj-Mcat- Jingjing WU (吴京京)@huan- (李卓桓)zixia@zixia.netCopyright & LicenseCode & Docs © 2018 Wechaty Contributorshttps://github.com/wechatyCode released under the Apache-2.0 LicenseDocs released under Creative Commons