pyleys 0.1.0a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. pyleys-0.1.0a1/.github/ISSUE_TEMPLATE/bug_report.yml +62 -0
  2. pyleys-0.1.0a1/.github/ISSUE_TEMPLATE/feature_request.yml +35 -0
  3. pyleys-0.1.0a1/.github/pull_request_template.md +20 -0
  4. pyleys-0.1.0a1/.github/workflows/ci.yml +60 -0
  5. pyleys-0.1.0a1/.github/workflows/release.yml +91 -0
  6. pyleys-0.1.0a1/.gitignore +218 -0
  7. pyleys-0.1.0a1/.pre-commit-config.yaml +17 -0
  8. pyleys-0.1.0a1/CHANGELOG.md +60 -0
  9. pyleys-0.1.0a1/CODE_OF_CONDUCT.md +55 -0
  10. pyleys-0.1.0a1/CONTRIBUTING.md +105 -0
  11. pyleys-0.1.0a1/EN-API_REFERENCE.md +13 -0
  12. pyleys-0.1.0a1/EN-README.md +21 -0
  13. pyleys-0.1.0a1/ID-API_REFERENCE.md +13 -0
  14. pyleys-0.1.0a1/ID-README.md +20 -0
  15. pyleys-0.1.0a1/LICENSE +21 -0
  16. pyleys-0.1.0a1/PKG-INFO +430 -0
  17. pyleys-0.1.0a1/README.md +371 -0
  18. pyleys-0.1.0a1/SECURITY.md +46 -0
  19. pyleys-0.1.0a1/docs/API_REFERENCE.md +15 -0
  20. pyleys-0.1.0a1/docs/en/API_REFERENCE.md +923 -0
  21. pyleys-0.1.0a1/docs/en/CHANGELOG.md +60 -0
  22. pyleys-0.1.0a1/docs/en/CONTRIBUTING.md +105 -0
  23. pyleys-0.1.0a1/docs/en/README.md +371 -0
  24. pyleys-0.1.0a1/docs/en/SECURITY.md +46 -0
  25. pyleys-0.1.0a1/docs/id/API_REFERENCE.md +847 -0
  26. pyleys-0.1.0a1/docs/id/CHANGELOG.md +60 -0
  27. pyleys-0.1.0a1/docs/id/CONTRIBUTING.md +105 -0
  28. pyleys-0.1.0a1/docs/id/README.md +368 -0
  29. pyleys-0.1.0a1/docs/id/SECURITY.md +46 -0
  30. pyleys-0.1.0a1/examples/demo_app.py +424 -0
  31. pyleys-0.1.0a1/examples/login_pairing_code.py +45 -0
  32. pyleys-0.1.0a1/examples/login_qr.py +55 -0
  33. pyleys-0.1.0a1/examples/node_examples/ping.json +15 -0
  34. pyleys-0.1.0a1/examples/simple_cli.py +531 -0
  35. pyleys-0.1.0a1/proto/WAProto.proto +5520 -0
  36. pyleys-0.1.0a1/pyproject.toml +86 -0
  37. pyleys-0.1.0a1/scripts/regenerate_generated.sh +13 -0
  38. pyleys-0.1.0a1/src/pyleys/__init__.py +120 -0
  39. pyleys-0.1.0a1/src/pyleys/appstate/__init__.py +52 -0
  40. pyleys-0.1.0a1/src/pyleys/appstate/keys.py +52 -0
  41. pyleys-0.1.0a1/src/pyleys/appstate/lthash.py +55 -0
  42. pyleys-0.1.0a1/src/pyleys/appstate/processor.py +490 -0
  43. pyleys-0.1.0a1/src/pyleys/appstate/sync.py +86 -0
  44. pyleys-0.1.0a1/src/pyleys/auth/__init__.py +21 -0
  45. pyleys-0.1.0a1/src/pyleys/auth/backends.py +227 -0
  46. pyleys-0.1.0a1/src/pyleys/auth/creds.py +73 -0
  47. pyleys-0.1.0a1/src/pyleys/auth/serde.py +65 -0
  48. pyleys-0.1.0a1/src/pyleys/auth/state.py +28 -0
  49. pyleys-0.1.0a1/src/pyleys/auth/store.py +128 -0
  50. pyleys-0.1.0a1/src/pyleys/auth/utils.py +45 -0
  51. pyleys-0.1.0a1/src/pyleys/client.py +6301 -0
  52. pyleys-0.1.0a1/src/pyleys/connection/__init__.py +12 -0
  53. pyleys-0.1.0a1/src/pyleys/connection/handshake.py +191 -0
  54. pyleys-0.1.0a1/src/pyleys/connection/websocket.py +102 -0
  55. pyleys-0.1.0a1/src/pyleys/crypto/__init__.py +19 -0
  56. pyleys-0.1.0a1/src/pyleys/crypto/aes.py +74 -0
  57. pyleys-0.1.0a1/src/pyleys/crypto/curve.py +53 -0
  58. pyleys-0.1.0a1/src/pyleys/crypto/curve25519_signature.py +283 -0
  59. pyleys-0.1.0a1/src/pyleys/crypto/hkdf.py +37 -0
  60. pyleys-0.1.0a1/src/pyleys/crypto/noise.py +257 -0
  61. pyleys-0.1.0a1/src/pyleys/defaults/__init__.py +40 -0
  62. pyleys-0.1.0a1/src/pyleys/defaults/browsers.py +41 -0
  63. pyleys-0.1.0a1/src/pyleys/defaults/constants.py +25 -0
  64. pyleys-0.1.0a1/src/pyleys/exceptions.py +55 -0
  65. pyleys-0.1.0a1/src/pyleys/media/__init__.py +37 -0
  66. pyleys-0.1.0a1/src/pyleys/media/core.py +270 -0
  67. pyleys-0.1.0a1/src/pyleys/media/meta.py +190 -0
  68. pyleys-0.1.0a1/src/pyleys/messages/__init__.py +85 -0
  69. pyleys-0.1.0a1/src/pyleys/messages/wa_message.py +374 -0
  70. pyleys-0.1.0a1/src/pyleys/messages/wa_message_builder.py +1019 -0
  71. pyleys-0.1.0a1/src/pyleys/proto/WAProto_pb2.py +1398 -0
  72. pyleys-0.1.0a1/src/pyleys/proto/__init__.py +5 -0
  73. pyleys-0.1.0a1/src/pyleys/py.typed +1 -0
  74. pyleys-0.1.0a1/src/pyleys/signal/__init__.py +10 -0
  75. pyleys-0.1.0a1/src/pyleys/signal/address.py +35 -0
  76. pyleys-0.1.0a1/src/pyleys/signal/group.py +462 -0
  77. pyleys-0.1.0a1/src/pyleys/signal/kdf.py +53 -0
  78. pyleys-0.1.0a1/src/pyleys/signal/repository.py +923 -0
  79. pyleys-0.1.0a1/src/pyleys/signal/util.py +38 -0
  80. pyleys-0.1.0a1/src/pyleys/socket/__init__.py +37 -0
  81. pyleys-0.1.0a1/src/pyleys/socket/communities.py +115 -0
  82. pyleys-0.1.0a1/src/pyleys/socket/config.py +30 -0
  83. pyleys-0.1.0a1/src/pyleys/socket/socket.py +1814 -0
  84. pyleys-0.1.0a1/src/pyleys/store.py +315 -0
  85. pyleys-0.1.0a1/src/pyleys/types/__init__.py +123 -0
  86. pyleys-0.1.0a1/src/pyleys/types/api.py +429 -0
  87. pyleys-0.1.0a1/src/pyleys/usync/__init__.py +21 -0
  88. pyleys-0.1.0a1/src/pyleys/usync/query.py +237 -0
  89. pyleys-0.1.0a1/src/pyleys/utils/__init__.py +25 -0
  90. pyleys-0.1.0a1/src/pyleys/utils/asyncio.py +44 -0
  91. pyleys-0.1.0a1/src/pyleys/utils/bytes.py +43 -0
  92. pyleys-0.1.0a1/src/pyleys/utils/events.py +296 -0
  93. pyleys-0.1.0a1/src/pyleys/utils/json.py +33 -0
  94. pyleys-0.1.0a1/src/pyleys/wabinary/__init__.py +29 -0
  95. pyleys-0.1.0a1/src/pyleys/wabinary/constants.py +16 -0
  96. pyleys-0.1.0a1/src/pyleys/wabinary/decode.py +217 -0
  97. pyleys-0.1.0a1/src/pyleys/wabinary/encode.py +193 -0
  98. pyleys-0.1.0a1/src/pyleys/wabinary/jid.py +88 -0
  99. pyleys-0.1.0a1/src/pyleys/wabinary/types.py +22 -0
  100. pyleys-0.1.0a1/tests/test_appstate_processor.py +152 -0
  101. pyleys-0.1.0a1/tests/test_auth_store.py +27 -0
  102. pyleys-0.1.0a1/tests/test_call_rejection.py +103 -0
  103. pyleys-0.1.0a1/tests/test_client_api.py +726 -0
  104. pyleys-0.1.0a1/tests/test_curve25519_signatures.py +31 -0
  105. pyleys-0.1.0a1/tests/test_events.py +96 -0
  106. pyleys-0.1.0a1/tests/test_group_metadata.py +66 -0
  107. pyleys-0.1.0a1/tests/test_history_requests.py +51 -0
  108. pyleys-0.1.0a1/tests/test_media_crypto.py +94 -0
  109. pyleys-0.1.0a1/tests/test_message_builder.py +371 -0
  110. pyleys-0.1.0a1/tests/test_noise.py +35 -0
  111. pyleys-0.1.0a1/tests/test_pairing_code.py +103 -0
  112. pyleys-0.1.0a1/tests/test_quoted_message.py +109 -0
  113. pyleys-0.1.0a1/tests/test_signal_cipher_roundtrip.py +128 -0
  114. pyleys-0.1.0a1/tests/test_signal_group_sender_keys.py +112 -0
  115. pyleys-0.1.0a1/tests/test_socket_config.py +11 -0
  116. pyleys-0.1.0a1/tests/test_socket_lifecycle.py +85 -0
  117. pyleys-0.1.0a1/tests/test_sqlite_store.py +107 -0
  118. pyleys-0.1.0a1/tests/test_usync.py +148 -0
  119. pyleys-0.1.0a1/tests/test_wa_padding.py +11 -0
  120. pyleys-0.1.0a1/tests/test_wabinary_roundtrip.py +21 -0
  121. pyleys-0.1.0a1/tools/e2e_smoke.sh +571 -0
  122. pyleys-0.1.0a1/tools/gen_wabinary_constants.py +131 -0
  123. pyleys-0.1.0a1/tools/patch_waproto_for_protoc.py +99 -0
@@ -0,0 +1,62 @@
1
+ name: Bug report
2
+ description: Report a bug
3
+ labels: ["bug"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Thanks for reporting. Please do **not** include auth state, keys, QR codes, or other secrets.
9
+
10
+ - type: input
11
+ id: version
12
+ attributes:
13
+ label: pyleys version
14
+ placeholder: "0.1.0"
15
+ validations:
16
+ required: true
17
+
18
+ - type: input
19
+ id: python
20
+ attributes:
21
+ label: Python version
22
+ placeholder: "3.12.2"
23
+ validations:
24
+ required: true
25
+
26
+ - type: input
27
+ id: os
28
+ attributes:
29
+ label: OS
30
+ placeholder: "macOS 14.4 / Ubuntu 24.04"
31
+ validations:
32
+ required: true
33
+
34
+ - type: textarea
35
+ id: steps
36
+ attributes:
37
+ label: Steps to reproduce
38
+ description: Minimal steps to reproduce the issue.
39
+ validations:
40
+ required: true
41
+
42
+ - type: textarea
43
+ id: expected
44
+ attributes:
45
+ label: Expected behavior
46
+ validations:
47
+ required: true
48
+
49
+ - type: textarea
50
+ id: actual
51
+ attributes:
52
+ label: Actual behavior
53
+ validations:
54
+ required: true
55
+
56
+ - type: textarea
57
+ id: logs
58
+ attributes:
59
+ label: Logs (redacted)
60
+ description: Paste relevant logs. Redact secrets.
61
+ render: text
62
+
@@ -0,0 +1,35 @@
1
+ name: Feature request
2
+ description: Suggest an idea or improvement
3
+ labels: ["enhancement"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Thanks for the suggestion. Please include context and any relevant protocol references.
9
+
10
+ - type: textarea
11
+ id: problem
12
+ attributes:
13
+ label: Problem statement
14
+ description: What problem are you trying to solve?
15
+ validations:
16
+ required: true
17
+
18
+ - type: textarea
19
+ id: proposal
20
+ attributes:
21
+ label: Proposed solution
22
+ description: What would you like to see added/changed?
23
+ validations:
24
+ required: true
25
+
26
+ - type: textarea
27
+ id: alternatives
28
+ attributes:
29
+ label: Alternatives considered
30
+
31
+ - type: textarea
32
+ id: additional
33
+ attributes:
34
+ label: Additional context
35
+
@@ -0,0 +1,20 @@
1
+ ## What
2
+
3
+ Describe what this PR changes.
4
+
5
+ ## Why
6
+
7
+ Explain the motivation / bug / feature.
8
+
9
+ ## How
10
+
11
+ Implementation notes and tradeoffs.
12
+
13
+ ## Checklist
14
+
15
+ - [ ] Tests added/updated
16
+ - [ ] `ruff check .` and `ruff format .` pass
17
+ - [ ] `mypy src/pyleys` passes
18
+ - [ ] README/docs updated if needed
19
+ - [ ] No secrets/auth state committed
20
+
@@ -0,0 +1,60 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ tests:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ python-version: ["3.11", "3.12", "3.13"]
14
+
15
+ steps:
16
+ - name: Checkout
17
+ uses: actions/checkout@v4
18
+
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ cache: pip
24
+
25
+ - name: Install
26
+ run: |
27
+ python -m pip install --upgrade pip
28
+ python -m pip install -e ".[dev]"
29
+
30
+ - name: Lint (ruff)
31
+ run: |
32
+ ruff check .
33
+ ruff format --check .
34
+
35
+ - name: Type check (mypy)
36
+ run: |
37
+ mypy src/pyleys
38
+
39
+ - name: Run tests
40
+ run: |
41
+ pytest -q
42
+
43
+ package:
44
+ runs-on: ubuntu-latest
45
+ steps:
46
+ - name: Checkout
47
+ uses: actions/checkout@v4
48
+
49
+ - name: Set up Python
50
+ uses: actions/setup-python@v5
51
+ with:
52
+ python-version: "3.13"
53
+ cache: pip
54
+
55
+ - name: Build sdist/wheel + validate metadata
56
+ run: |
57
+ python -m pip install --upgrade pip
58
+ python -m pip install -e ".[dev]"
59
+ python -m build
60
+ twine check dist/*
@@ -0,0 +1,91 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.13"
20
+ cache: pip
21
+
22
+ - name: Install build tooling
23
+ run: |
24
+ python -m pip install --upgrade pip
25
+ python -m pip install build
26
+ python -m pip install -e ".[dev]"
27
+
28
+ - name: Lint + typecheck + tests
29
+ run: |
30
+ ruff check .
31
+ ruff format --check .
32
+ mypy src/pyleys
33
+ pytest -q
34
+
35
+ - name: Validate tag matches version
36
+ if: startsWith(github.ref, 'refs/tags/v')
37
+ run: |
38
+ python - <<'PY'
39
+ import os
40
+ import re
41
+ import tomllib
42
+ from pathlib import Path
43
+
44
+ tag = os.environ["GITHUB_REF_NAME"]
45
+ m = re.fullmatch(r"v(.+)", tag)
46
+ if not m:
47
+ raise SystemExit(f"unexpected tag format: {tag!r} (expected vX.Y.Z)")
48
+ version = m.group(1)
49
+
50
+ with open("pyproject.toml", "rb") as f:
51
+ pyproject = tomllib.load(f)
52
+ project_version = pyproject["project"]["version"]
53
+ if project_version != version:
54
+ raise SystemExit(f"pyproject.toml version {project_version!r} does not match tag {version!r}")
55
+
56
+ t = Path("src/pyleys/__init__.py").read_text("utf-8")
57
+ m2 = re.search(r"^__version__\s*=\s*['\"]([^'\"]+)['\"]", t, re.M)
58
+ init_version = m2.group(1) if m2 else None
59
+ if init_version != version:
60
+ raise SystemExit(f"src/pyleys/__init__.py __version__ {init_version!r} does not match tag {version!r}")
61
+
62
+ print(f"Version OK: {version}")
63
+ PY
64
+
65
+ - name: Build sdist and wheel
66
+ run: |
67
+ python -m build
68
+
69
+ - name: Upload dist artifacts
70
+ uses: actions/upload-artifact@v4
71
+ with:
72
+ name: dist
73
+ path: dist/*
74
+
75
+ publish:
76
+ needs: build
77
+ runs-on: ubuntu-latest
78
+ permissions:
79
+ id-token: write
80
+ environment:
81
+ name: pypi
82
+ url: https://pypi.org/project/pyleys/
83
+ steps:
84
+ - name: Download dist artifacts
85
+ uses: actions/download-artifact@v4
86
+ with:
87
+ name: dist
88
+ path: dist
89
+
90
+ - name: Publish to PyPI (Trusted Publishing)
91
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,218 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Local WhatsApp auth state (do not commit)
198
+ /auth/
199
+ /auth-*/
200
+ manual_tests/*
201
+ pyleys.sqlite3
202
+ pyleys.sqlite3-*
203
+
204
+ # Local AI conversation archives and session dumps
205
+ codex-*.md
206
+ session-*.json
207
+
208
+ # Cursor
209
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
210
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
211
+ # refer to https://docs.cursor.com/context/ignore-files
212
+ .cursorignore
213
+ .cursorindexingignore
214
+
215
+ # Marimo
216
+ marimo/_static/
217
+ marimo/_lsp/
218
+ __marimo__/
@@ -0,0 +1,17 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.6.0
4
+ hooks:
5
+ - id: check-added-large-files
6
+ - id: check-merge-conflict
7
+ - id: check-toml
8
+ - id: check-yaml
9
+ - id: end-of-file-fixer
10
+ - id: trailing-whitespace
11
+
12
+ - repo: https://github.com/astral-sh/ruff-pre-commit
13
+ rev: v0.5.7
14
+ hooks:
15
+ - id: ruff
16
+ args: ["--fix"]
17
+ - id: ruff-format
@@ -0,0 +1,60 @@
1
+ # Changelog
2
+
3
+ <p align="center">
4
+ <a href="CHANGELOG.md"><b>English</b></a> ·
5
+ <a href="docs/id/CHANGELOG.md">Bahasa Indonesia</a>
6
+ </p>
7
+
8
+ All notable changes to PyLeys are documented here. The format follows
9
+ [Keep a Changelog](https://keepachangelog.com/), and versioning follows
10
+ [Semantic Versioning](https://semver.org/).
11
+
12
+ ## [0.1.0a1] - 2026-11-29
13
+
14
+ ### Added
15
+
16
+ - PyLeys package and public API
17
+ - QR and phone-number pairing with multi-device auth persistence
18
+ - Automatic reconnect with capped backoff after unexpected transport closes
19
+ - One-to-one and group Signal E2E message encryption/decryption
20
+ - Unified `send_message()` API for text, media, buttons, lists, native flows,
21
+ carousels, events, products, polls, locations, contacts, reactions, edits,
22
+ deletes, pins, and raw protobuf messages
23
+ - Fluent message builders in `pyleys.messages` for common send payloads
24
+ - Quoted-message extraction and `quoted=` send support
25
+ - Media send/download support for images, video, audio, voice notes, stickers,
26
+ sticker-audio, and documents
27
+ - SQLite auth backends and a durable local chat/contact/message cache
28
+ - Group, community, newsletter, business-profile, catalog, profile, call-link,
29
+ and app-state helper APIs
30
+ - Typed public payloads and event types under `pyleys.types`
31
+ - Experimental Rich HTML/Rich Response builders with an explicit compatibility
32
+ warning for unsupported devices and WhatsApp versions
33
+ - Bilingual documentation with English defaults and Indonesian translations
34
+
35
+ ### Changed
36
+
37
+ - Package layout grouped into Baileys-like layers: `defaults`, `socket`,
38
+ `types`, `utils`, `media`, `usync`, `wabinary`, `signal`, `auth`, `appstate`,
39
+ `messages`, `connection`, and `proto`
40
+ - Runtime helpers moved from `pyleys.util` to `pyleys.utils`
41
+ - Socket configuration and community helpers moved under `pyleys.socket`
42
+ - Handshake helpers moved under `pyleys.connection`
43
+ - Media helpers moved under `pyleys.media`
44
+ - USync helpers moved under `pyleys.usync`
45
+
46
+ ### Fixed
47
+
48
+ - Rich HTML documentation now uses static HTML and warns that JavaScript is not
49
+ guaranteed to run
50
+ - Rich message sends emit a runtime warning when they rely on the internal
51
+ WhatsApp Rich Response format
52
+ - Readable text extraction covers button, list, native-flow, and rich-response
53
+ messages
54
+
55
+ ### Security
56
+
57
+ - Auth state, keys, QR codes, and account data must not be committed or shared
58
+ - Rich HTML is treated as experimental because it uses an undocumented internal
59
+ WhatsApp format
60
+
@@ -0,0 +1,55 @@
1
+ # Code of Conduct
2
+
3
+ This project follows the Contributor Covenant Code of Conduct.
4
+
5
+ ## Our Pledge
6
+
7
+ We as members, contributors, and maintainers pledge to make participation in our community a harassment-free
8
+ experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex
9
+ characteristics, gender identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, religion, or sexual identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy
13
+ community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our community include:
18
+
19
+ - Demonstrating empathy and kindness toward other people
20
+ - Being respectful of differing opinions, viewpoints, and experiences
21
+ - Giving and gracefully accepting constructive feedback
22
+ - Accepting responsibility and apologizing to those affected by our mistakes
23
+ - Focusing on what is best not just for us as individuals, but for the overall community
24
+
25
+ Examples of unacceptable behavior include:
26
+
27
+ - The use of sexualized language or imagery, and sexual attention or advances
28
+ - Trolling, insulting or derogatory comments, and personal or political attacks
29
+ - Public or private harassment
30
+ - Publishing others' private information, such as a physical or email address, without their explicit permission
31
+ - Other conduct which could reasonably be considered inappropriate in a professional setting
32
+
33
+ ## Enforcement Responsibilities
34
+
35
+ Project maintainers are responsible for clarifying and enforcing standards of acceptable behavior and will take
36
+ appropriate and fair corrective action in response to any behavior they deem inappropriate, threatening,
37
+ offensive, or harmful.
38
+
39
+ ## Scope
40
+
41
+ This Code of Conduct applies within all project spaces and also applies when an individual is officially
42
+ representing the project in public spaces.
43
+
44
+ ## Enforcement
45
+
46
+ PyLeys is maintained at `Elang-elang/PyLeys`. Report unacceptable behavior
47
+ privately to the project maintainer or through the repository's private
48
+ reporting mechanism. Do not publish sensitive reports or personal information in
49
+ a public space.
50
+
51
+ ## Attribution
52
+
53
+ This Code of Conduct is adapted from the Contributor Covenant, version 2.1:
54
+ https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
55
+