Skip to main content

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

citation and bibliography

cross-references

Important Note

  • This script can only work in Windows.

How to use?

  1. Install noterools via pip.
pip install noterools
  1. 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

noterools-1.1.3.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

noterools-1.1.3-cp313-cp313-win_amd64.whl (23.3 kB view details)

Uploaded CPython 3.13Windows x86-64

noterools-1.1.3-cp313-cp313-win32.whl (23.3 kB view details)

Uploaded CPython 3.13Windows x86

noterools-1.1.3-cp312-cp312-win_amd64.whl (23.3 kB view details)

Uploaded CPython 3.12Windows x86-64

noterools-1.1.3-cp312-cp312-win32.whl (23.3 kB view details)

Uploaded CPython 3.12Windows x86

noterools-1.1.3-cp311-cp311-win_amd64.whl (23.3 kB view details)

Uploaded CPython 3.11Windows x86-64

noterools-1.1.3-cp311-cp311-win32.whl (23.3 kB view details)

Uploaded CPython 3.11Windows x86

noterools-1.1.3-cp310-cp310-win_amd64.whl (23.3 kB view details)

Uploaded CPython 3.10Windows x86-64

noterools-1.1.3-cp310-cp310-win32.whl (23.3 kB view details)

Uploaded CPython 3.10Windows x86

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

Hashes for noterools-1.1.3.tar.gz
Algorithm Hash digest
SHA256 099f67c28916c026b04461d6cd896279c162eac0e12ed2f7e9de1526110290ed
MD5 3f80924d89a55efbba4faaccc7f9600c
BLAKE2b-256 d176de56fc5fd943351704784ae3a3fe9fb8febe3a90e8df71034315b4bd417a

See more details on using hashes here.

Provenance

The following attestation bundles were made for noterools-1.1.3.tar.gz:

Publisher: python-package.yaml on Syize/noterools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for noterools-1.1.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3fd87bceec28de43fdd533d5d5d764121c6adb3148961cdeb48217db33d7d9c0
MD5 2ce5fc269123e7252051ee72671c770e
BLAKE2b-256 16bcc9dca2fd61a95dd6ef8150ed6866a643046a74b111a3c8a4897c12526cd8

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for noterools-1.1.3-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 6db853940af987936175b388edf1bd8944865bdd66120569e95793363a3a64b3
MD5 87477caea5f86775191f42ad48fd25d6
BLAKE2b-256 4c1d6dd4a2dd72789fb7be23ebbe2a8fdefb8b5c7161435607a6ee332f921ef7

See more details on using hashes here.

Provenance

The following attestation bundles were made for noterools-1.1.3-cp313-cp313-win32.whl:

Publisher: python-wheel-package.yaml on Syize/noterools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for noterools-1.1.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a5da304cbf8560a129dec48d7a301612ad9f187311c992b8855a6aea0d6affe9
MD5 29431821dc44d2dc3862332b510d67e4
BLAKE2b-256 2732174d2ace976cac7f7f6f4f7d10b908116f84671269b0fc2995331b440b93

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for noterools-1.1.3-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 c10fec6091af182f6bf1711208180494274efef3a78d0e86aaa2ebef9b9227ee
MD5 8f6b1e84ec3d7d6b42ad18fce7c7487b
BLAKE2b-256 225e1cce4ee777593e15f4801d925d7c2a4496bad02e79b5ecbdf4fe7fb6462d

See more details on using hashes here.

Provenance

The following attestation bundles were made for noterools-1.1.3-cp312-cp312-win32.whl:

Publisher: python-wheel-package.yaml on Syize/noterools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for noterools-1.1.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4975b21313b07c58206089e7eb25d01006c106d2b8b4dc376558ace42f35a4d8
MD5 3d7b7198c89df66b325c0a7cbc25d3f8
BLAKE2b-256 a5bacf3664abbc5d3f5183b92cd642be15f4b8926e832726288884f59e9cb162

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for noterools-1.1.3-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 acd921ea6f05c6f7a975cf2c75e8cfef073bdc70c03a089ee26e0a97ec5173c3
MD5 81343a9892f6d586ce9711bec595c9e9
BLAKE2b-256 485dd31bd520c37d7409dbc1ee8dafe2cc582f7a89978f45addafa214ae1c82f

See more details on using hashes here.

Provenance

The following attestation bundles were made for noterools-1.1.3-cp311-cp311-win32.whl:

Publisher: python-wheel-package.yaml on Syize/noterools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for noterools-1.1.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4225db04340bd710c40e02efa2324c881987fe038ec77990886f3ed022d71428
MD5 5700b878e9d8a012102c8d8d2be7388d
BLAKE2b-256 0c558e5d5877cf6ccd4d3b3e5c7dd0e3c26f7fb23cdd17e779fefcc40b2be36d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for noterools-1.1.3-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 219194c56ec2aa24f45fb1e19fe0caa47cb547212590e5e03414101f6d072b62
MD5 179aaf94f25160f091d88d4e7e52a187
BLAKE2b-256 375cec163101dae51042818708efdadd16760c46405cc91ded59bc76ad0e0722

See more details on using hashes here.

Provenance

The following attestation bundles were made for noterools-1.1.3-cp310-cp310-win32.whl:

Publisher: python-wheel-package.yaml on Syize/noterools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page