Metadata-Version: 2.4
Name: leisearchpro
Version: 0.1.0
Summary: LEI lookup, search, corporate groups and sanctions screening (OFAC, EU, UN, UK) with the LEISearchPro API
Author: LEISearchPro
License: MIT
Project-URL: Homepage, https://leisearch.pro
Project-URL: Free API key, https://leisearch.pro/signup
Project-URL: Documentation, https://leisearch-api-n5auomxnkq-ew.a.run.app/docs
Project-URL: Pricing, https://leisearch.pro/api.html#pricing
Keywords: LEI,legal entity identifier,GLEIF,KYC,KYB,sanctions,compliance,BIC,ISIN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Office/Business :: Financial
Classifier: Intended Audience :: Financial and Insurance Industry
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# leisearchpro

Python client for the [LEISearchPro API](https://leisearch.pro): look up and search Legal Entity Identifiers (LEIs), find the LEI behind a BIC or ISIN, map corporate groups, and screen entities against OFAC, EU, UN and UK sanctions lists.

No dependencies beyond the Python standard library.

## Get a free API key

Sign up at **https://leisearch.pro/signup**: free, no card. The free plan is for evaluation and prototyping. Higher limits, monitoring, webhooks and KYB / UBO checks come with the [paid plans](https://leisearch.pro/api.html#pricing).

## Install

```bash
pip install leisearchpro
```

## Use

```python
from leisearchpro import LEISearchPro

client = LEISearchPro(api_key="lsi_...")        # or set LEISEARCHPRO_API_KEY

record = client.lei("7LTWFZYICNSX8D621K86")  # Deutsche Bank AG
print(record["legalName"], record["entityStatus"])

hits = client.search("Barclays", jurisdiction="GB")
by_bic = client.by_bic("DEUTDEFF")
issuer = client.by_isin("DE0005140008")
group = client.group("7LTWFZYICNSX8D621K86")

screen = client.screen_name("Gazprombank")
```

Check an LEI's format and check digits offline, with no API call:

```python
from leisearchpro import is_valid_lei
is_valid_lei("7LTWFZYICNSX8D621K86")   # True
```

A rate-limited call (HTTP 429) waits for the server's `Retry-After` and is retried once (`LEISearchPro(retries=...)`). Other errors raise `LEISearchProError`, with `.status` and `.detail`.

## Examples

See [`examples/`](examples/):
- `validate_leis.py`: check a list of LEIs and flag lapsed or unknown ones.
- `bic_to_lei.py`: find the LEI behind a list of BICs (useful for CHAPS ISO 20022 payments).

## Links

- API reference: https://leisearch-api-n5auomxnkq-ew.a.run.app/docs
- OpenAPI spec: https://leisearch-api-n5auomxnkq-ew.a.run.app/openapi.json
- Plans and limits: https://leisearch.pro/api.html#pricing

MIT licence.
