當前位置: 首頁>>代碼示例>>Python>>正文


Python Client.listIdentifiers方法代碼示例

本文整理匯總了Python中oaipmh.client.Client.listIdentifiers方法的典型用法代碼示例。如果您正苦於以下問題:Python Client.listIdentifiers方法的具體用法?Python Client.listIdentifiers怎麽用?Python Client.listIdentifiers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在oaipmh.client.Client的用法示例。


在下文中一共展示了Client.listIdentifiers方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: list_oai_collections

# 需要導入模塊: from oaipmh.client import Client [as 別名]
# 或者: from oaipmh.client.Client import listIdentifiers [as 別名]
    def list_oai_collections(self, community):
        """ Retrieve the header data for each record in the current community repo """

        try:
            registry = MetadataRegistry()
            registry.registerReader('oai_dc', oai_dc_reader)
            client = Client(community.repository.base_url, registry)
            records = client.listIdentifiers(
                metadataPrefix='oai_dc', set=community.identifier)
        except:
            community_collections = set()
            return


        """ Filter records to build list of collections in the community set """
        community_collections = set()
        for i in records:
            for j in i.setSpec():
                if j[:3] == 'col':
                    community_collections.add(j)
    
        print len(community_collections)
        """ Build collection tuples (identifier, name) """
        for i in community_collections:
            # print i
            # print community_collections
            
            set_data = []
            set_data.append(i)  # Store identifier
            set_data.append('Collection: %s'%i)  # Store human readable name
            # print set_data
            self.collections.append(set_data)
開發者ID:llcit,項目名稱:uh-dla-dev-py,代碼行數:34,代碼來源:utils.py

示例2: list_identifiers

# 需要導入模塊: from oaipmh.client import Client [as 別名]
# 或者: from oaipmh.client.Client import listIdentifiers [as 別名]
def list_identifiers(target, date_from, date_until, setspec):
    if target is not None:
        client = Client(target['url'], registry)
        headers = client.listIdentifiers(metadataPrefix=target['metadata_prefix'], from_=date_from, until=date_until, set=setspec)
        results = []
        if headers is not None:
            for header in headers:
                results.append(convert_header(header))
        return results
開發者ID:cogfor,項目名稱:oai2es,代碼行數:11,代碼來源:oaipmh_harvester.py

示例3:

# 需要導入模塊: from oaipmh.client import Client [as 別名]
# 或者: from oaipmh.client.Client import listIdentifiers [as 別名]
print id.repositoryName()
print id.adminEmails()
print id.baseURL()

formats = oai.listMetadataFormats()
pprint formats

# 'marc21'

sets = oai.listSets()
for s in sets:
	print s

# 'MZK03'

recids = oai.listIdentifiers(metadataPrefix='marc21', set='MZK03') # from_='2003-01-01T00:00:00Z', until=''

# for example: 'MZK03-907223' is in the list of maps
# or 356050 *not a map

# 238208 problematic
r = oai.getRecord(identifier='MZK03-1479', metadataPrefix='marc21')

# from lxml import etree
# print etree.tostring(r[1],pretty_print=True)

# xpath_evaluator = etree.XPathEvaluator(r[1][0], namespaces={'marc21':'http://www.loc.gov/MARC21/slim'})
# e = xpath_evaluator.evaluate

#s = etree.tostring(r[1][0],pretty_print=True)
開發者ID:klokan,項目名稱:oldmapsonline,代碼行數:32,代碼來源:oaipmh-client.py


注:本文中的oaipmh.client.Client.listIdentifiers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。