Saravanan666/pypi-org huggingface dataset:
Package: webvtt-py
webvtt-pyis a Python module for reading/writingWebVTTcaption files. It also features caption segmentation useful when captioningHLS videos.Requires Python 3.4+.Documentation is available athttp://webvtt-py.readthedocs.io.Installation$ pip install webvtt-pyUsageimportwebvttforcaptioninwebvtt.read('captions.vtt'):print(caption.start)print(caption.end)print(caption.text)Segmenting for HLSimportwebvttwebvtt.segment('captions.vtt','output/path')Converting captions from other formatsSupported formats:SubRip (.srt)YouTube SBV (.sbv)importwebvttwebvtt=webvtt.from_srt('captions.srt')webvtt.save()# one liner if we just need to convert without editingwebvtt.from_sbv('captions.sbv').save()CLICaption segmentation is also available from the command line:$ webvtt segment captions.vtt --output destination/directoyLicenseLicensed under the MIT License.
Package: webvtt-to-json
webvtt-to-jsonConvert WebVTT to JSON, optionally removing duplicate linesInstallationInstall this tool usingpip:pip install webvtt-to-jsonUsageTo output JSON for a WebVTT file:webvtt-to-json subtitles.vttThis will output to standard output. Use-o filenameto send it to a specified file.Subtitles can often include duplicate lines. Add-dor--dedupeto attempt to remove those duplicates from the output:webvtt-to-json --dedupe subtitles.vttUse-sor--singleto output single"line"keys instead of a"lines"array.You can also use:python -m webvtt_to_json ...OutputStandard output:[{"start":"00:00:00.000","end":"00:00:01.829","lines":[" ","my<00:00:00.160><c> career</c><00:00:00.480><c> in</c><00:00:00.640><c> side</c><00:00:00.880><c> projects</c><00:00:01.280><c> and</c><00:00:01.520><c> open</c>"]}]--dedupeoutput:[{"start":"00:00:01.829","end":"00:00:01.839","lines":["my career in side projects and open"]}]--dedupe --singleoutput:[{"start":"00:00:01.829","end":"00:00:01.839","line":"my career in side projects and open"}]DevelopmentTo contribute to this tool, first checkout the code. Then create a new virtual environment:cd webvtt-to-json
python -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: webwithpy
Webwithpy is a free to use fullstack web framework mainly focussed on performance and ease of use.
The goal of webwithpy is to have an easy-to-use web framework whilst still maintaining high performance.A clear example of the use of webwithpy:fromwebwithpyimportrun_serverfromwebwithpy.routingimportGETfromwebwithpy.ormimportDB,Table,Fielddb=DB('databases/db.sqlite')classUser(Table):table_name="user"name=Field("string")email=Field("string")profile_picture=Field("image")@GET('/')defview_users():# user logic goes herereturn(db.user.id>=0).select()if__name__=="__main__":# all tables that are defined before this statement will be initializeddb.create_tables()# run the server when you're done creating views and databasesrun_server()DocumentationThe documentation is not fully done yet however it is something for now:webwithpy docs
Package: webwol
[![Build Status](https://travis-ci.org/fhats/webwol.svg?branch=master)](https://travis-ci.org/fhats/webwol)# webwol: Generate wake-on-lan packets via a web interfaceThis script provides one-touch wake-on-lan packet generation from a web interface.There's not much to it. The only thing it depends on is Python (2.6+).# How To UseThis script has intentionally attempted to minimize dependencies. It should runanywhere that has python 2.6, 2.7, 3.2, 3.3, 3.4, or 3.5 installed.## Install ItGet the code somehow:* [Download the latest release](https://github.com/fhats/webwol/releases/latest)* Clone this repository* [Download a debian package](https://github.com/fhats/webwol/releases/latest)* Install it with something like `dpkg -i python-webwol*.deb`* Copy and paste it from this repo* pip install it* Transcribe it by hand??## Configure ItHere's the magic bit. Write down the MAC addresses you want to send wake-on-lanpackets to. Give those puppies a name, too, cause why not? Do it like this:```{"deadbeef-dad": "de:ad:be:ef:da:dd","mr-counter": "12:34:56:78:90:ef"}```If you don't know the MAC address you want, try lookin' up how to do it on the[internet](http://www.wikihow.com/Find-the-MAC-Address-of-Your-Computer). There'sanother example about how to write this file [in this repo](https://github.com/fhats/webwol/blob/master/example-config.json)Save all them juicy bits in a file somewhere on the computer that webwol's gonnarun on. You could put it in a place like `/etc/webwol.json` if you want. Or yourhomedir. I won't judge.## Run It`python webwol.py` from the place where you downloaded the code. Or if youinstalled from a debian package, it's probably in your path, so try just `webwol.py`?
Package: webx
A next-generationASGIPython web-framework, focused onSpeedandStabilityWelcome to WebXWebX is a next-generationASGIPython web-framework, which is focused onSpeedStability.WebX is heavily inspired by django, making it a bit easier to try out WebX for the first time. However, WebX is asynchronous, meaning it uses the ASGI protocol. Sure,django-channelsexists, however it's never TRULYasync. You don't experience the true abilities of asynchronous programming. This is where WebX comes in. It's completely written to handle the ASGI spec, allowing for awesome features such as WebSockets, and background tasks.WebX also encourages heavy contribution, allowing for extensions to be natively integrated into WebX, through thewebx.extimport paths. It's advised to write extensions that fit within thisextfolder, as it's hidden away from the rest of WebX, avoiding silly problems.
Package: webxdcbot
webxdcbotExample Delta Chat bot + webxdc app as bot's frontend.InstallClone this repository and run inside the project's folder:# first build the webxdc app / frontend:cdfrontend/
npminstall
npmrunbuildcd..# install the python package bot / backend:pipinstall.Installing deltachat-rpc-serverThis program depends on a standalone Delta Chat RPC serverdeltachat-rpc-serverprogram that must be
available in yourPATH. To install it check:https://github.com/deltachat/deltachat-core-rust/tree/master/deltachat-rpc-serverConfigurationConfigure the bot:webxdcbotinitbot@example.comPASSWORDStart the bot:webxdcbotserveRunwebxdcbot --helpto see all available options.UsageWrite to the bot in Delta Chat, for example send a "hi" message to itThe bot will reply with the webxdc appOpen the webxdc app and send a message thereThe bot will reply to you inside the app
Package: webXtools
webXtoolsA wouldbe toolset for web exploitation and other general tools used in CTFs.To installpip3 install webXtoolsModulesBruteforcerRace ConditionJWTUsageBruteforceA multithreaded approach to generate stringsimportwebXtoolsimporthashlibimportstring# Find a string such that `hashlib.sha256("string".encode('utf-8')).hexdigest()[:5]` returns `3f6ac`defcheck(string):ifhashlib.sha256(string.encode('utf-8')).hexdigest()[:5]=="3f6a4":returnTrueelse:returnFalse# Returns the string that solves callbackprint(webXtools.bruteforce(minLength=1,maxLength=4,charSet=string.ascii_letters+string.digits,noOfThreads=4,callback=check))# Prints all the strings generatedwebXtools.bruteforce(minLength=1,maxLength=4,charSet=string.ascii_letters+string.digits,noOfThreads=4,callback=print)# bruteforceListdefdoit(st):# something with the stringreturnFalsewebXtools.bruteforceList(stringList=[1,2,3,4,5,6,7,8,9,10],noOfThreads=5,callback=doit)# bruteforceFilewebXtools.bruteforceFile(file="./payloads.txt",noOfThreads=5,callback=check)Race ConditionTest race condition in Web ApplicationsimportwebXtools# 1r=webXtools.race(url="https://google.com",numberOfRequests=100,threads=5)## r has a list of all the responses# 2webXtools.race(url="http://vuln.com",cookies={"id":"evil"},method="GET",headers={"iam":"admin"},numberOfRequests=200,threads=10)# 3request="""POST /test/ HTTP/1.1HOST: localhost:1337Content-Type: application/JSONContent-Length: 15{"test":"data"}"""webXtools.race(url="http://localhost:1337",absoluteRequest=request,threads=5)JWTimportwebXtoolsimportstringtoken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.R6zywlgNMEEcoM01FyTd3XY-iODzr-uvpWWw9i8VHho"print(webXtools.jwtHS256Brute(token,charSet=string.ascii_letters,maxLength=3))print(webXtools.jwtHS256Brute(token,stringList=["a","c","abs"]))print(webXtools.jwtHS256Brute(token,stringFile="./strings.txt",noOfThreads=10))
Package: web-youtube-dl
AboutThis is a project that builds on pytube to provide a simple web-interface
for downloading audio from Youtube. It’s primary purpose is to provide a LAN
HTTP accessible method of saving audio to a local device.This project is built using python’s asyncio libraries and packages include
FastAPI, janus, and uvicorn. It’s also an example of how to work with pytube’s
python sdk and enable asynchronous downloads in the context of a web-app.Files are downloaded using an API endpoint and then retrived from the application’s
static files directory using Javascript’s fetch API. Download progress is presented
via a websocket connection.Installationpipinstallweb-youtube-dlRunningCLIInstalling this project will give you access to two CLI tools, each with a
separate purpose:web-youtube-dl-cliUseful for simply downloading the highest possible quality audio of a song.Simply provide the URL and an .mp3 will be downloaded to current workingdirectory or to the value of theYT_DOWNLOAD_PATHenvironment variableweb-youtube-dl-webUseful for running the web service on the local machine. It willlisten to all local network connections on port 5000 (or whatever port isdefined in the environment variableYT_DOWNLOAD_PORT).DockerThis project can optionally be run and managed as a Docker container.Build the Docker imagedockerbuild.-tweb-youtube-dl:latest--force-rmOr, using the project’s MakefilemakeimageRun the serviceWhen running the service via Docker, you can configure where it stores downloaded
songs by default and the port the service listens on by setting the appropriate
environment variables.To configure the port, set the environment variableYT_DOWNLOAD_PORTto some
other numerical value.To configure the download path, set the environment variableYT_DOWNLOAD_PATHto some other filesystem path. Note that an unprivileged user must have access
to writing to this location. By default, this is set totmpand does not
really need to be changed.docker-composeup-dOr, using the project’s MakefilemakecomposeEnhancementsTrack progress beyond YT download
- tie into ffmpeg
- tie into metadata extraction
Package: webz
webz简单的web服务器框架，实现的是配置文件的读取和调用，内部调用web.py

注：代码实现了url映射和查找，查找方式是for循环遍历列表，url映射配置多了的话循环显然不是好方法，相关代码在
configz.ConfigWeb.deal和config.ConfigWeb.deal
可以自行修改

demo在demo文件夹中，两种配置方式，分别运行：
python run.py
python runz.py
推荐runz.py的配置方式

为了本人自己使用方便以及利用浏览器缓存减少http请求，把bootstrap、jquery.js和vue.js放进文件夹了，可以不使用或者替换掉，另外有两脚本文件base.js和utils.js，分装了一些方法:
    json调用:
    $.json(url, data, success=(rst)=>{}, error=(rst)=>{})
    $.upload(...)
    $.submit(...) //这个没测试
    $.get(url, success=(rst)=>{}, error=(rst)=>{})
    页面跳转（带数据）
        _.jump(url, data)
    新页面通过以下方法获取数据：
        _.data()
    页面回跳（和左上角后退键一个功能，不过可以加回跳参数）:
        _.back(backData=null)
    原页面还是通过_.data()获取初始化时的原数据，也可以通过_.backData()获取回跳时设置的数据

    通过js代码引入js文件库:
        addScript(url)
    通过js代码引入css文件库:
        addStyle(url)

    vue相关：
    组件:
    component(url, id=null)
    实际是把url对应的页面嵌入当前页面

    页面vue创建：
    newVue({
        data(){return {...}},
        mounted(){...},
        methods:{...}
    })

    相关使用参考demo/test1.html

    要使用这个工具类，需要把/webz/js映射成webz.js，并在页面引入脚本:
        <script src="/webz/js/base.js"></script>
        <script src="/webz/js/packs.js"></script>
    或者
        <script src="/webz/js/base.js"></script>
        <script src="jquery路径"></script>
        <script src="vue路径"></script>
        <script src="/webz/js/utiils.js"></script>

任意一个运行后，尝试访问网址：
http://127.0.0.1:8080/page/test1.html
http://127.0.0.1:8080/func/abc?d=e&f=g
Package: webzio
A simple way to access theWebz.ioAPI from your Python code::
.. code-block:: pythonimport webziowebzio.config(token=YOUR_API_KEY)
output = webzio.query(“filterWebContent”, {“q”:”github”})
print output[‘posts’][0][‘text’] # Print the text of the first post
print output[‘posts’][0][‘published’] # Print the text of the first post publication date# Get the next batch of posts
output = webzio.get_next()
print output[‘posts’][0][‘thread’][‘site’] # Print the site of the first postAPI KeyTo make use of the webz.io API, you need to obtain a token that would be
used on every request. To obtain an API key, create an account athttps://webz.io/auth/signup, and then go intohttps://webz.io/dashboardto see your token.InstallingYou can install from source:$gitclonehttps://github.com/webz.io/webzio-python$cdwebzio-python$pythonsetup.pyinstallOr use pip install:$sudopipinstallwebzioUse the APITo get started, you need to import the library, and set your access token.
(Replace YOUR_API_KEY with your actual API key).>>>importwebzio>>>webzio.config(token=YOUR_API_KEY)API EndpointsThe first parameter the query() function accepts is the API endpoint string. Available endpoints:
* filterWebContent - access to the news/blogs/forums/reviews APINow you can make a request and inspect the results:>>>output=webzio.query("filterWebContent",{"q":"github"})>>>output['totalResults']15565094len(output['posts'])100>>>output['posts'][0]['language']u'english'>>>output['posts'][0]['title']u'Putting quotes around dictionary keys in JS'For your convenience, the ouput object is iterable, so you can loop over it
and get all the results of this batch (up to 100).>>>total_words=0>>>forpostinoutput['posts']:...total_words+=len(post['text'].split(" "))...>>>print(total_words)8822Full documentationconfig(token)token - your API keyquery(end_point_str, params)end_point_str:
* filterWebContent - access to the news/blogs/forums/reviews APIparams: A key value dictionary. The most common key is the “q” parameter that hold the filters Boolean query. [Read about the available filters](https://webz.io/documentation).get_next()- a method to fetch the next page of results.PollingIf you want to make repeated searches, performing an action whenever there are
new results, use code like this:r=webzio.query("filterWebContent",{"q":"skyrim"})whileTrue:forpostinr['posts']:perform_action(post)time.sleep(300)r=webzio.get_next()
Package: wechat2
项目背景从2014年开始玩微信公众平台，试用过其中大多数的功能，如：消息回复、自定义菜单、公众号中的支付，页面授权等。之前的程序中都是直接调用公众平台的接口，这样复用功能无法实现。现将功能独立出单独模块目前完成获取access_token方法获取微信服务器IP地址自定义菜单中的查询、创建、删除（不包括个性化菜单接口）消息管理中的接收普通消息、接收事件推送消息管理中的被动回复用户消息添加tornado代码的demo实例使用示例获取access_token方法from wechat.base import get_access_token_dict

get_access_token_dict(APPID, APPSECRET)消息处理基类继承基础的消息处理类BaseHandler， 重写对应方法即可。 如文本、图片、视频等对应的处理方法分别问on_text、on_image、on_video。from wechat.message import *

class MessageHandler(BaseHandler):

  def on_text(self, xml_dict):

      from_user = xml_dict['FromUserName']
      to_user = xml_dict['ToUserName']
      create_time = xml_dict['CreateTime']
      content = xml_dict['Content']

      text_response = TextResponse(from_user=to_user, to_user=from_user, create_time=create_time, content=content)
      return text_response自定义菜单接口from wechat.menu.client import Client

client = Client(access_token['access_token'])

# 创建菜单
client.create_menu(data)

# 获取菜单
client.get_menu()

# 删除菜单
client.delete_menu()跑单元测试nosetests --with-coverage --cover-package=wechat下一步计划继续补充其他常用接口感兴趣的同学可以加入到项目中一起完善
Package: wechatarticles
微信公众号文章爬虫（微信文章阅读点赞的获取）安装pip install wechatarticles展示地址：日更，获取公众号的最新文章链接，支持日更阅读点赞评论正文技术交流可以直接联系，微信二维码见末尾（微信；wnma3mz)。烦请进行备注，如wechat_spider注：本项目仅供学习交流，严禁用于商业用途（该项目也没法直接使用），不能达到开箱即用的水平。使用本项目需要读文档+源码+动手实践，参考示例代码（test文件夹下）进行改写。提示：另外，已经有很多朋友（大佬）通过直接看源码，已经基于这套项目，或者重写，用于各自的需求。实现思路一:从微信公众号平台获取微信公众所有文章的url登录微信PC端或移动端获取文章的阅读数、点赞数、评论信息完整思路可以参考我的博客:记一次微信公众号爬虫的经历（微信文章阅读点赞的获取）实现思路二：登陆微信PC端或移动端获取公众号所有文章的url，这种获取到的url数量大于500，具体数量每个微信号不完全一致同上种方法，获取文章阅读数、点赞数、评论信息公开已爬取的公众号历史文章的永久链接，日期均截止commit时间，仅供测试与学习，欢迎各位关注这些优质公众号。公众号列表科技美学共青团中央南方周末AppSo## Notes项目始于2017年，当前更新于2021年3月项目代码进行调整，调用以前的接口请使用pip install wechatarticles==0.5.8。爬取失败的时候，可能有以下原因运行的时候需要关闭网络代理（抓包软件），或者添加相关参数参数是否最新，获取微信相关参数（cookie、token）时，一定要保证是对应公众号的任意文章检查代码需要关注对应公众号（Maybe）思路一获取url时，每页间隔可以设定久一点，比如3分钟，持续时间几小时（来自网友测试）获取文章阅读点赞时，每篇文章可以设定在5-10s左右，过期时间为4小时；若被封，大约5-10分钟就可继续抓取。思路二获取url时，如果被封，需要24小时整之后才能重新抓取参数文件说明见READMEpython版本python: 3.6.2、3.7.3功能实现功能公众号相关公众号信息公众号biz。获取方式：清博、公众号网页公众号发表文章数量（不完全准确）文章相关某公众号文章的url。获取方式：公众号网页、PC端微信、移动端微信、微信读书某公众号所有文章信息（包含点赞数、阅读数、评论信息），需要手动更改循环某公众号指定文章的信息支持微信文章下载至本地转为html（图片可选是否保存）API实例利用公众号网页版获取微信文章url此处有次数限制，不可一次获取太多url。解决方案多个账号同时爬取test_WechatUrls.py登录微信PC端获取文章信息（阅读点赞）test_WechatInfo.py快速获取大量文章urls（利用历史文章获取链接）test_GetUrls.py微信文章下载为离线HTML（含图片）test_Url2Html.py学习/运行流程可以看这个issue，十分感谢大佬简洁的文字说明。相关文档见博客与下方文档official_cookie和token手动获取方式见这篇文档wechat_cookie和appmsg_token手动获取的介绍，可以参考这篇文档联系注意事项：不（能）做自动登录微信公众号、微信不（能）做实时（获取参数、阅读点赞、获取文章）换一个公众号、参数过期，均需手动更新，如何获取参数均在文章中提及，请仔细查阅不能做关键词搜索（即微信搜一搜功能），比如搜索所有含“科技”两个字的文章。Q & A项目能不能正常运行？答：项目可正常运行。xxx怎么运行/启动，需要获取哪些参数？答：请看源码，并手动运行看看输出报错。xxx参数怎么获取？答：文档和博客均描述的很清楚，请仔细阅读。我要xxxx，需要怎么做？答：看文档，看源码网页每日更新的方式怎么做的？答：不是万能key。方案很简单，就是模拟点击+代理软件(Fiddler或Mitmproxy)拦截包，每日抓一次，如果你有更好的方案也欢迎告知。这部分未开源（如果有看到相关完整开源的可以提个issue学习一下），纯粹是因为配环境+定制化太麻烦，而且存在一定的问题。懂的看到这里能够实现的就能实现，如果问我我也不好回答你，太耗时耗力。PC端微信与抓包软件Fiddler是必装的吗？答：不是。这个只是我了解(认为)到，这两个是相对最容易完成整个过程的。代替方案：可以抓手机端的微信（安卓和IOS均可，安卓的要root才能抓到阅读点赞）；抓包软件Fiddler这个可替代的很多，只要能进行HTTPS抓包查看数据就行。大量公众号的文章怎么抓？答：本项目无法实现。没很好的方案，参考5。切换一个公众号的时间成本大概要3-5分钟，视熟练程度而异。附录：问问题的正常方式：描述清楚你运行的系统环境、Python环境...（这步骤可选择性忽略）运行了什么代码（改动了哪部分），报了什么错（请完整截图）？自己根据报错做了哪些尝试？（文档中是否有描述？在网上搜索的解决方案有哪些）编程是实践出真知，运行的正确与否可以直接试出来，没必要耽误两个人的时间。如果运行出了问题，请按照以上流程进行提问，但前提是自己要运行过。请直接说问题or需求，不需要等我回复再说。谢谢！大部分问题均可以交流，如果事无巨细的提问，也接受付费教学。微信二维码
Package: wechat-auto
# wechat_auto微信群控系统## Function list1. 使用微信`文件助手`实现远程控制，在`文件助手`中输入`help`获取所有命令列表2. 自动通过好友请求，打招呼信息保存在`wechat_auto.GREETING`变量中，为长度为3的一个数组## New features### 1可以给制定群定时发送消息，消息内容在`/storage/joke`文件中读取，每条消息由'|'符号分割。消息间隔时间在`wechat_auto.CHATROOM_SPAN`定义，默认为1小时，也就是3600秒。群名称由`wechat_auto.CHATROOM_NAME_MESSAGE`定义，默认是"哈哈哈哈哈哈哈"`wechat_auto.SWITCH_MESSAGE`默认为False，也就是关闭定时群消息功能### 2添加新功能，可以在所有群聊有新人加入的时候自动@新人打招呼，并且可是设置群名称，为LIST变量过滤变量为`wechat_auto.CHATROOM_NAME_GREETING`打招呼信息变量为`wechat_auto.CHATROOM_GREETING`### 3添加新功能，在指定群众任何人发布特定消息，比如“群主最棒”，此微信自动回复一条段子，可以设置时间间隔`AUTOFUNNY_SPAN`以秒计,消息内容`CHATRROM_AUTOFUNNY`,指定群内容`CHATROOM_NAME_AUTOFUNNY`LIST格式
Package: wechat-backup
wechat-backupA command-line tool to help user manage data inWeChatbackup files.How to UseUsage: wechat-backup [OPTIONS] COMMAND [ARGS]...

  A command-line tool to help user manage data in WeChat backup files.

Options:
  --version           Show version information.
  -p, --profile TEXT  Profile to load from configurations.
  --help              Show this message and exit.

Commands:
  extract-contacts  Extract WeChat contacts.
  extract-messages  Extract messages of a conversation.LicenseCopyright (C) 2023 HE Yaowenhe.yaowen@hotmail.comThe GNU General Public License (GPL) version 3, seeCOPYING.
Package: wechatbot
WechatBotWechatBotis a wechat bot built for geeks.1. 快速上手1.1 安装pipinstallwechatbot1.2 用法贴上示例代码， wechatbot/ping.py。# -*- coding:utf-8 -*-fromwechatbotimportWechatBotclassMyBot(WechatBot):deftext_reply(self,msg):if"ping"inmsg:return'pong'写完你的代码之后，可以执行`make develop`，根据提示扫描二维码之后，机器人就跑起来啦。
这时，可以向机器人发送一个ping的消息来看看服务是否正常。2. 规划接下来会把Bot做成一个更加基础的服务，只对外暴露两个模块:在接受指令之后发送定制消息 [done]主动向某个用户发送消息 [doing]谢谢阅读！Good luck, have fun!
Package: wechat-enterprise-sdk
用 Python 发送企业微信消息支持发送：文本文件图片MarkDown安装pipinstallwechat-enterprise-sdk使用获取的 access_token 会保存在 ./tmp/cache.json 里面，避免高频率获取 access_token。fromwechat_enterpriseimportWechatEnterprisewe=WechatEnterprise(corpid="ww2563f***********",# 企业 IDappid="100****3",# 企业应用 IDcorpsecret="*********************",# 企业应用 Secret)#接收者 ID，在企业微信通讯录中查看receivers=["ZhengZheng","DaZhengGe"]# 发送 文本we.send_text("来息 somenzz 的消息",receivers)# 发送 Markdownwe.send_markdown("# Markdown",receivers)# 发送图片we.send_image("/Users/aaron/Downloads/images.jpeg",receivers)# 发送文件we.send_file("./wechat_enterprise.py",receivers)todo添加企业微信的其他实用功能联系我添加微信 「somenzz」 备注 「github」个人公众号 「Python七号」，微信搜一搜关注。
Package: wechat-mp
wechat_mp 是什么？是用来登陆微信公众号后台的第三方库，而登陆后台不是微信操作后台发送群发或者消息等，因为微信本身就提供了开发者文档供用户调用。
微信后台有一些功能是API不提供的，例如以下三个：根据公众号名称搜索公众号，并查看其群发过的图文根据关键词搜索相关的群发图文导出公众号选择的模板行业库中的所有模板示例Python版本Python 3.6.x如何安装源码安装$ git clone https://github.com/RogerLiNing/wechat_mp.git
$ cd wechat_mp
$ python setup.py installpip 安装pipinstallwechat-mp使用方法登陆需要注意，你需要先注册一个微信公众号账号，
服务号或者订阅号都可以。需要注意，只有认证的服务号才能获取行业模板消息。
enable_cookies参数控制是否保持登录, 默认为False，需要注意的是，目前使用PIL弹出二维码，如果在没有GUI的操作系统无法扫码。当同一账号连续输错三次密码时，会需要输入验证码，届时会自动打开验证码图片，记住验证码后关闭图片查看，然后在程序中输入验证码即可。fromwechat_mpimportWeChatEMAIL="me@example.com"PASSWORD="admin"# 可同时初始化多个不同的账号，例如client1, client2client=WeChat(email=EMAIL,password=PASSWORD,enable_cookies=True)1. 查询某个公众号的历史群发图文目前支持：根据名称搜索公众号公众号本身是对象，可以通过对象方法articles获取其图文列表图文本身也是对象，可以查看其属性可以将图文列表导出到Excel文件中搜索公众号：返回公众号对象列表，公众号对象中主要的两个：nickname 和 service_typeaccounts=client.search_account("python阅读空间",limit=10)公号对象属性属性解释fakeidIDnickname公众号昵称alias自定义昵称round_head_img圆头像地址service_type公号类型获取公众号的推送图文这里选取了第一个账号，调用articles()方法获取其所有的图文。有些公众号有很多图文，传入limit参数来获取前N篇图文。
你也可以传入title_contain参数来只获取标题包含特定关键词的图文，可以传入interval参数来限制请求频率，默认3秒。articles=accounts[0].articles()图文对象属性属性解释aid群发ID+ 群发序号appmsgid群发idcover封面地址digest图文摘要itemidx图文群发序号link图文链接title图文标题导出到文件调用图文结果对象articles提供了save_articles_as_excel方法可以导出图文结果到Excel文件。articles.save_articles_as_excel("python阅读空间")2.根据关键词搜索图文目前支持：根据关键词搜索图文图文本身也是对象，可以查看其属性可以将图文列表导出到Excel文件中搜索图文调用search_article方法会返回一个结果对象，你可以是用for循环输出打印result=client.search_article("python内存管理",limit=100)图文对象属性属性article_type图文类目author作者content正文内容（包含HTML代码）cover_url封面地址head_img_url公众号头像地址nickname公众号昵称source_can_rewardsource_reprint_statussource_urltitle图文标题url图文地址将图文导出到Excel文件调用图文结果对象result提供了save_articles_as_excel方法可以导出图文结果到Excel文件。result.save_articles_as_excel("python内存管理")作者公众号Python阅读空间打包python -m pip install --user --upgrade setuptools wheel
python setup.py sdist bdist_wheel

dist/
  example_pkg_your_username-0.0.1-py3-none-any.whl
  example_pkg_your_username-0.0.1.tar.gz上传python -m pip install --user --upgrade twine
python -m twine upload dist/*作者Roger Lee贡献者Zheng
Package: wechat-msg
Wechat_msg企业微信发送消息接口，Pythonfromwechat_msg.WeChatimportAuthorize,Send,Uploadcorpid=''corpsecret=''agentid=''a=Authorize(corpid,corpsecret)token=a.get_token()s=Send(agentid,token)s.send_msg("TEST",name="username")s.send_img("img_path",name="username")