├── doc └── html │ ├── crarr.png │ ├── index.html │ ├── frames.html │ ├── toc-PythonConfluenceAPI-module.html │ ├── redirect.html │ ├── toc-PythonConfluenceAPI.cfapi-module.html │ ├── toc-PythonConfluenceAPI.api-module.html │ ├── toc.html │ ├── toc-everything.html │ ├── class-tree.html │ ├── module-tree.html │ ├── PythonConfluenceAPI-pysrc.html │ ├── PythonConfluenceAPI-module.html │ ├── api-objects.txt │ ├── PythonConfluenceAPI.cfapi-module.html │ ├── PythonConfluenceAPI.api-module.html │ ├── epydoc.js │ ├── help.html │ ├── epydoc.css │ ├── PythonConfluenceAPI.cfapi.ConfluenceFuturesAPI-class.html │ └── identifier-index.html ├── pythonconfluenceapilight.png ├── makedocs.sh ├── requirements.txt ├── PythonConfluenceAPI ├── __init__.py └── cfapi.py ├── Examples ├── create_space.py └── get_latest_content.py ├── .gitignore ├── setup.py ├── README.md ├── LICENSE └── ez_setup.py /doc/html/crarr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpcope1/PythonConfluenceAPI/HEAD/doc/html/crarr.png -------------------------------------------------------------------------------- /pythonconfluenceapilight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rpcope1/PythonConfluenceAPI/HEAD/pythonconfluenceapilight.png -------------------------------------------------------------------------------- /makedocs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | epydoc -o doc/html --html --show-imports -n PythonConfluenceAPI -u https://github.com/pushrodtechnology/PythonConfluenceAPI --no-sourcecode PythonConfluenceAPI 3 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # The requests 'security' extra prevents InsecurePlatformWarning 2 | # on e.g. Ubuntu 14.04 LTS 3 | 4 | anyjson>=0.3.3,<1 5 | future>=0.15.2 6 | futures>=3.0.3,<4 7 | requests[security]>=2.3.0,<3 8 | requests-futures>=0.9.5,<1 9 | future>=0.15.2,<1 10 | -------------------------------------------------------------------------------- /PythonConfluenceAPI/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | from __future__ import unicode_literals 5 | 6 | from future import standard_library 7 | standard_library.install_aliases() 8 | 9 | __author__ = 'Robert Cope, Pushrod Technology' 10 | 11 | from .api import ConfluenceAPI, all_of 12 | from .cfapi import ConfluenceFuturesAPI 13 | -------------------------------------------------------------------------------- /doc/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 |
6 |Lorem Ipsum
', 24 | 'representation': 'storage' 25 | } 26 | } 27 | }) 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | 26 | # PyInstaller 27 | # Usually these files are written by a python script from a template 28 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 29 | *.manifest 30 | *.spec 31 | 32 | # Installer logs 33 | pip-log.txt 34 | pip-delete-this-directory.txt 35 | 36 | # Unit test / coverage reports 37 | htmlcov/ 38 | .tox/ 39 | .coverage 40 | .coverage.* 41 | .cache 42 | nosetests.xml 43 | coverage.xml 44 | *,cover 45 | 46 | # Translations 47 | *.mo 48 | *.pot 49 | 50 | # Django stuff: 51 | *.log 52 | 53 | # Sphinx documentation 54 | docs/_build/ 55 | 56 | # PyBuilder 57 | target/ 58 | -------------------------------------------------------------------------------- /Examples/get_latest_content.py: -------------------------------------------------------------------------------- 1 | __author__ = 'Robert Cope' 2 | 3 | from PythonConfluenceAPI import ConfluenceAPI 4 | import sys 5 | 6 | 7 | def compatible_print(msg): 8 | sys.stdout.write("{}\n".format(msg)) 9 | sys.stdout.flush() 10 | 11 | USERNAME = '' 12 | PASSWORD = '' 13 | WIKI_SITE = 'https://my-awesome-organization.atlassian.net/wiki' 14 | 15 | api = ConfluenceAPI(USERNAME, PASSWORD, WIKI_SITE) 16 | new_pages = api.get_content('') 17 | compatible_print("Newest pages:") 18 | for page in new_pages: 19 | compatible_print("{} - {} ({})".format(page.get("space", {}).get("key", "???"), 20 | page.get("title", "(No title)"), 21 | page.get("id", "(No ID!?)"))) 22 | content = page.get("body", {}).get("view", {}).get("value", "No content.") 23 | content = content[:37] + "..." if len(content) > 40 else content 24 | compatible_print("Preview: {}".format(content)) -------------------------------------------------------------------------------- /doc/html/toc-PythonConfluenceAPI-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 |When javascript is enabled, this page will redirect URLs of 22 | the form redirect.html#dotted.name to the 23 | documentation for the object with the given fully-qualified 24 | dotted name.
25 | 26 | 27 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /doc/html/toc-PythonConfluenceAPI.cfapi-module.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 || Home | 20 | 21 | 22 |Trees | 24 | 25 | 26 |Indices | 28 | 29 | 30 |Help | 32 | 33 | 34 |
35 |
|
39 |
|---|
| 44 | |
45 | |
55 |
| Home | 78 | 79 | 80 |Trees | 82 | 83 | 84 |Indices | 86 | 87 | 88 |Help | 90 | 91 | 92 |
93 |
|
97 |
|---|
| 102 | Generated by Epydoc 3.0.1 on Wed Oct 21 09:41:45 2015 103 | | 104 |105 | http://epydoc.sourceforge.net 107 | | 108 |
| Home | 20 | 21 | 22 |Trees | 24 | 25 | 26 |Indices | 28 | 29 | 30 |Help | 32 | 33 | 34 |
35 |
|
39 |
|---|
| 44 | |
45 | |
55 |
| Home | 77 | 78 | 79 |Trees | 81 | 82 | 83 |Indices | 85 | 86 | 87 |Help | 89 | 90 | 91 |
92 |
|
96 |
|---|
| 101 | Generated by Epydoc 3.0.1 on Wed Oct 21 09:41:45 2015 102 | | 103 |104 | http://epydoc.sourceforge.net 106 | | 107 |
| Home | 20 | 21 | 22 |Trees | 24 | 25 | 26 |Indices | 28 | 29 | 30 |Help | 32 | 33 | 34 |
35 |
|
39 |
|---|
| 44 | 47 | | 48 |
49 | |
59 |
63 | 1 __author__ = 'Robert Cope', 'Pushrod Technology' 64 | 2 65 | 3 from api import ConfluenceAPI 66 | 4 71 |72 |
| Home | 80 | 81 | 82 |Trees | 84 | 85 | 86 |Indices | 88 | 89 | 90 |Help | 92 | 93 | 94 |
95 |
|
99 |
|---|
| 104 | Generated by Epydoc 3.0.1 on Sat Jul 11 23:13:04 2015 105 | | 106 |107 | http://epydoc.sourceforge.net 109 | | 110 |
| Home | 20 | 21 | 22 |Trees | 24 | 25 | 26 |Indices | 28 | 29 | 30 |Help | 32 | 33 | 34 |
35 |
|
39 |
|---|
| 44 | 47 | | 48 |
49 | |
59 |
76 |
|
86 | |||
88 |
| |||
Imports: 96 | ConfluenceAPI, 97 | all_of, 98 | ConfluenceFuturesAPI 99 |
| Home | 107 | 108 | 109 |Trees | 111 | 112 | 113 |Indices | 115 | 116 | 117 |Help | 119 | 120 | 121 |
122 |
|
126 |
|---|
| 131 | Generated by Epydoc 3.0.1 on Wed Oct 21 09:41:45 2015 132 | | 133 |134 | http://epydoc.sourceforge.net 136 | | 137 |
| Home | 20 | 21 | 22 |Trees | 24 | 25 | 26 |Indices | 28 | 29 | 30 |Help | 32 | 33 | 34 |
35 |
|
39 |
|---|
| 44 | 48 | | 49 |
50 | |
60 |
Author: 66 | Robert Cope 67 |
68 |
74 |
|
84 | |||
| 87 | 88 | | 89 | ConfluenceFuturesAPI 90 | | 91 |||
99 |
|
109 | |||
| 112 | 113 | |
114 |
|
128 | ||
Imports: 131 | HTTPBasicAuth, 132 | ConfluenceAPI, 133 | api_logger, 134 | json, 135 | FuturesSession, 136 | urljoin 137 |
144 |
|
154 | |||
161 |
Maintains the existing api for Session.request. Used by all of the 173 | higher level methods, e.g. Session.get. The background_callback param 174 | allows you to do some processing on the response in the background, e.g. 175 | call resp.json() so that json parsing happens in the background 176 | thread. 177 |
|
| Home | 189 | 190 | 191 |Trees | 193 | 194 | 195 |Indices | 197 | 198 | 199 |Help | 201 | 202 | 203 |
204 |
|
208 |
|---|
| 213 | Generated by Epydoc 3.0.1 on Wed Oct 21 09:41:45 2015 214 | | 215 |216 | http://epydoc.sourceforge.net 218 | | 219 |
| Home | 20 | 21 | 22 |Trees | 24 | 25 | 26 |Indices | 28 | 29 | 30 |Help | 32 | 33 | 34 |
35 |
|
39 |
|---|
| 44 | 48 | | 49 |
50 | |
60 |
Author: 66 | Robert Cope 67 |
68 |
74 |
|
84 | |||
| 87 | 88 | | 89 | ConfluenceAPI 90 | | 91 |||
99 |
|
109 | |||
| 112 | 113 | |
114 |
|
129 | ||
Imports: 164 | sys, 165 | requests, 166 | HTTPBasicAuth, 167 | urljoin, 168 | logging, 169 | json 170 |
177 |
|
187 | |||
194 |
Generator that iterates over all results of an API call that requires 206 | limit/start pagination. 207 |If the `limit` keyword argument is set, it is used to stop the 208 | generator after the given number of result items. 209 |210 | >>> for i, v in enumerate(all_of(api.get_content)): 211 | >>> v = bunchify(v) 212 | >>> print(' '.join((str(i), v.type, v.id, v.status, v.title)))213 | :param api_call: Confluence API call (method). :param args: Positional 214 | arguments of the call. :param kwargs: Keyword arguments of the call. 215 |
|
| Home | 227 | 228 | 229 |Trees | 231 | 232 | 233 |Indices | 235 | 236 | 237 |Help | 239 | 240 | 241 |
242 |
|
246 |
|---|
| 251 | Generated by Epydoc 3.0.1 on Wed Oct 21 09:41:45 2015 252 | | 253 |254 | http://epydoc.sourceforge.net 256 | | 257 |
| Home | 20 | 21 | 22 |Trees | 24 | 25 | 26 |Indices | 28 | 29 | 30 |Help | 32 | 33 | 34 |
35 |
|
39 |
|---|
| 44 | |
45 | |
55 |
This document contains the API (Application Programming Interface) 61 | documentation for PythonConfluenceAPI. Documentation for the Python 62 | objects defined by the project is divided into separate pages for each 63 | package, module, and class. The API documentation also includes two 64 | pages containing information about the project as a whole: a trees 65 | page, and an index page.
66 | 67 |Each Package Documentation page contains:
70 |Each Module Documentation page contains:
84 |Each Class Documentation page contains:
96 |The Trees page contains the module and class hierarchies:
115 |The Index page contains indices of terms and 126 | identifiers:
127 |The table of contents occupies the two frames on the left side of 140 | the window. The upper-left frame displays the project 141 | contents, and the lower-left frame displays the module 142 | contents:
143 | 144 ||
147 | Project Contents ... |
148 |
149 | API Documentation Frame 150 | |
151 |
|
154 | Module Contents ... 155 | |
156 |
The project contents frame contains a list of all packages 160 | and modules that are defined by the project. Clicking on an entry 161 | will display its contents in the module contents frame. Clicking on a 162 | special entry, labeled "Everything," will display the contents of 163 | the entire project.
164 | 165 |The module contents frame contains a list of every 166 | submodule, class, type, exception, function, and variable defined by a 167 | module or package. Clicking on an entry will display its 168 | documentation in the API documentation frame. Clicking on the name of 169 | the module, at the top of the frame, will display the documentation 170 | for the module itself.
171 | 172 |The "frames" and "no frames" buttons below the top 173 | navigation bar can be used to control whether the table of contents is 174 | displayed or not.
175 | 176 |A navigation bar is located at the top and bottom of every page. 179 | It indicates what type of page you are currently viewing, and allows 180 | you to go to related pages. The following table describes the labels 181 | on the navigation bar. Note that not some labels (such as 182 | [Parent]) are not displayed on all pages.
183 | 184 || Label | 187 |Highlighted when... | 188 |Links to... | 189 |
|---|---|---|
| [Parent] | 191 |(never highlighted) | 192 |the parent of the current package |
| [Package] | 194 |viewing a package | 195 |the package containing the current object 196 | |
| [Module] | 198 |viewing a module | 199 |the module containing the current object 200 | |
| [Class] | 202 |viewing a class | 203 |the class containing the current object |
| [Trees] | 205 |viewing the trees page | 206 |the trees page |
| [Index] | 208 |viewing the index page | 209 |the index page |
| [Help] | 211 |viewing the help page | 212 |the help page |
The "show private" and "hide private" buttons below
216 | the top navigation bar can be used to control whether documentation
217 | for private objects is displayed. Private objects are usually defined
218 | as objects whose (short) names begin with a single underscore, but do
219 | not end with an underscore. For example, "_x",
220 | "__pprint", and "epydoc.epytext._tokenize"
221 | are private objects; but "re.sub",
222 | "__init__", and "type_" are not. However,
223 | if a module defines the "__all__" variable, then its
224 | contents are used to decide which objects are private.
A timestamp below the bottom navigation bar indicates when each 227 | page was last updated.
228 | 229 || Home | 235 | 236 | 237 |Trees | 239 | 240 | 241 |Indices | 243 | 244 | 245 |Help | 247 | 248 | 249 |
250 |
|
254 |
|---|
| 259 | Generated by Epydoc 3.0.1 on Wed Oct 21 09:41:45 2015 260 | | 261 |262 | http://epydoc.sourceforge.net 264 | | 265 |
| Home | 20 | 21 | 22 |Trees | 24 | 25 | 26 |Indices | 28 | 29 | 30 |Help | 32 | 33 | 34 |
35 |
|
39 |
|---|
| 44 | 49 | | 50 |
51 | |
61 |
66 | object --+ 67 | | 68 | api.ConfluenceAPI --+ 69 | | 70 | ConfluenceFuturesAPI 71 |72 | 73 |
80 |
|
90 | |||
| 93 | 94 | |
95 |
|
113 | ||
| 116 | 117 | |
118 |
|
130 | ||
| 133 | 134 | |
135 |
|
154 | ||
|
157 | Inherited from Inherited from Inherited from |
220 | |||
228 |
|
238 | |||
|
241 | Inherited from |
248 | |||
256 |
|
266 | |||
|
269 | Inherited from |
273 | |||
281 |
|
291 | |||
298 |
315 | 316 | Initialize the async concurrent.futures API object. 317 | :param username: Your Confluence username. 318 | :param password: Your Confluence password. 319 | :param uri_base: The base url for your Confluence wiki (e.g. myorg.atlassian.com/wiki) 320 | :param user_agent: (Optional): The user-agent you wish to send on requests to the API. 321 | DEFAULT: PythonConfluenceAPI. 322 | :param executor: (Optional): The concurrent.futures executor to power the API calls. Default: None, create a 323 | new ThreadPoolExecutor. 324 | :param max_workers: (Optional): If the executor is not specified and the default ThreadPoolExecutor is spawned, 325 | this specifies the number of worker threads to create. 326 | 327 |328 |
|
340 |
Start a new requests HTTP session, clearing cookies and session data. 350 | :return: None 351 |
|
363 |
380 | 381 | Base method for handling HTTP requests via the current requests session. 382 | :param request_type: The request type as a string (e.g. "POST", "GET", "PUT", etc.) 383 | :param sub_uri: The REST end point (sub-uri) to communicate with. 384 | :param params: (Optional) HTTP Request parameters. Default: none 385 | :param callback: (Optional) A callback function to be excuted on the resulting requests response. 386 | This synchronous implementation will return the results of the callback. 387 | Default: None. This method returns either the decoded JSON or the raw request content. 388 | :param raise_for_status: (Optional) When set True, we raise requests.HTTPError on 4xx or 5xx status. When 389 | set False, non-2xx/3xx status code is ignored. Default: True 390 | :param raw: (Optional) If no callback is set, return the raw content from the request if this is set True. 391 | If False, the method attempts to parse the request as JSON data and return the resutls. 392 | Default: False 393 | :param kwargs: Additional parameters to pass to the session request call. 394 | :return: The concurrent.futures object that holds the future for the API method call. 395 | 396 |397 |
|
| Home | 412 | 413 | 414 |Trees | 416 | 417 | 418 |Indices | 420 | 421 | 422 |Help | 424 | 425 | 426 |
427 |
|
431 |
|---|
| 436 | Generated by Epydoc 3.0.1 on Wed Oct 21 09:41:45 2015 437 | | 438 |439 | http://epydoc.sourceforge.net 441 | | 442 |
| Home | 20 | 21 | 22 |Trees | 24 | 25 | 26 |Indices | 28 | 29 | 30 |Help | 32 | 33 | 34 |
35 |
|
39 |
|---|
| 44 | |
45 | |
55 |
59 | Identifier Index60 | | 61 | [ 62 | A 63 | B 64 | C 65 | D 66 | E 67 | F 68 | G 69 | H 70 | I 71 | J 72 | K 73 | L 74 | M 75 | N 76 | O 77 | P 78 | Q 79 | R 80 | S 81 | T 82 | U 83 | V 84 | W 85 | X 86 | Y 87 | Z 88 | _ 89 | ] 90 | |
A |
93 |
94 |
| |||||||||||||||||||||||||||||||||||||||||||||
C |
112 |
113 |
| |||||||||||||||||||||||||||||||||||||||||||||
D |
171 |
172 |
| |||||||||||||||||||||||||||||||||||||||||||||
G |
200 |
201 |
| |||||||||||||||||||||||||||||||||||||||||||||
N |
324 |
325 |
| |||||||||||||||||||||||||||||||||||||||||||||
P |
337 |
338 |
| |||||||||||||||||||||||||||||||||||||||||||||
R |
348 |
349 |
| |||||||||||||||||||||||||||||||||||||||||||||
S |
360 |
361 |
| |||||||||||||||||||||||||||||||||||||||||||||
U |
373 |
374 |
| |||||||||||||||||||||||||||||||||||||||||||||
_ |
409 |
410 |
|
| Home | 460 | 461 | 462 |Trees | 464 | 465 | 466 |Indices | 468 | 469 | 470 |Help | 472 | 473 | 474 |
475 |
|
479 |
|---|
| 484 | Generated by Epydoc 3.0.1 on Wed Oct 21 09:41:45 2015 485 | | 486 |487 | http://epydoc.sourceforge.net 489 | | 490 |