diff --git a/duecredit/dueswitch.py b/duecredit/dueswitch.py
index 07ea589..1f76fb1 100644
--- a/duecredit/dueswitch.py
+++ b/duecredit/dueswitch.py
@@ -69,16 +69,23 @@ class DueSwitch(object):
         return self.__active
 
     @never_fail
-    def _dump_collector_summary(self):
+    def dump(self, **kwargs):
+        """Dumps summary of the citations
+
+        Parameters
+        ----------
+        **kwargs: dict
+           Passed to `CollectorSummary` constructor.
+        """
         from duecredit.collector import CollectorSummary
-        due_summary = CollectorSummary(self.__collectors[True])
+        due_summary = CollectorSummary(self.__collectors[True], **kwargs)
         due_summary.dump()
 
     def __prepare_exit_and_injections(self):
         # Wrapper to create and dump summary... passing method doesn't work:
         #  probably removes instance too early
 
-        atexit.register(self._dump_collector_summary)
+        atexit.register(self.dump)
 
         # Deal with injector
         from .injections import DueCreditInjector
@@ -93,7 +100,7 @@ class DueSwitch(object):
             is_public = lambda x: not x.startswith('_')
             # Clean up current bindings first
             for k in filter(is_public, dir(self)):
-                if k not in ('activate', 'active'):
+                if k not in ('activate', 'active', 'dump'):
                     delattr(self, k)
 
             new_due = self.__collectors[activate]

Make `DueSwitch._dump_collector_summary` public?
I am very new to this library, so there may be good reasons to avoid this. However, from my perspective, it seems natural to have `DueSwitch._dump_collector_summary` as a public function (perhaps exposed as `DueSwitch.due_summary` or something) to make using duecredit with standalone jupyter notebooks a little more self-contained. I am thinking along the lines of:

    # near top of notebook
    import os
    os.environ['DUECREDIT_ENABLE'] = 'yes'

    # body of notebook
    import fancymodule as fm
    fm.do_stuff()

    # section at the end
    fm.due._dump_collector_summary()

This way one doesn't have to deal with external files keeping track of citations, possibly being added to by other notebooks which could possibly be undesirable.


diff --git a/duecredit/tests/test_dueswitch.py b/duecredit/tests/test_dueswitch.py
index 6a1b826..c1d664d 100644
--- a/duecredit/tests/test_dueswitch.py
+++ b/duecredit/tests/test_dueswitch.py
@@ -38,4 +38,4 @@ def test_dueswitch_activate(monkeypatch):
     # was not active, so should have called activate of the injector class
     assert state["activate"] == 1
     assert state["register"] == 1
-    assert state["register_func"] == due._dump_collector_summary
+    assert state["register_func"] == due.dump

pip install -e .[tests]
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y libxml2-dev libxslt1-dev
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi==2025.1.31
charset-normalizer==3.4.1
citeproc-py==0.8.2
contextlib2==21.6.0
-e git+https://github.com/duecredit/duecredit.git@108397f32edf8b35ad6b416fa50f33a110263a3b#egg=duecredit
exceptiongroup==1.2.2
idna==3.10
iniconfig==2.1.0
lxml==5.3.1
multidict==6.2.0
packaging==24.2
pluggy==1.5.0
propcache==0.3.1
pytest==8.3.5
PyYAML==6.0.2
requests==2.32.3
six==1.17.0
tomli==2.2.1
typing_extensions==4.13.0
urllib3==1.26.20
vcrpy==7.0.0
wrapt==1.17.2
yarl==1.18.3

name: duecredit
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - citeproc-py==0.8.2
      - contextlib2==21.6.0
      - exceptiongroup==1.2.2
      - idna==3.10
      - iniconfig==2.1.0
      - lxml==5.3.1
      - multidict==6.2.0
      - packaging==24.2
      - pluggy==1.5.0
      - propcache==0.3.1
      - pytest==8.3.5
      - pyyaml==6.0.2
      - requests==2.32.3
      - six==1.17.0
      - tomli==2.2.1
      - typing-extensions==4.13.0
      - urllib3==1.26.20
      - vcrpy==7.0.0
      - wrapt==1.17.2
      - yarl==1.18.3
prefix: /opt/conda/envs/duecredit

duecredit/tests/test_dueswitch.py::test_dueswitch_activate
duecredit/dueswitch.py
duecredit/dueswitch.py