Skip to main content

Query the GLEIF API using Python

Project description

PyPI version

This library uses Python to query the GLEIF.org's API.

Documentation

Full documentation, including the complete API reference, is available at pygleif.readthedocs.io.

[!NOTE] pygleif.v1 (PyGleif, Search) is deprecated. New code should use pygleif.v2 (GleifClient), shown below.

Installing the library

pip install pygleif

To install the latest in-development version from main (may be ahead of the last PyPI release): pip install git+https://github.com/ggravlingen/pygleif.git@main

Example: fetching data for a specific LEI:

from pygleif import GleifClient

client = GleifClient()
response = client.get_lei_record("549300MLUDYVRQOOXS22")

# Print the name of the company with the LEI above
print(response.data.attributes.entity.legal_name.name)
# prints UK EQUITY FUND (OFFSHORE)

Example: search for a LEI using organisation number:

from pygleif import GleifClient

client = GleifClient()
response = client.search_fulltext("5560142720")

# Print the LEI of the company with the LEI above
print(response.data[0].attributes.lei)

# prints 213800T8PC8Q4FYJZR07

Async usage

Every GleifClient method has an a-prefixed async counterpart (e.g. search_fulltext / asearch_fulltext), backed by httpx:

import asyncio

from pygleif import GleifClient


async def main() -> None:
    async with GleifClient() as client:
        response = await client.aget_lei_record("549300MLUDYVRQOOXS22")
        print(response.data.attributes.entity.legal_name.name)


asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygleif-2026.7.1.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygleif-2026.7.1-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file pygleif-2026.7.1.tar.gz.

File metadata

  • Download URL: pygleif-2026.7.1.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pygleif-2026.7.1.tar.gz
Algorithm Hash digest
SHA256 0c311804e5a775005d7ccdabb20131e0e6f6a23421b0a96ef78db8cf1cc9c0ba
MD5 bd01b82e3d34a9d3693c43ebae8d613d
BLAKE2b-256 c66fe455af92774c8cd2e8d43250c96d86cf67b36a758c791e36dbc6c7323303

See more details on using hashes here.

File details

Details for the file pygleif-2026.7.1-py3-none-any.whl.

File metadata

  • Download URL: pygleif-2026.7.1-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pygleif-2026.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e7ee5eeac1331792d41b6860e60afbe5c3d34fe0925bd90e299e738ed3fbc37
MD5 06d9b7815b65be3bdd9db198dee394fd
BLAKE2b-256 2355abe5ba12b7c1d11d1a69183f8e33896b8b7b25beb25b265d815565d19c34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page