Skip to content

API reference

Generated from the source with mkdocstrings.

Client

bibliofabric.gleif.GleifClient

Client for the GLEIF API.

The API needs no credentials. The client sends Accept: application/vnd.api+json on every request and paces itself below the documented limit of 60 requests per minute.

lei_records: LeiRecordsResource cached property

The LEI records resource client, with the corporate-tree helpers.

autocompletions: AutocompletionsResource cached property

The autocompletion endpoint.

fuzzy_completions: FuzzyCompletionsResource cached property

The fuzzy matching endpoint.

fields: FieldsResource cached property

The LEI data field metadata.

lei_issuers: LeiIssuersResource cached property

The LEI issuing organizations.

vlei_issuers: VleiIssuersResource cached property

The vLEI verifiers.

countries: CountriesResource cached property

The ISO 3166 country codes.

regions: RegionsResource cached property

The ISO 3166 subdivision codes.

jurisdictions: JurisdictionsResource cached property

The GLEIF-accepted legal jurisdictions.

The EFLF legal form codes.

official_organizational_roles: OfficialOrganizationalRolesResource cached property

The official organizational role codes.

registration_authorities: RegistrationAuthoritiesResource cached property

The GLEIF registration authority codes.

registration_agents: RegistrationAgentsResource cached property

The registration agents.

export_lei_records(export_format: str = 'csv', filters: LeiRecordFilters | Mapping[str, Any] | None = None, *, sort: str | None = None) -> bytes async

Export the current result of an LEI record query as one file.

Parameters:

Name Type Description Default
export_format str

"csv", "xlsx", or "json".

'csv'
filters LeiRecordFilters | Mapping[str, Any] | None

The same filter criteria lei_records.search() takes; see :class:bibliofabric.gleif.LeiRecordFilters.

None
sort str | None

Sort key as in search().

None

Returns:

Type Description
bytes

The raw file bytes. The service caps one export at 5000

bytes

records; narrow the query with filters.

Raises:

Type Description
ConfigurationError

export_format is not one of the three formats.

The sync twin GleifSyncClient mirrors the client method for method and exports from the same module: from bibliofabric.gleif import GleifSyncClient.

Settings

bibliofabric.gleif.GleifSettings

GLEIF-specific client settings.

Inherits timeout, max_retries, max_retry_wait, max_requests_per_second, max_concurrency, user_agent and mailto from :class:bibliofabric.config.BaseApiSettings and sets GLEIF defaults (0.95 requests per second, concurrency 3). The API needs no credentials.

LEI records

bibliofabric.gleif.LeiRecordsResource

Client for the /lei-records endpoint.

get(), search(), iterate(), collect(), first(), count(), exists(), and batch_get() address the record routes. The corporate-tree helpers below read the relationship sub-routes; the *_parent lookups return None when the record reports no such parent, and the collection helpers return a list.

direct_parent(lei: str) -> LeiRecord | None async

Return the directly consolidating parent, or None.

ultimate_parent(lei: str) -> LeiRecord | None async

Return the ultimate parent, or None.

direct_children(lei: str, *, limit: int | None = None) -> list[LeiRecord] async

Return the children the record consolidates directly.

ultimate_children(lei: str, *, limit: int | None = None) -> list[LeiRecord] async

Return the children consolidated anywhere down the tree.

direct_parent_relationship(lei: str) -> RelationshipRecord | None async

Return the Level 2 record behind :meth:direct_parent.

ultimate_parent_relationship(lei: str) -> RelationshipRecord | None async

Return the Level 2 record behind :meth:ultimate_parent.

direct_child_relationships(lei: str, *, limit: int | None = None) -> list[RelationshipRecord] async

Return the Level 2 records behind :meth:direct_children.

ultimate_child_relationships(lei: str, *, limit: int | None = None) -> list[RelationshipRecord] async

Return the Level 2 records behind :meth:ultimate_children.

direct_parent_reporting_exception(lei: str) -> ReportingException | None async

Return the filed exception to direct parent reporting, or None.

ultimate_parent_reporting_exception(lei: str) -> ReportingException | None async

Return the filed exception to ultimate parent reporting, or None.

lei_issuer(lei: str) -> LeiIssuer | None async

Return the organization that issued this LEI.

managing_lou(lei: str) -> LeiRecord | None async

Return the managing Local Operating Unit as an LEI record.

associated_entity(lei: str) -> LeiRecord | None async

Return the LEI record of the associated entity (funds), or None.

successor_entity(lei: str) -> LeiRecord | None async

Return the LEI record of the successor, or None.

isins(lei: str, *, limit: int | None = None) -> list[Isin] async

Return the ISIN-to-LEI mappings reported for this record.

field_modifications(lei: str, filters: FieldModificationFilters | Mapping[str, Any] | None = None, *, limit: int | None = None) -> list[FieldModification] async

Return the field change history of one LEI, newest first.

filters narrows the history; see :class:bibliofabric.gleif.FieldModificationFilters.

Filters

bibliofabric.gleif.LeiRecordFilters

Filter model for the /lei-records route.

lei takes one LEI or a sequence of LEIs (comma-joined OR, up to roughly 100 per request). owns and owned_by take the LEI whose parents or children the query returns.

bibliofabric.gleif.FieldModificationFilters

Filter model for the field-modifications routes.

bibliofabric.gleif.CompletionFilters

Filter model for the fuzzycompletions and autocompletions routes.

field is required and chooses the searchable field; the search term travels in the query= argument of search(). The routes differ per field: autocompletions rejects entity.legalName with a 400 answer, so use fulltext there; fuzzycompletions accepts entity.legalName.

Registry resources

bibliofabric.gleif.FieldsResource

Client for the /fields endpoint: LEI data field metadata.

bibliofabric.gleif.LeiIssuersResource

Client for the /lei-issuers endpoint.

jurisdictions(issuer_id: str, *, limit: int | None = None) -> list[LeiIssuerJurisdiction] async

Return the jurisdictions an issuer is accredited for.

bibliofabric.gleif.VleiIssuersResource

Client for the /vlei-issuers endpoint.

bibliofabric.gleif.CountriesResource

Client for the /countries endpoint.

bibliofabric.gleif.RegionsResource

Client for the /regions endpoint: ISO 3166 subdivisions.

bibliofabric.gleif.JurisdictionsResource

Client for the /jurisdictions endpoint.

bibliofabric.gleif.EntityLegalFormsResource

Client for the /entity-legal-forms endpoint.

bibliofabric.gleif.OfficialOrganizationalRolesResource

Client for the /official-organizational-roles endpoint.

bibliofabric.gleif.RegistrationAuthoritiesResource

Client for the /registration-authorities endpoint.

bibliofabric.gleif.RegistrationAgentsResource

Client for the /registration-agents endpoint.