codapact-confluence 0.1.0__py3-none-any.whl
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.
- codapact_confluence/__init__.py +6 -0
- codapact_confluence/__main__.py +6 -0
- codapact_confluence/_docformat.py +161 -0
- codapact_confluence/_model.json +53465 -0
- codapact_confluence/cli.py +3347 -0
- codapact_confluence/client.py +3544 -0
- codapact_confluence/py.typed +0 -0
- codapact_confluence/skill/SKILL.md +39 -0
- codapact_confluence/types.py +4795 -0
- codapact_confluence-0.1.0.dist-info/METADATA +121 -0
- codapact_confluence-0.1.0.dist-info/RECORD +14 -0
- codapact_confluence-0.1.0.dist-info/WHEEL +4 -0
- codapact_confluence-0.1.0.dist-info/entry_points.txt +3 -0
- codapact_confluence-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codapact-confluence
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Typed Python client and `codapact-confluence` CLI for the Confluence Cloud REST API v2, with Markdown rich text, generated by Codapact
|
|
5
|
+
Keywords: confluence,atlassian,markdown,adf,cli,api-client,codapact
|
|
6
|
+
Author: Mike Hill
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
Classifier: Typing :: Typed
|
|
15
|
+
Requires-Dist: codapact[keyring,browser]>=0.19.1,<0.20
|
|
16
|
+
Requires-Dist: adflux>=0.4.0,<0.5
|
|
17
|
+
Requires-Python: >=3.13
|
|
18
|
+
Project-URL: Homepage, https://github.com/mikejhill/codapact-confluence
|
|
19
|
+
Project-URL: Repository, https://github.com/mikejhill/codapact-confluence
|
|
20
|
+
Project-URL: Issues, https://github.com/mikejhill/codapact-confluence/issues
|
|
21
|
+
Project-URL: Generator, https://github.com/mikejhill/codapact
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# codapact-confluence
|
|
25
|
+
|
|
26
|
+
[](https://github.com/mikejhill/codapact-confluence/actions/workflows/ci.yml) [](https://pypi.org/project/codapact-confluence/) [](https://pypi.org/project/codapact-confluence/) [](https://github.com/mikejhill/codapact-confluence/blob/HEAD/LICENSE) [](https://developer.atlassian.com/cloud/confluence/rest/v2/) [](https://github.com/mikejhill/codapact)
|
|
27
|
+
|
|
28
|
+
Typed Python client and `codapact-confluence` command-line tool for [Confluence Cloud](https://developer.atlassian.com/cloud/confluence/rest/v2/), generated by [Codapact](https://github.com/mikejhill/codapact).
|
|
29
|
+
|
|
30
|
+
## API source
|
|
31
|
+
|
|
32
|
+
Generated from this exact contract; regenerating it with the same Codapact version reproduces the code byte for byte.
|
|
33
|
+
|
|
34
|
+
| | |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| API | [Confluence Cloud](https://developer.atlassian.com/cloud/confluence/rest/v2/) |
|
|
37
|
+
| Contract | OpenAPI [`openapi.json`](https://github.com/mikejhill/codapact-confluence/blob/HEAD/openapi.json), pinned copy of <https://dac-static.atlassian.com/cloud/confluence/openapi-v2.v3.json> |
|
|
38
|
+
| Version | `2.0.0` |
|
|
39
|
+
| SHA-256 | `40535e2a2c01547d53d824d68299098c9073e5bf7ed98a71634706759becfa31` |
|
|
40
|
+
| Generator | [Codapact](https://github.com/mikejhill/codapact) `0.19.1` |
|
|
41
|
+
|
|
42
|
+
## Run
|
|
43
|
+
|
|
44
|
+
With [uv](https://docs.astral.sh/uv/); uvx installs the package and its runtime on first use:
|
|
45
|
+
|
|
46
|
+
```console
|
|
47
|
+
uvx codapact-confluence --help
|
|
48
|
+
uvx --refresh-package codapact-confluence codapact-confluence --version # update to the latest
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Requires Python 3.13 or newer.
|
|
52
|
+
|
|
53
|
+
## Credentials
|
|
54
|
+
|
|
55
|
+
Save once in the OS keyring with `uvx codapact-confluence auth login`, or set per shell:
|
|
56
|
+
|
|
57
|
+
- `basic`: `CONFLUENCE_BASIC_USERNAME`, `CONFLUENCE_BASIC_PASSWORD`. Use your Atlassian account email as the username and an API token as the password (create one at https://id.atlassian.com/manage-profile/security/api-tokens).
|
|
58
|
+
- `session`: `CONFLUENCE_SESSION`. For sites where API tokens are disabled: signs in through a browser window and sends the session cookies.
|
|
59
|
+
|
|
60
|
+
`<VAR>_COMMAND` runs a command that prints the secret (e.g. a password manager). `uvx codapact-confluence doctor` checks settings, credentials, connectivity, and the login.
|
|
61
|
+
|
|
62
|
+
## Use
|
|
63
|
+
|
|
64
|
+
```console
|
|
65
|
+
uvx codapact-confluence space list-spaces --keys DOCS
|
|
66
|
+
uvx codapact-confluence page get --id 123456 --query body.markdown.value
|
|
67
|
+
uvx codapact-confluence page create --space-id 98765 --title 'Release notes' --markdown @notes.md
|
|
68
|
+
uvx codapact-confluence page update 123456 --body '{"id":"123456","status":"current","title":"Release notes","version":{"number":2}}' --markdown @notes.md
|
|
69
|
+
uvx codapact-confluence describe --brief # every command, for scripts and agents
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
As a library:
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from codapact_confluence import Client
|
|
76
|
+
|
|
77
|
+
client = Client()
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Agent skill
|
|
81
|
+
|
|
82
|
+
The package ships an agent skill that points agents at the CLI. Install it into a skills folder:
|
|
83
|
+
|
|
84
|
+
```console
|
|
85
|
+
uvx codapact-confluence skill install --dir ~/.agents/skills # or any skills folder
|
|
86
|
+
uvx codapact-confluence skill show # print it
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Rerun after an update to refresh it; a copy with local edits needs `--force`.
|
|
90
|
+
|
|
91
|
+
## Markdown
|
|
92
|
+
|
|
93
|
+
Page, blog post and comment bodies are Markdown both ways. `--markdown TEXT|@file|@-`
|
|
94
|
+
sets the body to send; commands with `--body-format` read `atlas_doc_format` and return it
|
|
95
|
+
as `body.markdown.value`. `--doc-format adf` (or `CONFLUENCE_DOC_FORMAT=adf`) keeps ADF.
|
|
96
|
+
Macros are directives such as `::toc{maxLevel=2}`, `:::info`, `:jira[PROJ-1]`; run
|
|
97
|
+
`uvx adflux macros NAME` for a macro's parameters and `uvx adflux syntax` for the dialect.
|
|
98
|
+
|
|
99
|
+
## Sign-in
|
|
100
|
+
|
|
101
|
+
Set `--base-url` (or `CONFLUENCE_BASE_URL`) to your site, for example
|
|
102
|
+
`https://your-site.atlassian.net`. An API token is preferred: `codapact-confluence auth login
|
|
103
|
+
--scheme basic` with your Atlassian email and a token from
|
|
104
|
+
https://id.atlassian.com/manage-profile/security/api-tokens. Where API tokens are
|
|
105
|
+
disabled, `codapact-confluence auth login --scheme session` opens a browser window: the
|
|
106
|
+
CLI fills in your email and you type your password and any second factor yourself. The
|
|
107
|
+
session cookies go to your keyring and are renewed without a window until your identity
|
|
108
|
+
provider asks for you again. Browser sign-in needs Chrome,
|
|
109
|
+
Edge or `playwright install chromium`.
|
|
110
|
+
|
|
111
|
+
## Development
|
|
112
|
+
|
|
113
|
+
The code in `gen/python/` is generated by [Codapact](https://github.com/mikejhill/codapact). Do not edit it; regenerate instead:
|
|
114
|
+
|
|
115
|
+
```console
|
|
116
|
+
uvx codapact==0.19.1 sync --check # has the provider published a new contract?
|
|
117
|
+
uvx codapact==0.19.1 sync # pull it into the pinned copy
|
|
118
|
+
uvx codapact==0.19.1 generate # run where codapact.yaml is
|
|
119
|
+
uv run --directory gen/python pytest # offline: help, dry runs, scenarios
|
|
120
|
+
CONFLUENCE_E2E_LIVE=1 uv run --directory gen/python pytest -k live # read-only calls to the real API
|
|
121
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
codapact_confluence/__init__.py,sha256=BEVvyrSQvQN0V5apry3ktsrcE734QtbeJh7homP1K40,146
|
|
2
|
+
codapact_confluence/__main__.py,sha256=xm9y4hRDqW8VHjWuvBwHEQkKrz7_ElQLtOP2fC8GvBw,128
|
|
3
|
+
codapact_confluence/_docformat.py,sha256=tENyyFJX5CGWz58V15J4jWkId8iVahsyeDcRYh8b1GU,6146
|
|
4
|
+
codapact_confluence/_model.json,sha256=wu2ZX-H2P7ZgMim5qY5bh8P2gAhqCdaKRwygeCrHF2Y,1518620
|
|
5
|
+
codapact_confluence/cli.py,sha256=OWfBhjxGIRWFykiIyO5mysTYBkQ_0C6tymZotwSo9Rg,570092
|
|
6
|
+
codapact_confluence/client.py,sha256=YivIdwMKWdcmutC45-1ZEl4ZFqauSoDeI7CWDgL5n0I,218183
|
|
7
|
+
codapact_confluence/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
codapact_confluence/skill/SKILL.md,sha256=vDm7SkakchmXMlMXCBBNaqDsL8fEHumTuQF2sfYUxMk,2099
|
|
9
|
+
codapact_confluence/types.py,sha256=b_YohCUE1CYSimJJT4eAjog5MjRvOClPutMWm0MuY1g,153402
|
|
10
|
+
codapact_confluence-0.1.0.dist-info/licenses/LICENSE,sha256=MrM1ktUwGhqY5Eq9uprukyzAi7-UApuuTroNfjlRxPA,1066
|
|
11
|
+
codapact_confluence-0.1.0.dist-info/WHEEL,sha256=kiPuyMTIXtn3KwIlb6zIkrxfbMkdQGyzN-kjAsvva48,81
|
|
12
|
+
codapact_confluence-0.1.0.dist-info/entry_points.txt,sha256=paU6WTiGrCCjRt6h4Dlb6MhM6bJRMCfM4c11ppA4cPc,70
|
|
13
|
+
codapact_confluence-0.1.0.dist-info/METADATA,sha256=mj4BuMr6zoUvHLHHrprNhVY_o1RYqZMMH7xSRgjjp8s,6393
|
|
14
|
+
codapact_confluence-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mike Hill
|
|
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 all
|
|
13
|
+
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 THE
|
|
21
|
+
SOFTWARE.
|