def register(self, url, doc):
        """Register a DOI via the DataCite API.

        :param url: Specify the URL for the API.
        :param doc: Set metadata for DOI.
        :returns: `True` if is registered successfully.
        """
        try:
            self.pid.register()
            # Set metadata for DOI
            self.api.metadata_post(doc)
            # Mint DOI
            self.api.doi_post(self.pid.pid_value, url)
        except (DataCiteError, HttpError):
            logger.exception("Failed to register in DataCite",
                             extra=dict(pid=self.pid))
            raise
        logger.info("Successfully registered in DataCite",
                    extra=dict(pid=self.pid))
        return True
def register ( self , url , doc ) : try : self . pid . register ( ) self . api . metadata_post ( doc ) self . api . doi_post ( self . pid . pid_value , url ) except ( DataCiteError , HttpError ) : logger . exception ( "Failed to register in DataCite" , extra = dict ( pid = self . pid ) ) raise logger . info ( "Successfully registered in DataCite" , extra = dict ( pid = self . pid ) ) return True
Register a DOI via the DataCite API.

        :param url: Specify the URL for the API.
        :param doc: Set metadata for DOI.
        :returns: `True` if is registered successfully.