Generating Provider Reports

This section describes how to generate provider reports and things to know regarding this process.

Individual provider reports are generated based on data from:

Before you generate: If you just want to update an email address, description, or oai_endpoint for a provider, don’t need to generate a whole new report. Instead:

  1. update the information against the Repox API (you can do this with pyrepox by following the instructions below)

  2. edit the corresponding rst directly.

Doing this is much faster! Just make sure you update the value in Repox and not just in the rst file.

Generating Reports

  1. Fill out your config file.

  2. If you want MODS count to be correct, make sure that value is set to True (even though it takes a lot longer.)

  3. To generate for all providers, just run python generate.py

  4. To generate a report for a specific provider, use the p flag with the Repox provider_id: python generate.py -p memphispublicr0

Interacting with Repox with Pyrepox

If you want to update an email_address for a provider or get the identifier for a provider, you can do this with pyrepox. While pyrepox does many other things these examples are intended to help you with common tasks related to generating DLTN docs.

  1. Using your preferred method, install pyrepox and enter a python interactive shell:

1
2
pipenv install repox
python
  1. Once you are in your interactive shell, import pyrepox and make a connection to our instance of repox.

1
2
from repox.repox import Repox
dltn = Repox("https://link-to-our-instance-of-repox.edu", "username", "password")
  1. We’re going to need our aggregator code (TNDPLAr0), or you can find it with:

1
2
>>> dltn.list_all_aggregators()[0]
'TNDPLAr0'
  1. To find your provider id, use get_list_of_providers() with our aggregator id:

1
2
>>> dltn.get_list_of_providers('TNDPLAr0')
['CountryMusicHallofFamer0', 'CrossroadstoFreedomr0', 'KnoxPLr0', 'memphispublicr0', 'MTSUr0', 'nashvillepublicr0', 'tslar0', 'UTKr0', 'utcr0']
  1. Let’s inspect a provider to see its current metadata:

1
2
>>> dltn.get_provider('memphispublicr0')
{'id': 'memphispublicr0', 'name': 'Memphis Public Library', 'country': 'ALBANIA', 'countryCode': 'al', 'description': 'contact: Gina Cordell platform: ContentDM', 'nameCode': 'memphispublic', 'homepage': '', 'providerType': 'LIBRARY', 'email': 'Gina.Cordell@memphistn.gov'}
  1. Now, let’s update the email address to be mbagget1@utk.edu:

1
2
>>> dltn.update_provider('memphispublicr0', email='mbagget1@utk.edu')
200
  1. You can check your work by re-requesting the provider:

1
2
>>> dltn.get_provider('memphispublicr0')
{'id': 'memphispublicr0', 'name': 'Memphis Public Library', 'country': 'ALBANIA', 'countryCode': 'al', 'description': 'contact: Gina Cordell platform: ContentDM', 'nameCode': 'memphispublic', 'homepage': '', 'providerType': 'LIBRARY', 'email': 'mbagget1@utk.edu'}