Title: feature: Document.headers and footers · Issue #104 · python-openxml/python-docx · GitHub
Open Graph Title: feature: Document.headers and footers · Issue #104 · python-openxml/python-docx
X Title: feature: Document.headers and footers · Issue #104 · python-openxml/python-docx
Description: It would be incredibly useful to be able to get the page headers through Document.headers, or similar. For now, I use a very ugly hack to get alll header texts: def get_headers(file): import xml.etree.ElementTree as ET document = Documen...
Open Graph Description: It would be incredibly useful to be able to get the page headers through Document.headers, or similar. For now, I use a very ugly hack to get alll header texts: def get_headers(file): import xml.et...
X Description: It would be incredibly useful to be able to get the page headers through Document.headers, or similar. For now, I use a very ugly hack to get alll header texts: def get_headers(file): import xml.et...
Opengraph URL: https://github.com/python-openxml/python-docx/issues/104
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feature: Document.headers and footers","articleBody":"It would be incredibly useful to be able to get the page headers through Document.headers, or similar.\n\nFor now, I use a very ugly hack to get alll header texts:\n\n```\ndef get_headers(file):\n import xml.etree.ElementTree as ET\n document = Document(file)\n namespace = dict(w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\")\n header_uri = \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header\"\n headers = []\n for rel, val in document._document_part._rels.iteritems():\n if val._reltype == header_uri:\n xml = val._target._blob\n root = ET.fromstring(xml)\n text_element = root.find(\".//w:t\", namespace)\n if text_element.text is not None:\n headers.append(text_element.text)\n return headers\n```\n","author":{"url":"https://github.com/rotsee","@type":"Person","name":"rotsee"},"datePublished":"2014-10-30T15:16:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":45},"url":"https://github.com/104/python-docx/issues/104"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:79c8a709-3653-c20b-b302-670f0d096e93 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D3EC:16B5B3:244B86B:314C7F1:69735CBF |
| html-safe-nonce | 4dc89456bfc6ac0783a353aad5f78dc00b01027a71c2a3f4d56c2176c754b6ee |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEM0VDOjE2QjVCMzoyNDRCODZCOjMxNEM3RjE6Njk3MzVDQkYiLCJ2aXNpdG9yX2lkIjoiMzk2MTg1NTIwNDg2Mzk5MDk3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0f74b0094b8dd4895afec6caf2aaaacd72b9ef16fef1b59189c328b47878afaf |
| hovercard-subject-tag | issue:47282520 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-openxml/python-docx/104/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7e9a8d301ca060a8815f12f7a589c50905c136e3fa1f86b02ba1a2ce33e58091/python-openxml/python-docx/issues/104 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7e9a8d301ca060a8815f12f7a589c50905c136e3fa1f86b02ba1a2ce33e58091/python-openxml/python-docx/issues/104 |
| og:image:alt | It would be incredibly useful to be able to get the page headers through Document.headers, or similar. For now, I use a very ugly hack to get alll header texts: def get_headers(file): import xml.et... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rotsee |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4cf879a11b0a28a85543899a36aaee9ec9ca2fb7bedad86c0da5731193c95f01 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-openxml/python-docx git https://github.com/python-openxml/python-docx.git |
| octolytics-dimension-user_id | 3403760 |
| octolytics-dimension-user_login | python-openxml |
| octolytics-dimension-repository_id | 13592924 |
| octolytics-dimension-repository_nwo | python-openxml/python-docx |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 13592924 |
| octolytics-dimension-repository_network_root_nwo | python-openxml/python-docx |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fe8be790582ef7a55477ce1918ac0ed16b106d31 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width