matrix-python 0.1.2a0__tar.gz → 1.0.0__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 (149) hide show
  1. matrix_python-1.0.0/.github/ISSUE_TEMPLATE/bug_report.md +28 -0
  2. matrix_python-1.0.0/.github/ISSUE_TEMPLATE/feature--good-first.md +29 -0
  3. matrix_python-1.0.0/.github/ISSUE_TEMPLATE/feature_request.md +21 -0
  4. matrix_python-1.0.0/.github/dependabot.yml +6 -0
  5. matrix_python-1.0.0/.github/pull_request_template.md +14 -0
  6. matrix_python-1.0.0/.github/workflows/CODEOWNERS +1 -0
  7. matrix_python-1.0.0/.github/workflows/codeql.yml +99 -0
  8. matrix_python-1.0.0/.github/workflows/docs.yml +38 -0
  9. {matrix_python-0.1.2a0 → matrix_python-1.0.0}/.github/workflows/publish.yml +4 -2
  10. matrix_python-1.0.0/.github/workflows/scorecard.yml +52 -0
  11. matrix_python-1.0.0/.github/workflows/tests.yml +44 -0
  12. {matrix_python-0.1.2a0 → matrix_python-1.0.0}/.gitignore +4 -2
  13. matrix_python-1.0.0/.pre-commit-config.yaml +44 -0
  14. {matrix_python-0.1.2a0 → matrix_python-1.0.0}/CONTRIBUTING.md +24 -6
  15. matrix_python-1.0.0/LICENSE +21 -0
  16. matrix_python-1.0.0/PKG-INFO +153 -0
  17. matrix_python-1.0.0/README.md +100 -0
  18. matrix_python-1.0.0/docs/docs/examples/checks.md +15 -0
  19. matrix_python-1.0.0/docs/docs/examples/cooldown.md +14 -0
  20. matrix_python-1.0.0/docs/docs/examples/error-handling.md +17 -0
  21. matrix_python-1.0.0/docs/docs/examples/extension.md +26 -0
  22. matrix_python-1.0.0/docs/docs/examples/index.md +20 -0
  23. matrix_python-1.0.0/docs/docs/examples/ping.md +9 -0
  24. matrix_python-1.0.0/docs/docs/examples/reaction.md +14 -0
  25. matrix_python-1.0.0/docs/docs/examples/scheduler.md +19 -0
  26. matrix_python-1.0.0/docs/docs/guides/bigger-bot.md +95 -0
  27. matrix_python-1.0.0/docs/docs/guides/checks.md +114 -0
  28. matrix_python-1.0.0/docs/docs/guides/commands.md +158 -0
  29. matrix_python-1.0.0/docs/docs/guides/configuration.md +86 -0
  30. matrix_python-1.0.0/docs/docs/guides/error-handling.md +97 -0
  31. matrix_python-1.0.0/docs/docs/guides/events.md +115 -0
  32. matrix_python-1.0.0/docs/docs/guides/groups.md +111 -0
  33. matrix_python-1.0.0/docs/docs/guides/index.md +87 -0
  34. matrix_python-1.0.0/docs/docs/guides/introduction.md +126 -0
  35. matrix_python-1.0.0/docs/docs/img/favicon.svg +68 -0
  36. matrix_python-1.0.0/docs/docs/img/matrixpy-black.svg +72 -0
  37. matrix_python-1.0.0/docs/docs/img/matrixpy-white.svg +89 -0
  38. matrix_python-1.0.0/docs/docs/index.md +175 -0
  39. matrix_python-1.0.0/docs/docs/reference/bot.md +20 -0
  40. matrix_python-1.0.0/docs/docs/reference/checks.md +17 -0
  41. matrix_python-1.0.0/docs/docs/reference/command.md +15 -0
  42. matrix_python-1.0.0/docs/docs/reference/config.md +19 -0
  43. matrix_python-1.0.0/docs/docs/reference/content.md +34 -0
  44. matrix_python-1.0.0/docs/docs/reference/context.md +15 -0
  45. matrix_python-1.0.0/docs/docs/reference/errors.md +18 -0
  46. matrix_python-1.0.0/docs/docs/reference/extension.md +30 -0
  47. matrix_python-1.0.0/docs/docs/reference/group.md +19 -0
  48. matrix_python-1.0.0/docs/docs/reference/message.md +15 -0
  49. matrix_python-1.0.0/docs/docs/reference/protocols.md +5 -0
  50. matrix_python-1.0.0/docs/docs/reference/registry.md +7 -0
  51. matrix_python-1.0.0/docs/docs/reference/room.md +15 -0
  52. matrix_python-1.0.0/docs/docs/reference/scheduler.md +16 -0
  53. matrix_python-1.0.0/docs/docs/reference/space.md +15 -0
  54. matrix_python-1.0.0/docs/docs/reference/types.md +26 -0
  55. matrix_python-1.0.0/docs/docs/stylesheets/extra.css +3 -0
  56. matrix_python-1.0.0/docs/mkdocs.yml +123 -0
  57. matrix_python-1.0.0/examples/README.md +27 -0
  58. matrix_python-1.0.0/examples/checks.py +26 -0
  59. matrix_python-1.0.0/examples/cooldown.py +30 -0
  60. matrix_python-1.0.0/examples/error_handling.py +33 -0
  61. matrix_python-1.0.0/examples/extension.py +47 -0
  62. matrix_python-1.0.0/examples/member.py +33 -0
  63. matrix_python-1.0.0/examples/ping.py +11 -0
  64. matrix_python-1.0.0/examples/reaction.py +39 -0
  65. matrix_python-1.0.0/examples/scheduler.py +33 -0
  66. matrix_python-1.0.0/matrix/__init__.py +35 -0
  67. matrix_python-1.0.0/matrix/_error_handler.py +14 -0
  68. matrix_python-1.0.0/matrix/_version.py +24 -0
  69. matrix_python-1.0.0/matrix/api.py +35 -0
  70. matrix_python-1.0.0/matrix/bot.py +430 -0
  71. matrix_python-1.0.0/matrix/checks.py +29 -0
  72. {matrix_python-0.1.2a0 → matrix_python-1.0.0}/matrix/command.py +143 -94
  73. matrix_python-1.0.0/matrix/config.py +125 -0
  74. matrix_python-1.0.0/matrix/content.py +174 -0
  75. matrix_python-1.0.0/matrix/context.py +140 -0
  76. matrix_python-1.0.0/matrix/errors.py +67 -0
  77. matrix_python-1.0.0/matrix/extension.py +90 -0
  78. matrix_python-1.0.0/matrix/group.py +138 -0
  79. matrix_python-1.0.0/matrix/help/__init__.py +4 -0
  80. matrix_python-1.0.0/matrix/help/help_command.py +372 -0
  81. matrix_python-1.0.0/matrix/help/pagination.py +73 -0
  82. matrix_python-1.0.0/matrix/member.py +217 -0
  83. matrix_python-1.0.0/matrix/message.py +177 -0
  84. matrix_python-1.0.0/matrix/protocols.py +13 -0
  85. matrix_python-1.0.0/matrix/py.typed +0 -0
  86. matrix_python-1.0.0/matrix/registry.py +460 -0
  87. matrix_python-1.0.0/matrix/room.py +512 -0
  88. {matrix_python-0.1.2a0 → matrix_python-1.0.0}/matrix/scheduler.py +13 -10
  89. matrix_python-1.0.0/matrix/space.py +45 -0
  90. matrix_python-1.0.0/matrix/types.py +32 -0
  91. matrix_python-1.0.0/matrix_python.egg-info/PKG-INFO +153 -0
  92. matrix_python-1.0.0/matrix_python.egg-info/SOURCES.txt +116 -0
  93. matrix_python-1.0.0/matrix_python.egg-info/requires.txt +21 -0
  94. matrix_python-1.0.0/matrix_python.egg-info/scm_file_list.json +112 -0
  95. matrix_python-1.0.0/matrix_python.egg-info/scm_version.json +8 -0
  96. {matrix_python-0.1.2a0 → matrix_python-1.0.0}/mypy.ini +2 -0
  97. matrix_python-1.0.0/pyproject.toml +64 -0
  98. matrix_python-1.0.0/tests/help/test_default_help_command.py +84 -0
  99. matrix_python-1.0.0/tests/help/test_help_command.py +174 -0
  100. matrix_python-1.0.0/tests/help/test_pagination.py +83 -0
  101. matrix_python-1.0.0/tests/test_api.py +43 -0
  102. matrix_python-1.0.0/tests/test_bot.py +1102 -0
  103. matrix_python-1.0.0/tests/test_command.py +402 -0
  104. matrix_python-1.0.0/tests/test_config.py +139 -0
  105. matrix_python-1.0.0/tests/test_context.py +224 -0
  106. matrix_python-1.0.0/tests/test_error_handler.py +70 -0
  107. matrix_python-1.0.0/tests/test_extension.py +252 -0
  108. matrix_python-1.0.0/tests/test_group.py +159 -0
  109. matrix_python-1.0.0/tests/test_member.py +392 -0
  110. matrix_python-1.0.0/tests/test_message.py +259 -0
  111. matrix_python-1.0.0/tests/test_registry.py +416 -0
  112. matrix_python-1.0.0/tests/test_room.py +570 -0
  113. matrix_python-1.0.0/tests/test_space.py +151 -0
  114. matrix_python-0.1.2a0/.github/workflows/tests.yml +0 -35
  115. matrix_python-0.1.2a0/LICENSE +0 -674
  116. matrix_python-0.1.2a0/PKG-INFO +0 -771
  117. matrix_python-0.1.2a0/README.md +0 -72
  118. matrix_python-0.1.2a0/examples/checks.py +0 -21
  119. matrix_python-0.1.2a0/examples/cooldown.py +0 -31
  120. matrix_python-0.1.2a0/examples/error.py +0 -36
  121. matrix_python-0.1.2a0/examples/ping.py +0 -12
  122. matrix_python-0.1.2a0/examples/reaction.py +0 -42
  123. matrix_python-0.1.2a0/examples/scheduler.py +0 -35
  124. matrix_python-0.1.2a0/matrix/__init__.py +0 -19
  125. matrix_python-0.1.2a0/matrix/bot.py +0 -422
  126. matrix_python-0.1.2a0/matrix/checks.py +0 -18
  127. matrix_python-0.1.2a0/matrix/config.py +0 -51
  128. matrix_python-0.1.2a0/matrix/context.py +0 -85
  129. matrix_python-0.1.2a0/matrix/errors.py +0 -37
  130. matrix_python-0.1.2a0/matrix/help.py +0 -231
  131. matrix_python-0.1.2a0/matrix/message.py +0 -131
  132. matrix_python-0.1.2a0/matrix/room.py +0 -119
  133. matrix_python-0.1.2a0/matrix_python.egg-info/PKG-INFO +0 -771
  134. matrix_python-0.1.2a0/matrix_python.egg-info/SOURCES.txt +0 -40
  135. matrix_python-0.1.2a0/matrix_python.egg-info/requires.txt +0 -13
  136. matrix_python-0.1.2a0/pyproject.toml +0 -44
  137. matrix_python-0.1.2a0/tests/config_mixture.yaml +0 -4
  138. matrix_python-0.1.2a0/tests/test_bot.py +0 -434
  139. matrix_python-0.1.2a0/tests/test_command.py +0 -237
  140. matrix_python-0.1.2a0/tests/test_config.py +0 -81
  141. matrix_python-0.1.2a0/tests/test_context.py +0 -96
  142. matrix_python-0.1.2a0/tests/test_help.py +0 -127
  143. matrix_python-0.1.2a0/tests/test_message.py +0 -91
  144. matrix_python-0.1.2a0/tests/test_room.py +0 -151
  145. {matrix_python-0.1.2a0 → matrix_python-1.0.0}/CODE_OF_CONDUCT.md +0 -0
  146. {matrix_python-0.1.2a0 → matrix_python-1.0.0}/examples/config.yaml +0 -0
  147. {matrix_python-0.1.2a0 → matrix_python-1.0.0}/matrix_python.egg-info/dependency_links.txt +0 -0
  148. {matrix_python-0.1.2a0 → matrix_python-1.0.0}/matrix_python.egg-info/top_level.txt +0 -0
  149. {matrix_python-0.1.2a0 → matrix_python-1.0.0}/setup.cfg +0 -0
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: PenguinBoi12
7
+ type: Bug
8
+
9
+ ---
10
+
11
+ **Describe the bug**
12
+ A clear and concise description of what the bug is.
13
+
14
+ **To Reproduce**
15
+ Steps to reproduce the behavior:
16
+ 1. Go to '...'
17
+ 2. Click on '....'
18
+ 3. Scroll down to '....'
19
+ 4. See error
20
+
21
+ **Expected behavior**
22
+ A clear and concise description of what you expected to happen.
23
+
24
+ **Screenshots**
25
+ If applicable, add screenshots to help explain your problem.
26
+
27
+ **Additional context**
28
+ Add any other context about the problem here.
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: 'Feature: Good First'
3
+ about: 'This template is for good first issues '
4
+ title: ''
5
+ labels: good first issue
6
+ assignees: ''
7
+ type: Feature
8
+
9
+ ---
10
+
11
+ Explain clearly what we want to add and why it's useful to add it. Give context when necessary.
12
+
13
+ ### Proposed API
14
+ This is a proposed API. It does not necessarily mean it's the final API but it's a good place to start.
15
+
16
+ ```python
17
+ Some code here
18
+ ```
19
+
20
+ **Example**
21
+ ```python
22
+ An example of usage of the feature
23
+ ```
24
+
25
+ ### Before opening a PR
26
+ - Write unit tests
27
+ - Run `mypy matrix/`
28
+ - Run `pytest tests/`
29
+ - Run `black .`
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+ type: Feature
8
+
9
+ ---
10
+
11
+ **Is your feature request related to a problem? Please describe.**
12
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
13
+
14
+ **Describe the solution you'd like**
15
+ A clear and concise description of what you want to happen.
16
+
17
+ **Describe alternatives you've considered**
18
+ A clear and concise description of any alternative solutions or features you've considered.
19
+
20
+ **Additional context**
21
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "monthly"
@@ -0,0 +1,14 @@
1
+ ## Description
2
+ Brief description of what this PR does and why.
3
+
4
+ ### Type of Change
5
+ - [ ] Feature
6
+ - [ ] Refactor
7
+ - [ ] Bug fix
8
+ - [ ] Documentation
9
+ - [ ] Other: ___
10
+
11
+ ### Pre-merge Checklist
12
+ - [ ] Run tests: `pytest`
13
+ - [ ] Run type check: `mypy`
14
+ - [ ] Run formatting: `black .
@@ -0,0 +1 @@
1
+ * @PenguinBoi12
@@ -0,0 +1,99 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL Advanced"
13
+
14
+ on:
15
+ push:
16
+ branches: [ "main" ]
17
+ pull_request:
18
+ branches: [ "main" ]
19
+ schedule:
20
+ - cron: '24 17 * * 4'
21
+
22
+ jobs:
23
+ analyze:
24
+ name: Analyze (${{ matrix.language }})
25
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
26
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
27
+ # - https://gh.io/supported-runners-and-hardware-resources
28
+ # - https://gh.io/using-larger-runners (GitHub.com only)
29
+ # Consider using larger runners or machines with greater resources for possible analysis time improvements.
30
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31
+ permissions:
32
+ # required for all workflows
33
+ security-events: write
34
+
35
+ # required to fetch internal or private CodeQL packs
36
+ packages: read
37
+
38
+ # only required for workflows in private repositories
39
+ actions: read
40
+ contents: read
41
+
42
+ strategy:
43
+ fail-fast: false
44
+ matrix:
45
+ include:
46
+ - language: python
47
+ build-mode: none
48
+ # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
49
+ # Use `c-cpp` to analyze code written in C, C++ or both
50
+ # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
51
+ # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
52
+ # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
53
+ # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
54
+ # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
55
+ # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
56
+ steps:
57
+ - name: Checkout repository
58
+ uses: actions/checkout@v4
59
+
60
+ # Add any setup steps before running the `github/codeql-action/init` action.
61
+ # This includes steps like installing compilers or runtimes (`actions/setup-node`
62
+ # or others). This is typically only required for manual builds.
63
+ # - name: Setup runtime (example)
64
+ # uses: actions/setup-example@v1
65
+
66
+ # Initializes the CodeQL tools for scanning.
67
+ - name: Initialize CodeQL
68
+ uses: github/codeql-action/init@v4
69
+ with:
70
+ languages: ${{ matrix.language }}
71
+ build-mode: ${{ matrix.build-mode }}
72
+ # If you wish to specify custom queries, you can do so here or in a config file.
73
+ # By default, queries listed here will override any specified in a config file.
74
+ # Prefix the list here with "+" to use these queries and those in the config file.
75
+
76
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
77
+ # queries: security-extended,security-and-quality
78
+
79
+ # If the analyze step fails for one of the languages you are analyzing with
80
+ # "We were unable to automatically build your code", modify the matrix above
81
+ # to set the build mode to "manual" for that language. Then modify this step
82
+ # to build your code.
83
+ # ℹ️ Command-line programs to run using the OS shell.
84
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
85
+ - name: Run manual build steps
86
+ if: matrix.build-mode == 'manual'
87
+ shell: bash
88
+ run: |
89
+ echo 'If you are using a "manual" build mode for one or more of the' \
90
+ 'languages you are analyzing, replace this with the commands to build' \
91
+ 'your code, for example:'
92
+ echo ' make bootstrap'
93
+ echo ' make release'
94
+ exit 1
95
+
96
+ - name: Perform CodeQL Analysis
97
+ uses: github/codeql-action/analyze@v4
98
+ with:
99
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,38 @@
1
+ name: Deploy Docs
2
+
3
+ on:
4
+ release:
5
+ types: [ published ]
6
+
7
+ permissions:
8
+ contents: read
9
+ pages: write
10
+ id-token: write
11
+
12
+ jobs:
13
+ deploy:
14
+ runs-on: ubuntu-latest
15
+ environment:
16
+ name: github-pages
17
+ url: ${{ steps.deployment.outputs.page_url }}
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.10"
25
+
26
+ - name: Install dependencies
27
+ run: pip install .[doc]
28
+
29
+ - name: Build docs
30
+ run: cd docs && mkdocs build
31
+
32
+ - uses: actions/upload-pages-artifact@v3
33
+ with:
34
+ path: docs/site
35
+
36
+ - name: Deploy to GitHub Pages
37
+ id: deployment
38
+ uses: actions/deploy-pages@v4
@@ -13,6 +13,8 @@ jobs:
13
13
 
14
14
  steps:
15
15
  - uses: actions/checkout@v4
16
+ with:
17
+ fetch-depth: 0
16
18
 
17
19
  - uses: actions/setup-python@v5
18
20
  with:
@@ -41,7 +43,7 @@ jobs:
41
43
  environment:
42
44
  name: release
43
45
  url: https://pypi.org/project/matrix-python/${{ github.event.release.tag_name }}
44
-
46
+
45
47
  steps:
46
48
  - name: Retrieve release distributions
47
49
  uses: actions/download-artifact@v4
@@ -50,4 +52,4 @@ jobs:
50
52
  path: dist/
51
53
 
52
54
  - name: Publish release distributions to PyPI
53
- uses: pypa/gh-action-pypi-publish@release/v1
55
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,52 @@
1
+ name: Scorecard supply-chain security
2
+ on:
3
+ branch_protection_rule:
4
+ schedule:
5
+ - cron: '16 0 * * 4'
6
+ push:
7
+ branches: ["main"]
8
+ workflow_dispatch:
9
+
10
+ permissions: read-all
11
+
12
+ jobs:
13
+ analysis:
14
+ name: Scorecard analysis
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ # Needed to upload the results to code-scanning dashboard.
18
+ security-events: write
19
+ # Needed to publish results and get a badge (see publish_results below).
20
+ id-token: write
21
+ contents: read
22
+ actions: read
23
+
24
+ steps:
25
+ - name: Harden Runner
26
+ uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
27
+ with:
28
+ egress-policy: audit
29
+
30
+ - name: "Checkout code"
31
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
32
+ with:
33
+ persist-credentials: false
34
+
35
+ - name: "Run analysis"
36
+ uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
37
+ with:
38
+ results_file: results.sarif
39
+ results_format: sarif
40
+ publish_results: true
41
+
42
+ - name: "Upload artifact"
43
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
44
+ with:
45
+ name: SARIF file
46
+ path: results.sarif
47
+ retention-days: 5
48
+
49
+ - name: "Upload to code-scanning"
50
+ uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.29.5
51
+ with:
52
+ sarif_file: results.sarif
@@ -0,0 +1,44 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build:
14
+
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Set up Python 3.12
20
+ uses: actions/setup-python@v3
21
+ with:
22
+ python-version: "3.12"
23
+ - name: Install dependencies
24
+ run: |
25
+ python -m pip install --upgrade pip
26
+ pip install -e .[dev]
27
+ - name: Lint with Black
28
+ id: black
29
+ continue-on-error: true
30
+ run: |
31
+ black --check matrix/ tests/ examples/
32
+ - name: Check typing with mypy
33
+ id: mypy
34
+ continue-on-error: true
35
+ run: |
36
+ mypy matrix
37
+ - name: Test with pytest
38
+ id: pytest
39
+ continue-on-error: true
40
+ run: |
41
+ pytest -v --cov=matrix --cov-report=term-missing --cov-fail-under=90
42
+ - name: All checks succeeded
43
+ if: steps.black.outcome == 'failure' || steps.mypy.outcome == 'failure' || steps.pytest.outcome == 'failure'
44
+ run: exit 1
@@ -165,7 +165,7 @@ cython_debug/
165
165
  # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
166
  # and can be added to the global gitignore or merged into this file. For a more nuclear
167
167
  # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
- #.idea/
168
+ .idea/
169
169
 
170
170
  # Ruff stuff:
171
171
  .ruff_cache/
@@ -175,4 +175,6 @@ cython_debug/
175
175
 
176
176
  .DS_Store
177
177
 
178
- .vscode
178
+ .vscode
179
+ matrix/_version.py
180
+ site/
@@ -0,0 +1,44 @@
1
+ default_language_version:
2
+ python: python3
3
+
4
+ default_stages: [pre-commit]
5
+
6
+ repos:
7
+ - repo: https://github.com/pre-commit/pre-commit-hooks
8
+ rev: v6.0.0
9
+ hooks:
10
+ - id: check-added-large-files
11
+ stages: [pre-commit]
12
+ - id: check-toml
13
+ stages: [pre-commit]
14
+ - id: check-yaml
15
+ exclude: ^docs/mkdocs\.yml$
16
+ stages: [pre-commit]
17
+ - id: end-of-file-fixer
18
+ stages: [pre-commit]
19
+ - id: trailing-whitespace
20
+ stages: [pre-commit]
21
+
22
+ - repo: local
23
+ hooks:
24
+ - id: black
25
+ name: black
26
+ entry: python -m black
27
+ language: system
28
+ stages: [pre-commit]
29
+ types_or: [python, pyi]
30
+
31
+ - id: mypy
32
+ name: mypy
33
+ entry: python -m mypy matrix
34
+ language: system
35
+ pass_filenames: false
36
+ stages: [pre-commit]
37
+ types_or: [python, pyi]
38
+
39
+ - id: pytest
40
+ name: pytest
41
+ entry: python -m pytest
42
+ language: system
43
+ pass_filenames: false
44
+ stages: [pre-commit]
@@ -2,7 +2,7 @@
2
2
  Thank you for your interest in contributing to the matrix.py! As an open source project, many kinds of contributions are welcome.
3
3
 
4
4
  ## How can you contribute?
5
- You can contribute to this project in the follwing ways
5
+ You can contribute to this project in the following ways
6
6
 
7
7
  - Report Bugs
8
8
  - Add new features
@@ -12,9 +12,27 @@ You can contribute to this project in the follwing ways
12
12
  **Warning:** Non-trivial pull requests must have an [issue](https://github.com/Code-Society-Lab/matrixpy/issues) proposing the changes.
13
13
 
14
14
  ## Setup
15
- 1. Clone the Textual repository
16
- 2. Create a virtual enviroment
17
- 3. Install the dependencies
15
+ 1. Clone the matrix.py repository
16
+ 2. Create and activate a virtual environment
17
+ 3. Install the development dependencies and enable the Git hooks.
18
+
19
+ ```bash
20
+ pip install -e ".[dev]"
21
+ pre-commit install
22
+ ```
23
+
24
+
25
+ After installation, the Git hooks run automatically before each commit to check formatting, typing, and tests.
26
+ The hooks include running:
27
+ - black
28
+ - mypy
29
+ - pytest
30
+
31
+ Run the full hook suite manually with:
32
+
33
+ ```bash
34
+ pre-commit run --all-files
35
+ ```
18
36
 
19
37
  ## Guidelines
20
38
  Read any issue instructions carefully. Feel free to ask for clarification if any details are missing.
@@ -22,8 +40,8 @@ Read any issue instructions carefully. Feel free to ask for clarification if any
22
40
  Add docstrings to all of your code (functions, methods, classes, ...). The codebase should have enough examples for you to copy from.
23
41
 
24
42
  Write tests for your code.
25
- If you are fixing a bug, make sure to add regression tests that link to the original issue.
26
- If you are implementing new features, make sure to add tests
43
+ - If you are fixing a bug, add a regression test that references the original issue.
44
+ - If you are implementing a new feature, add tests covering the new functionality.
27
45
 
28
46
  ## Before opening a PR
29
47
 
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Code Society Lab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,153 @@
1
+ Metadata-Version: 2.4
2
+ Name: matrix-python
3
+ Version: 1.0.0
4
+ Summary: An easy-to-use Matrix bot framework designed for quick development and minimal setup
5
+ Author: Simon Roy, Chris Dedman Rollet
6
+ Maintainer-email: Code Society Lab <admin@codesociety.xyz>
7
+ License: The MIT License (MIT)
8
+
9
+ Copyright (c) 2025 Code Society Lab
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in
19
+ all copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
+ THE SOFTWARE.
28
+
29
+ Project-URL: Homepage, https://codesociety.xyz
30
+ Project-URL: Source, https://github.com/Code-Society-Lab/matrixpy
31
+ Project-URL: Issues, https://github.com/Code-Society-Lab/matrixpy/issues
32
+ Requires-Python: >=3.10
33
+ Description-Content-Type: text/markdown
34
+ Requires-Dist: matrix-nio==0.25.2
35
+ Requires-Dist: logger
36
+ Requires-Dist: PyYAML==6.0.3
37
+ Requires-Dist: markdown==3.10.2
38
+ Requires-Dist: APScheduler==3.11.3
39
+ Requires-Dist: envyaml==1.10.211231
40
+ Provides-Extra: dev
41
+ Requires-Dist: pytest==9.1.1; extra == "dev"
42
+ Requires-Dist: pytest-cov==7.1.0; extra == "dev"
43
+ Requires-Dist: pytest-asyncio==1.4.0; extra == "dev"
44
+ Requires-Dist: black==26.5.1; extra == "dev"
45
+ Requires-Dist: mypy==2.1.0; extra == "dev"
46
+ Requires-Dist: pre-commit==4.6.0; extra == "dev"
47
+ Requires-Dist: types-PyYAML==6.0.12.20260518; extra == "dev"
48
+ Requires-Dist: types-Markdown==3.10.2.20260518; extra == "dev"
49
+ Provides-Extra: doc
50
+ Requires-Dist: mkdocs==1.6.1; extra == "doc"
51
+ Requires-Dist: mkdocs-material==9.7.6; extra == "doc"
52
+ Requires-Dist: mkdocstrings[python]==1.0.4; extra == "doc"
53
+
54
+ <div align="center">
55
+ <em>A simple, developer-friendly library to create powerful <a href="https://matrix.org">Matrix</a> bots.</em>
56
+ </div>
57
+
58
+ <div align="center">
59
+ <img alt="matrix.py" src="https://github.com/user-attachments/assets/d9140a9e-27fa-44e4-a5ca-87ee7bbf868f" />
60
+ </div>
61
+
62
+ <div align="center">
63
+
64
+ [<img src="https://img.shields.io/badge/Get%20Started-black?style=for-the-badge" />](https://matrixpy.codesociety.xyz/guides/introduction/)
65
+ [<img src="https://img.shields.io/badge/Reference-555555?style=for-the-badge" />](https://matrixpy.codesociety.xyz/reference/bot/)
66
+
67
+ </div>
68
+
69
+ <div align="center">
70
+
71
+ [![Join Discord](https://discordapp.com/api/guilds/823178343943897088/widget.png?style=shield)](https://discord.gg/code-society-823178343943897088)
72
+ [![Join Matrix](https://img.shields.io/matrix/codesociety%3Amatrix.org?logo=matrix&label=%20&labelColor=%23202020&color=%23202020)](https://matrix.to/#/%23codesociety:matrix.org)
73
+ [![Tests](https://github.com/Code-Society-Lab/matrixpy/actions/workflows/tests.yml/badge.svg)](https://github.com/Code-Society-Lab/matrixpy/actions/workflows/tests.yml)
74
+ [![PyPI](https://img.shields.io/pypi/v/matrix-python)](https://pypi.org/project/matrix-python/)
75
+ [![CodeQL Advanced](https://github.com/Code-Society-Lab/matrixpy/actions/workflows/codeql.yml/badge.svg)](https://github.com/Code-Society-Lab/matrixpy/actions/workflows/codeql.yml)
76
+ [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/Code-Society-Lab/matrixpy/badge)](https://securityscorecards.dev/viewer/?uri=github.com/Code-Society-Lab/matrixpy)
77
+
78
+ </div>
79
+
80
+ ---
81
+
82
+ Matrix.py is a lightweight and intuitive Python library to build bots on the [Matrix protocol](https://matrix.org). It
83
+ provides a clean, decorator-based API similar to popular event-driven frameworks, allowing developers to focus on
84
+ behavior rather than boilerplate.
85
+
86
+ - **Minimal setup** — install and have a working bot running in minutes
87
+ - **Event-driven** — async/await API reacting to any Matrix room event
88
+ - **Command system** — decorator-based commands with automatic argument parsing
89
+ - **Extensions** — split your bot into modules as it grows
90
+
91
+ ## Quickstart
92
+
93
+ **Requirements:** Python 3.10+
94
+
95
+ ```bash
96
+ pip install matrix-python
97
+ ```
98
+
99
+ Using a virtual environment is strongly recommended:
100
+
101
+ ```bash
102
+ python -m venv venv
103
+ source venv/bin/activate # Windows: venv\Scripts\activate
104
+ pip install matrix-python
105
+ ```
106
+
107
+ Create a `config.yml`:
108
+
109
+ ```yaml
110
+ USERNAME: "@yourbot:matrix.org"
111
+ PASSWORD: "your_password"
112
+ ```
113
+
114
+ ```python
115
+ from matrix import Bot, Context
116
+
117
+ bot = Bot()
118
+
119
+
120
+ @bot.command("ping")
121
+ async def ping(ctx: Context):
122
+ await ctx.reply("Pong!")
123
+
124
+
125
+ bot.start(config="config.yml")
126
+ ```
127
+
128
+ Send `!ping` in any room the bot is in, it will reply `Pong!`.
129
+
130
+ ## Where to go next
131
+
132
+ - [**Guides**](https://matrixpy.codesociety.xyz/guides/introduction/) — step-by-step tutorials covering commands,
133
+ events, checks, extensions, and more
134
+ - [**Reference**](https://matrixpy.codesociety.xyz/reference/bot/) — complete API documentation for every class and
135
+ function
136
+ - [**Examples**](https://matrixpy.codesociety.xyz/examples/) — ready-to-run example bots
137
+ demonstrating common patterns
138
+
139
+ ## Contributing
140
+
141
+ We welcome everyone to contribute! Whether it's fixing bugs, suggesting features, or improving the docs. Every bit
142
+ helps.
143
+
144
+ - [Submit an issue](https://github.com/Code-Society-Lab/matrixpy/issues)
145
+ - [Open a pull request](https://github.com/Code-Society-Lab/matrixpy/blob/main/CONTRIBUTING.md)
146
+ - Hop into our [Matrix](https://matrix.to/#/%23codesociety:matrix.org)
147
+ or [Discord](https://discord.gg/code-society-823178343943897088) and say hi!
148
+
149
+ Please read the [CONTRIBUTING.md](./CONTRIBUTING.md) and follow the [code of conduct](./CODE_OF_CONDUCT.md).
150
+
151
+ ## License
152
+
153
+ Released under the [MIT License](https://github.com/Code-Society-Lab/matrixpy/blob/main/LICENSE).