Package: leipy
LEIPYA python wrapper / client for GLEIF public API. Suggestions, requests, contributions welcome.(I started this as a hobby / learning project, so it's rough around the edges. If you are looking for a better solution, check outpygleif)DependenciesPython >= 3.4requests: For API requestsdateutil: For correctly parsing dates as datetime objectspandas: Optional, for returning output as DataFrameUsageImport, instantiate and make the request:fromleipyimportGLEIFgleif=GLEIF(api_version='v1')raw_output,results,results_df=gleif.request(['HWUPKR0MPOU8FGXBT394','7ZW8QJWVPR4P1J1KQY45'],return_dataframe=True)After that, you can access the raw output from the API, results as a class with easy to access instance members, and results as a pandas DataFrameRaw output example[{'LEI':{'$':'HWUPKR0MPOU8FGXBT394'},'Entity':{'LegalName':{'$':'Apple Inc.'},'LegalAddress':{'Line1':{'$':'C/O C T Corporation System'},'Line2':{'$':'818 West 7th Street'},'Line3':{'$':'Suite 930'},'City':{'$':'Los Angeles'},'Region':{'$':'US-CA'},'Country':{'$':'US'},'PostalCode':{'$':'90017'}},'HeadquartersAddress':{'Line1':{'$':'1 Infinite Loop'},'City':{'$':'Cupertino'},'Region':{'$':'US-CA'},'Country':{'$':'US'},'PostalCode':{'$':'95014'}},'BusinessRegisterEntityID':{'@register':'RA000598','$':'C0806592'},'LegalJurisdiction':{'$':'US'},'LegalForm':{'$':'INCORPORATED'},'EntityStatus':{'$':'ACTIVE'}},'Registration':{'InitialRegistrationDate':{'$':'2012-06-06T15:53:00.000Z'},'LastUpdateDate':{'$':'2017-12-12T21:19:00.000Z'},'RegistrationStatus':{'$':'ISSUED'},'NextRenewalDate':{'$':'2018-12-13T00:31:00.000Z'},'ManagingLOU':{'$':'EVK05KS7XY1DEII3R011'},'ValidationSources':{'$':'FULLY_CORROBORATED'}}},{'LEI':{'$':'7ZW8QJWVPR4P1J1KQY45'},'Entity':{'LegalName':{'$':'Google LLC'},'LegalAddress':{'Line1':{'$':'C/O Corporation Service Company'},'Line2':{'$':'251 Little Falls Drive'},'City':{'$':'Wilmington'},'Region':{'$':'US-DE'},'Country':{'$':'US'},'PostalCode':{'$':'19808'}},'HeadquartersAddress':{'Line1':{'$':'1600 Amphitheatre Parkway'},'City':{'$':'Mountain View'},'Region':{'$':'US-CA'},'Country':{'$':'US'},'PostalCode':{'$':'94043'}},'BusinessRegisterEntityID':{'@register':'RA000602','$':'3582691'},'LegalJurisdiction':{'$':'US'},'LegalForm':{'$':'LIMITED LIABILITY COMPANY'},'EntityStatus':{'$':'ACTIVE'}},'Registration':{'InitialRegistrationDate':{'$':'2012-06-06T15:52:00.000Z'},'LastUpdateDate':{'$':'2018-03-28T17:00:00.000Z'},'RegistrationStatus':{'$':'ISSUED'},'NextRenewalDate':{'$':'2018-08-17T18:10:00.000Z'},'ManagingLOU':{'$':'EVK05KS7XY1DEII3R011'},'ValidationSources':{'$':'FULLY_CORROBORATED'}}}]Results class example>>>print(results.legal_name)['Apple Inc.','Google LLC']>>>print(results.lei_reg_status)['ISSUED','ISSUED']>>>print(results.date_last_updated)[datetime.datetime(2017,12,12,21,19,tzinfo=tzutc()),datetime.datetime(2018,3,28,17,0,tzinfo=tzutc())]Results DataFrame example>>>results_dfcountry_hqcountry_legaldate_initial_regdate_last_updateddate_next_renewallegal_nameleilei_reg_statusstatus0USUS2012-06-06 15:53:00+00:002017-12-12 21:19:00+00:002018-12-13 00:31:00+00:00Apple Inc.HWUPKR0MPOU8FGXBT394ISSUEDACTIVE1USUS2012-06-06 15:52:00+00:002018-03-28 17:00:00+00:002018-08-17 18:10:00+00:00Google LLC7ZW8QJWVPR4P1J1KQY45ISSUEDACTIVE