liquilens
Python client for the LiquiLens public API.
LiquiLens publishes research screens over public records about Indian lenders. Every institution,
place and publisher it describes has one canonical id, such as inst:in/rbi/dena-bank, with the
keys each dataset uses for it (a CIN, an RBI label, a geography id) and typed links between them.
This package reads that free identity layer, follows succession links to the identity that carries
an institution today, and builds portable identity bundles in CSV, Parquet or DuckDB that join to
your own data on the same ids.
The package holds no scoring or engine logic. Every answer comes from the public HTTP API at
https://api.liquilens.in, and the package keeps nothing on disk unless you ask it to build a
bundle.
- Typed results for
resolve,describe,links,current_identityandcensus - Typed errors:
KeyRequired(401),PaidKeyRequired(402),RateLimited(429) and more - Retries with exponential backoff for 429 and 5xx, honouring
Retry-After - An OData identity feed reader that follows every page
liquilens bundle build, with a manifest validated against the published bundle schema
An OpenBB provider lives in integrations/openbb as the separate
distribution openbb-liquilens.
Install
pip install liquilens
Optional extras keep the core install light (httpx and jsonschema only):
pip install "liquilens[pandas]" # FeedResult.to_pandas()
pip install "liquilens[parquet]" # Parquet bundles (pyarrow)
pip install "liquilens[duckdb]" # DuckDB bundles
pip install "liquilens[charts]" # liquilens.charts for Plotly and Matplotlib
Python 3.10 or later. To install from a checkout instead: pip install .
Quickstart
from liquilens import Client
with Client() as ll: # reads LIQUILENS_API_KEY when it is set
hit = ll.resolve("Dena Bank")
hit.status, hit.id, hit.rule # ('resolved', 'inst:in/rbi/dena-bank', 'rbi_label')
ll.resolve("Aurangabad").candidates # two districts share the name: ambiguous, never guessed
ll.resolve("No Such Lender").status # 'not_found': nothing is minted for an unknown name
dena = ll.describe(hit.id)
dena.label, dict(dena.keys) # ('Dena Bank', {'rbi_label': 'Dena Bank'})
for link in dena.links_in: # links are src -> dst, each with its basis in note
print(link.src, link.kind, link.dst, link.note)
today = ll.current_identity(hit.id)
today.id, today.chain # follows the dated 'succeeds' link to Bank of Baroda
today.stopped # 'no_successor'
census = ll.census() # counts the API generates, by kind and key space
census.by_kind, census.key_spaces
Resolution never guesses. status is resolved, ambiguous (the candidates are listed and none is
picked) or not_found; the last two are results, not errors. current_identity stops and returns
the candidates when a predecessor has more than one successor, and says so in stopped when the
API capped the links it could check.
A predecessor keeps its own id and every figure printed under its name. Join on canonical ids or keys, never on labels.
OntologyObject.note is the API's free-text context exactly as served. The identity feed, the
bundles and the OpenBB provider show only its type code and registered city or state.
The OData identity feed
from liquilens import Client, quote_literal
with Client() as ll:
banks = ll.feed("Institutions", filter=f"Category eq {quote_literal('Small finance bank (SFB)')}")
banks.rows[0]["Id"], banks.total, banks.complete
frame = banks.to_pandas() # needs liquilens[pandas]
The feed has four entity sets: Institutions, Places, Publishers and Links. feed() follows
every @odata.nextLink, always from your configured origin, so a key is never sent to a host named
inside a response. Build string literals with quote_literal, never by pasting text into a filter.
Identity bundles
liquilens bundle build ./ll-identity # CSV
liquilens bundle build ./ll-identity --format parquet --format duckdb --overwrite
liquilens bundle verify ./ll-identity
from liquilens.bundle import build_bundle, verify_bundle
result = build_bundle("./ll-identity", formats=["csv", "duckdb"])
result.partial, result.reasons
verify_bundle(result.path).ok
A bundle folder holds:
| File | Contents |
|---|---|
objects |
One row per object: id, kind, label, jurisdiction, authority, note |
keys |
One row per (object_id, space, key) |
aliases |
One row per (object_id, alias) |
links |
One row per link: src, kind, dst, note (the link's basis) |
manifest.json |
Build time, the API's source commit, transaction-time horizon, row counts and the sha256 of every file |
rights-rule.json |
The rights rule the bundle applied; its sha256 is the manifest's register_sha256 |
NOTICE.txt |
What the bundle is, whether it is complete, and how to verify it |
The tables follow the bundle layout of the LiquiLens ontology specification (version 1, section
9.2), with the same ids the API serves. CSV writes one file per table, Parquet one file per table,
DuckDB one liquilens.duckdb database with all four tables and primary keys that enforce their
invariants.
Notes on the columns:
jurisdictionandauthorityare the id's own lowercase segments (in,rbi), as the id grammar defines them.noteis the feed's plain-English category for an institution and the level (state,district) for a place.- The feed joins aliases with
"; ", and the builder splits them on that separator. - The feed leaves out every object, key and link known only through a source that may not be
redistributed in bulk.
describestill serves those one at a time.
The manifest validates against the published bundle-manifest.schema.json, which the package
vendors. It records spec_version 1.0, because the bundle section of the specification is a
proposal for version 1.1 that has not been released. source_commit comes from the API's
GET /api/v1/release/identity; if the API releases a new version while a bundle is being read,
the build stops rather than mix two versions. A bundle holds identity only, no facts, so
commercial_only is false and no source verdict was applied; rights-rule.json states that rule.
Without a key a bundle is partial, and says so. The feed gives a caller without a key the first
50 positions of any query and a daily budget of 500 rows, so a keyless build is a sample of each
entity set. The manifest sets scope.partial with a reason per entity set, NOTICE.txt opens with
Status: PARTIAL, and the command prints the same. With a key, every page is followed and the
bundle is complete. The API key is never written to a bundle.
What is free and what needs a key
Free, without a key (within rate limits): the identity layer. Canonical ids, names, keys,
aliases, typed links and the census, through resolve, describe, links, current_identity and
census, plus the OData identity feed for lookups: the first 50 positions of any query and 500 rows
a day, with no range comparisons or ordered walks.
Needs an API key:
- The whole identity feed in bulk, every row and every query option: a free key.
- Facts, point-in-time (as-of) history and bulk depth on the research routes: a free or a paid key, depending on the sources a response cites.
- The source link behind each figure: a paid key.
Version 0.1.0 of this client reads only the identity layer. The API names anything it withholds:
OntologyObject.access, Census.access and FeedResult.access carry its note, and a refused
request raises KeyRequired or PaidKeyRequired with the API's own how_to_get_access text. The
limits above are the API's at the time of writing; the API's notes are authoritative. For a key, see
liquilens.in.
Set the key in the environment rather than in code:
export LIQUILENS_API_KEY=llk_v1_...
Examples
Two notebooks in examples/ call the live free endpoints. They are committed without
outputs, so this repository redistributes no figures; run them to see results.
01_resolve_your_institution_list.ipynb: resolve a list of Indian lender names to canonical ids, keep ambiguous and unknown names as results, follow succession links, and see where point-in-time facts need a key.02_real_signal_or_noise.ipynb: ask whether a public money-market spread from Seiche really changed, with NoiseFloor's change tests, and how the same tests apply to LiquiLens lender panels named by canonical id.
pip install . noisefloor jupyterlab # from a checkout
jupyter lab examples/
Without a key neither notebook calls a route that needs one. Drafts for publishing the identity
bundle on Hugging Face and Kaggle are in datasets/; nothing has been uploaded.
Charts
liquilens.charts draws line charts in the family style specified for LiquiLens, Seiche and
Undertow. It needs an extra: pip install "liquilens[charts]" for both libraries, or
liquilens[plotly] or liquilens[matplotlib] alone.
import matplotlib.pyplot as plt
from liquilens import charts
# Synthetic figures. Series A has no value for 2026-09-30.
series = {
"Series A": [("2026-03-31", 11.2), ("2026-06-30", 11.6), ("2026-09-30", None), ("2026-12-31", 12.9)],
"Series B": [("2026-03-31", 9.4), ("2026-06-30", 9.8), ("2026-09-30", 10.1), ("2026-12-31", 10.0)],
}
fig = charts.plotly_lines(series) # a Plotly figure in the family template
fig.update_layout(title="Example ratio", yaxis_title="%")
fig.show()
with charts.matplotlib_style(): # the family Matplotlib style
figure, ax = plt.subplots()
charts.matplotlib_lines(ax, series)
ax.set_title("Example ratio")
figure.savefig("example-ratio.png")
Series A breaks at 2026-09-30, and its 2026-12-31 value, with no value beside it, is drawn as a dot. Both backends keep the same rules:
- A missing value (
Noneor NaN) breaks the line: nothing is interpolated, carried forward or drawn as 0. List a missing period asNone; a period left out of a series is not known to be missing, so the line joins its neighbours. - A value with no value beside it on either side is drawn as a dot.
- Each series pairs a colour with a dash pattern (solid, dash, dot, dash-dot), so colour is never the only channel and one chart holds up to four series.
- A period that appears twice in one series is withheld and drawn as a gap, with a
LiquiLensWarning, rather than choosing one of its values. - Values are plotted as given. A point's time is a date (a period), a timezone-aware UTC datetime (an instant) or the ISO 8601 text of either; another zone is refused, never converted. Axes print ISO dates.
charts.plotly_template() returns the Plotly template and charts.apply_plotly_template(fig)
applies it to a figure of your own. The family design system publishes the template at
https://liquilens.in/design/plotly-template.json and the style at
https://liquilens.in/design/liquilens.mplstyle. The package ships pinned copies of both, byte for
byte, and never fetches them: src/liquilens/design/VENDORED.json
records the source commit, each file's public URL and its sha256, and the tests check both digests.
Excel and Power BI
The identity feed is an OData v4 service, so Excel and Power BI read it without an add-in.
Feed URL:
https://api.liquilens.in/api/experimental/v1/ontology/odata
Excel (Microsoft 365, Windows): Data > Get Data > From Other Sources > From OData Feed. Paste
the feed URL, choose Anonymous, then pick Institutions, Places, Publishers or Links in the
Navigator and load them. Excel for Mac offers the OData feed source only in some builds; check yours
before relying on it.
Power BI Desktop: Get data > OData feed, paste the feed URL, choose Anonymous, and pick the tables.
Join your sheets on the Id column. To attach your own list of lenders, resolve each name or CIN once
(liquilens resolve "Dena Bank") and keep the returned id.
Without a key each table loads its first 50 rows. To load every row with a key, add the header in Power Query's Advanced Editor, keeping the key in a Power Query parameter rather than in the query text:
OData.Feed(
"https://api.liquilens.in/api/experimental/v1/ontology/odata/Institutions",
[Authorization = "Bearer " & LiquiLensKey]
)
Do not share a workbook that holds a key.
Errors
| Exception | When |
|---|---|
KeyRequired |
HTTP 401: the request needs a free API key, or the keyless allowance is used up |
PaidKeyRequired |
HTTP 402: the request needs a paid API key |
RateLimited |
HTTP 429 after retries; retry_after holds the API's wait in seconds |
ObjectNotFound |
describe of an id no object has |
NotFound, InvalidRequest, ServerError, APIError |
Other HTTP errors |
TransportError |
Connection failures and timeouts after retries |
UnexpectedResponse |
A response this client does not recognise |
KeyRequired and PaidKeyRequired are AccessErrors and carry depth, what, requires, tier,
message and how_to_get_access when the API sent them. Every error derives from LiquiLensError.
Retries and limits
Client(
api_key=None, # or LIQUILENS_API_KEY
base_url=None, # or LIQUILENS_BASE_URL, else https://api.liquilens.in
timeout=30.0,
retries=3, # timeouts, network errors, 429 and 5xx
backoff=0.5, # 0.5 s, 1 s, 2 s ... capped at 30 s
max_retry_wait=60.0, # a longer Retry-After is raised as RateLimited at once
)
A daily allowance refusal carries a long Retry-After; the client raises it instead of sleeping.
Security and privacy
- The key is read from the
api_keyargument orLIQUILENS_API_KEY, sent only to the configured origin asAuthorization: Bearer, never logged, never shown inrepr, and never written to a bundle. The command line reads it from the environment only. base_urlmust be HTTPS (plain HTTP only on a loopback address) and a bare origin.- Redirects are never followed, responses are size-capped, and paging links are requested from the configured origin only.
- If the API reports that it did not accept a key, the client warns once (
LiquiLensWarning).
See SECURITY.md to report a vulnerability.
Development
python -m pip install -e . --group dev # pip 25.1 or later
python -m pip install -e ".[charts]" --group dev # also runs the chart tests
pytest # offline: every request is mocked
ruff check . && ruff format --check . && mypy
LIQUILENS_LIVE=1 pytest tests/test_live.py # about ten requests to the real API
The tests never touch the network unless LIQUILENS_LIVE=1 is set. The OpenBB provider has its own
tests under integrations/openbb/tests.
Licence
MIT, see LICENSE. Data served by the API stays subject to the terms LiquiLens and its sources state for it.
Metadata
Release files for liquilens 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| liquilens-0.1.1.tar.gz | 247.6 kB | With provenance | Details for liquilens-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| liquilens-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for liquilens-0.1.1-py3-none-any.whl |
Total release size: 464.3 kB
Release files / liquilens-0.1.1.tar.gz
| Download URL | liquilens-0.1.1.tar.gz |
|---|---|
| Size | 247.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b987c684ed0204b3b3fdbf381ad089101b676916c64a80ad4d4854c121ccbdba
|
|
BLAKE2b-256 checksum How to use checksums |
923882933a366abf1cc45a07cf8ebc55b81dde8186615dd37083a77eeca94b44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logRelease files / liquilens-0.1.1-py3-none-any.whl
| Download URL | liquilens-0.1.1-py3-none-any.whl |
|---|---|
| Size | 216.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
698ab81d5f3e4ccfc84b4298ea890143dc70fb41a47ce8369e37b60e4c1c96a2
|
|
BLAKE2b-256 checksum How to use checksums |
1dfc46cf78f0942eb16d27d2588ee50a7bf2291a51be6748f08641d5980693f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logSecurity for liquilens 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for liquilens-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.