Metadata-Version: 2.1
Name: pygleif
Version: 2024.8.2
Summary: Query the GLEIF API using Python
Author-email: ggravlingen <no@email.com>
License: MIT
Project-URL: Source Code, https://github.com/ggravlingen/pygleif
Keywords: lei-code,lei,api,gleif,leicode
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Intended Audience :: Financial and Insurance Industry
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic<3,>2
Provides-Extra: test
Requires-Dist: coverage==7.6.0; extra == "test"
Requires-Dist: mypy==1.11.1; extra == "test"
Requires-Dist: pre-commit==3.8.0; extra == "test"
Requires-Dist: ruff==0.5.5; extra == "test"
Requires-Dist: pytest==8.3.2; extra == "test"
Requires-Dist: pytest-cov==5.0.0; extra == "test"

[![PyPI version](https://badge.fury.io/py/pygleif.svg)](https://badge.fury.io/py/pygleif)

This library uses Python to query the GLEIF.org's API. Currently, the library supports:
- Fetching data for a specific API
- Searching for a LEI using an organisation number

The library is strictly typed using [`Pydantic`](https://github.com/pydantic/pydantic).

#### Installing the library
`pip install pygleif`

#### Example: fetching data for a specific LEI:

```python
from pygleif import PyGleif

gleif_response = PyGleif("549300MLUDYVRQOOXS22")

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

#### Example: search for a LEI using organisation number:

```python
from pygleif import Search

gleif_response = Search("5560142720")

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

# prints 213800T8PC8Q4FYJZR07
```
