Not just zotero tools.
Project description
Noterools: Not just Zotero Tools
中文文档 | English
At the beginning, I just wanted to write a Python implementation based on gwyn-hopkins's code to add clickable hyperlinks to Zotero citations. However, as my paper underwent more revisions, I found myself needing to make increasingly complex formatting adjustments. Consequently, the functionality of the code expanded. After extensive refactoring, noterools was born.
What is this?
Currently, noterools can help you do the following things:
- Create bookmarks for each reference in the Zotero bibliography.
- Set hyperlinks for Zotero citations that navigate to the corresponding references and adjust whether the hyperlinks are underlined.
- Customize the font color of Zotero citations.
- Italicize journal names and publishers in the Zotero bibliography that aren't correctly formatted as italics.
- Adjust the font color and weight for cross-references within the main text.
- Replace the hyphen (-, Unicode 002D) used for page ranges in the bibliography with an en dash (–, Unicode 2013).
- (Experimental Feature) Modify the capitalization style of English reference titles. Supports three styles: ALL CAPS, Title Case (Capitalize Each Word), and Sentence case (Capitalize first word only).
Screenshots
Important Note
- This script can only work in Windows.
How to use?
- Install noterools via pip.
pip install noterools
- Create a Python script and run it. Here is a simple example.
from noterools import Word, add_cross_ref_style_hook, add_citation_cross_ref_hook
if __name__ == '__main__':
word_file_path = r"E:\Documents\Word\test.docx"
new_file_path = r"E:\Documents\Word\test_new.docx"
with Word(word_file_path, save_path=new_file_path) as word:
# Add hyperlinks for numbered citation formats.
add_citation_cross_ref_hook(word, is_numbered=True)
# Add hyperlinks to (Author, Year) citation format, set the citation font color to blue.
# By default, container titles or publishers in the bibliography that are not correctly italicized will be set to italics.
# By default, only the year portion is hyperlinked. Set full_citation_hyperlink=True to make the entire citation (author+year) hyperlinked. (This is still an experimental feature, and it may produce unexpected results.)
# add_citation_cross_ref_hook(word, is_numbered=False, full_citation_hyperlink=True)
# By setting the value of color, you can change the color of the entire citation (excluding the parentheses).
# 0: Black
# 16711680: Blues
# For more colors, please see: https://learn.microsoft.com/en-us/office/vba/api/word.wdcolor
# add_citation_cross_ref_hook(word, is_numbered=False, color=0)
# Or input RGB value instead
# add_cross_ref_style_hook(word, is_numbered=False, color="0, 0, 255")
# Or change to "Automatic" in Microsoft Word
# add_cross_ref_style_hook(word, is_numbered=False, color="word_auto")
# set_container_title_italic is used to control whether to correct names in the bibliography that are not properly italicized.
# You can disable this feature by setting it to False.
# add_citation_cross_ref_hook(word, is_numbered=False, set_container_title_italic=False)
# Set the font color and bold style for cross-references starting with 'Figure' in the main contents.
add_cross_ref_style_hook(word, color=16711680, bold=True, key_word=["Figure"])
# Replace the hyphen with en dash.
# To use this feature, you need to call `zotero_init_client` to initialize the client to communicate with Zotero.
# Please refer to the pyzotero documentation to find your Zotero ID and apply for an API key.
# https://pyzotero.readthedocs.io/en/latest/#getting-started-short-version
# zotero_init_client(zotero_id="Your Zotero ID", zotero_api_key="Your Zotero API key")
# add_update_dash_symbol_hook(word, "Your ID", "Your key")
# Change English articles' title format to All CAPS.
# add_format_title_hook(word, upper_all_words=True)
# Change English articles' title format to Title Case (minor words will be changed too).
# add_format_title_hook(word, upper_first_char=True)
# Change English articles' title format to Sentence Case.
# add_format_title_hook(word, lower_all_words=True)
# You can give a list contains proper noun when change format to Sentence Case.
# word_list = ["UNet", "US", "China", "WRF"]
# add_format_title_hook(word, lower_all_words=True, word_list=word_list)
# Add hyperlinks to URLs in bibliography
# add_url_hyperlink_hook(word)
# And customize URL appearance (parameters are optional)
# add_url_hyperlink_hook(word, color=16711680, no_under_line=False)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file noterools-1.1.3.tar.gz.
File metadata
- Download URL: noterools-1.1.3.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
099f67c28916c026b04461d6cd896279c162eac0e12ed2f7e9de1526110290ed
|
|
| MD5 |
3f80924d89a55efbba4faaccc7f9600c
|
|
| BLAKE2b-256 |
d176de56fc5fd943351704784ae3a3fe9fb8febe3a90e8df71034315b4bd417a
|
Provenance
The following attestation bundles were made for noterools-1.1.3.tar.gz:
Publisher:
python-package.yaml on Syize/noterools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
noterools-1.1.3.tar.gz -
Subject digest:
099f67c28916c026b04461d6cd896279c162eac0e12ed2f7e9de1526110290ed - Sigstore transparency entry: 214768846
- Sigstore integration time:
-
Permalink:
Syize/noterools@9ab336aa4fc8322978f8e4aa9b90f1792d97c9a6 -
Branch / Tag:
refs/tags/v1.1.3 - Owner: https://github.com/Syize
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-package.yaml@9ab336aa4fc8322978f8e4aa9b90f1792d97c9a6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file noterools-1.1.3-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: noterools-1.1.3-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 23.3 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fd87bceec28de43fdd533d5d5d764121c6adb3148961cdeb48217db33d7d9c0
|
|
| MD5 |
2ce5fc269123e7252051ee72671c770e
|
|
| BLAKE2b-256 |
16bcc9dca2fd61a95dd6ef8150ed6866a643046a74b111a3c8a4897c12526cd8
|
Provenance
The following attestation bundles were made for noterools-1.1.3-cp313-cp313-win_amd64.whl:
Publisher:
python-wheel-package.yaml on Syize/noterools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
noterools-1.1.3-cp313-cp313-win_amd64.whl -
Subject digest:
3fd87bceec28de43fdd533d5d5d764121c6adb3148961cdeb48217db33d7d9c0 - Sigstore transparency entry: 214771346
- Sigstore integration time:
-
Permalink:
Syize/noterools@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Syize
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheel-package.yaml@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file noterools-1.1.3-cp313-cp313-win32.whl.
File metadata
- Download URL: noterools-1.1.3-cp313-cp313-win32.whl
- Upload date:
- Size: 23.3 kB
- Tags: CPython 3.13, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6db853940af987936175b388edf1bd8944865bdd66120569e95793363a3a64b3
|
|
| MD5 |
87477caea5f86775191f42ad48fd25d6
|
|
| BLAKE2b-256 |
4c1d6dd4a2dd72789fb7be23ebbe2a8fdefb8b5c7161435607a6ee332f921ef7
|
Provenance
The following attestation bundles were made for noterools-1.1.3-cp313-cp313-win32.whl:
Publisher:
python-wheel-package.yaml on Syize/noterools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
noterools-1.1.3-cp313-cp313-win32.whl -
Subject digest:
6db853940af987936175b388edf1bd8944865bdd66120569e95793363a3a64b3 - Sigstore transparency entry: 214771344
- Sigstore integration time:
-
Permalink:
Syize/noterools@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Syize
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheel-package.yaml@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file noterools-1.1.3-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: noterools-1.1.3-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 23.3 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5da304cbf8560a129dec48d7a301612ad9f187311c992b8855a6aea0d6affe9
|
|
| MD5 |
29431821dc44d2dc3862332b510d67e4
|
|
| BLAKE2b-256 |
2732174d2ace976cac7f7f6f4f7d10b908116f84671269b0fc2995331b440b93
|
Provenance
The following attestation bundles were made for noterools-1.1.3-cp312-cp312-win_amd64.whl:
Publisher:
python-wheel-package.yaml on Syize/noterools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
noterools-1.1.3-cp312-cp312-win_amd64.whl -
Subject digest:
a5da304cbf8560a129dec48d7a301612ad9f187311c992b8855a6aea0d6affe9 - Sigstore transparency entry: 214771356
- Sigstore integration time:
-
Permalink:
Syize/noterools@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Syize
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheel-package.yaml@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file noterools-1.1.3-cp312-cp312-win32.whl.
File metadata
- Download URL: noterools-1.1.3-cp312-cp312-win32.whl
- Upload date:
- Size: 23.3 kB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c10fec6091af182f6bf1711208180494274efef3a78d0e86aaa2ebef9b9227ee
|
|
| MD5 |
8f6b1e84ec3d7d6b42ad18fce7c7487b
|
|
| BLAKE2b-256 |
225e1cce4ee777593e15f4801d925d7c2a4496bad02e79b5ecbdf4fe7fb6462d
|
Provenance
The following attestation bundles were made for noterools-1.1.3-cp312-cp312-win32.whl:
Publisher:
python-wheel-package.yaml on Syize/noterools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
noterools-1.1.3-cp312-cp312-win32.whl -
Subject digest:
c10fec6091af182f6bf1711208180494274efef3a78d0e86aaa2ebef9b9227ee - Sigstore transparency entry: 214771358
- Sigstore integration time:
-
Permalink:
Syize/noterools@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Syize
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheel-package.yaml@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file noterools-1.1.3-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: noterools-1.1.3-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 23.3 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4975b21313b07c58206089e7eb25d01006c106d2b8b4dc376558ace42f35a4d8
|
|
| MD5 |
3d7b7198c89df66b325c0a7cbc25d3f8
|
|
| BLAKE2b-256 |
a5bacf3664abbc5d3f5183b92cd642be15f4b8926e832726288884f59e9cb162
|
Provenance
The following attestation bundles were made for noterools-1.1.3-cp311-cp311-win_amd64.whl:
Publisher:
python-wheel-package.yaml on Syize/noterools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
noterools-1.1.3-cp311-cp311-win_amd64.whl -
Subject digest:
4975b21313b07c58206089e7eb25d01006c106d2b8b4dc376558ace42f35a4d8 - Sigstore transparency entry: 214771350
- Sigstore integration time:
-
Permalink:
Syize/noterools@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Syize
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheel-package.yaml@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file noterools-1.1.3-cp311-cp311-win32.whl.
File metadata
- Download URL: noterools-1.1.3-cp311-cp311-win32.whl
- Upload date:
- Size: 23.3 kB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acd921ea6f05c6f7a975cf2c75e8cfef073bdc70c03a089ee26e0a97ec5173c3
|
|
| MD5 |
81343a9892f6d586ce9711bec595c9e9
|
|
| BLAKE2b-256 |
485dd31bd520c37d7409dbc1ee8dafe2cc582f7a89978f45addafa214ae1c82f
|
Provenance
The following attestation bundles were made for noterools-1.1.3-cp311-cp311-win32.whl:
Publisher:
python-wheel-package.yaml on Syize/noterools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
noterools-1.1.3-cp311-cp311-win32.whl -
Subject digest:
acd921ea6f05c6f7a975cf2c75e8cfef073bdc70c03a089ee26e0a97ec5173c3 - Sigstore transparency entry: 214771345
- Sigstore integration time:
-
Permalink:
Syize/noterools@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Syize
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheel-package.yaml@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file noterools-1.1.3-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: noterools-1.1.3-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 23.3 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4225db04340bd710c40e02efa2324c881987fe038ec77990886f3ed022d71428
|
|
| MD5 |
5700b878e9d8a012102c8d8d2be7388d
|
|
| BLAKE2b-256 |
0c558e5d5877cf6ccd4d3b3e5c7dd0e3c26f7fb23cdd17e779fefcc40b2be36d
|
Provenance
The following attestation bundles were made for noterools-1.1.3-cp310-cp310-win_amd64.whl:
Publisher:
python-wheel-package.yaml on Syize/noterools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
noterools-1.1.3-cp310-cp310-win_amd64.whl -
Subject digest:
4225db04340bd710c40e02efa2324c881987fe038ec77990886f3ed022d71428 - Sigstore transparency entry: 214771351
- Sigstore integration time:
-
Permalink:
Syize/noterools@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Syize
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheel-package.yaml@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file noterools-1.1.3-cp310-cp310-win32.whl.
File metadata
- Download URL: noterools-1.1.3-cp310-cp310-win32.whl
- Upload date:
- Size: 23.3 kB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
219194c56ec2aa24f45fb1e19fe0caa47cb547212590e5e03414101f6d072b62
|
|
| MD5 |
179aaf94f25160f091d88d4e7e52a187
|
|
| BLAKE2b-256 |
375cec163101dae51042818708efdadd16760c46405cc91ded59bc76ad0e0722
|
Provenance
The following attestation bundles were made for noterools-1.1.3-cp310-cp310-win32.whl:
Publisher:
python-wheel-package.yaml on Syize/noterools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
noterools-1.1.3-cp310-cp310-win32.whl -
Subject digest:
219194c56ec2aa24f45fb1e19fe0caa47cb547212590e5e03414101f6d072b62 - Sigstore transparency entry: 214771349
- Sigstore integration time:
-
Permalink:
Syize/noterools@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Syize
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheel-package.yaml@4c59ae8c6660eeea62f6ca9818502486e16451e6 -
Trigger Event:
workflow_dispatch
-
Statement type: