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).
- Add hyperlinks to the links in the bibliography and set the font colour and whether they are underlined or not
- (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).
- (Experimental Feature) Add hyperlinks to in-text citations in (Author, Date) format (by default, only Date is added).
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)
Metadata
Release files for noterools 1.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| noterools-1.1.4.tar.gz | 1.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| noterools-1.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.3 MB
Release files / noterools-1.1.4.tar.gz
| Download URL | noterools-1.1.4.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5e99ef4e04cb593e56943352cc1850c66116bd4de2c9fe1b6f6f628aff5a1c0
|
|
BLAKE2b-256 checksum How to use checksums |
b463a8f99cd17374e323562499a8f976a86aeb01bc730fd301f99e50e05c33a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 18, 2025.
Transparency logRelease files / noterools-1.1.4-py3-none-any.whl
| Download URL | noterools-1.1.4-py3-none-any.whl |
|---|---|
| Size | 24.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb44aafd714a3f3fe1ade92619c1d3c12651640e89f2f60496ca783f20812c32
|
|
BLAKE2b-256 checksum How to use checksums |
efc006749da060cce4cd007cee72930ab9e056cfa0925183ff7b436b2e74c4fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 18, 2025.
Transparency log