gewechat_client/contains the Python package.gewechat_client/client.pyis the main client entry point.gewechat_client/api/groups API modules (e.g.,message_api.py,login_api.py).gewechat_client/util/holds helpers such as HTTP utilities and terminal printing.
demo.pyshows an end-to-end usage flow (login, fetch contacts, send message).docs/holds documentation assets (e.g.,docs/images/).setup.pyandbuild.share used for packaging and distribution.
pip install -e .installs the package in editable mode for local development.python demo.pyruns the sample client flow; configureBASE_URL,GEWECHAT_TOKE, andAPP_IDenv vars first../build.shbuilds source and wheel distributions (sdist+bdist_wheel).python setup.py sdist bdist_wheelis the direct equivalent of the build script.
- Python 3.6+ codebase with 4-space indentation.
- Prefer
snake_casefor functions/variables andPascalCasefor classes (seeGewechatClient). - Keep modules focused by API surface area; add new endpoints under
gewechat_client/api/. - Match existing patterns: methods return dicts with
ret,msg, anddatakeys where applicable.
- There are no automated tests in this repository currently.
- If adding tests, place them under a new
tests/directory and name filestest_*.py. - Keep tests lightweight and focused on API method behavior and error handling.
- Recent commits use conventional prefixes like
feat:,fix:, anddocs:; follow the same pattern. - Keep commit subjects short and action-oriented (e.g.,
fix: handle login error type). - PRs should include: a clear description, linked issues (if any), and a brief test note (e.g., “manual run:
python demo.py”).
- The demo relies on environment variables for API endpoint and credentials; avoid hardcoding tokens.
- If you introduce new configuration, document it in
README.mdand prefer env vars.
- 请使用中文回答我的提问
- 循序渐进写代码,实现一部分代码停下来总结一下你的代码,方便我及时review