nveil (top-level)¶
Module-level functions for configuring the SDK and generating specs.
configure
¶
configure(api_key, base_url='https://app.nveil.com', verify=True, verbose=False, timing=False, **kwargs)
Configure the global NVEIL client.
| PARAMETER | DESCRIPTION |
|---|---|
api_key
|
Your NVEIL API key (starts with
TYPE:
|
base_url
|
NVEIL server URL (default:
TYPE:
|
verify
|
Verify SSL certificates (set
TYPE:
|
verbose
|
Enable internal library logging (default: silent).
TYPE:
|
timing
|
Enable timing instrumentation (default:
TYPE:
|
session
¶
Scoped session — owns a temporary workspace for the duration of a with: block.
Usage::
with nveil.session() as s:
spec = s.generate_spec("bar chart of revenue", df)
fig = spec.render(df) # reuses the same workspace — no re-run
nveil.show(fig)
print(s.timer.summary())
# workspace cleaned up here
Session
¶
Scoped workspace session.
The session owns a temporary workspace and a pipeline instance.
generate_spec builds and runs the pipeline once; subsequent
render() calls reuse the already-computed outputs.
When timing=True, all operations are tracked in self.timer.
generate_spec
¶
Generate a visualization specification.
All internal processing is done by the compiled engine. The session keeps the pipeline instance alive for render() reuse.
If the server-generated data pipeline fails locally, retries with a new server call (the plan is non-deterministic).
| PARAMETER | DESCRIPTION |
|---|---|
prompt
|
Natural language visualization request.
TYPE:
|
data
|
pandas DataFrame, dict of DataFrames, or compatible input.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NveilSpec
|
NveilSpec bound to this session's workspace. |
generate_spec
¶
Generate a visualization specification from data and a prompt.
Only metadata leaves your machine — never raw data. All internal processing is handled by the compiled engine.
If the server-generated data pipeline fails locally, the SDK retries with a new server call (the plan is non-deterministic).
| PARAMETER | DESCRIPTION |
|---|---|
prompt
|
Natural language description of the desired visualization.
TYPE:
|
data
|
pandas DataFrame, dict of DataFrames, numpy array, or list of lists.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NveilSpec
|
NveilSpec that can render locally and be saved/reused. |
load_spec
¶
Load a spec from an opaque .nveil file.
No API call — loaded specs can be rendered locally for free.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
Path to a
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NveilSpec
|
NveilSpec ready to render. |
show
¶
Display a figure in the default browser.
| PARAMETER | DESCRIPTION |
|---|---|
fig
|
Figure object returned by
TYPE:
|
theme
|
Display theme ("dark" or "light").
TYPE:
|
save_image
¶
Save a figure as a static image.
Format is inferred from the file extension. Supported: .png, .jpg, .svg, .pdf (require kaleido), .html
| PARAMETER | DESCRIPTION |
|---|---|
fig
|
Figure object returned by
TYPE:
|
path
|
Output file path (e.g.
TYPE:
|
theme
|
Export theme ("dark" or "light").
TYPE:
|
width
|
Image width in pixels.
TYPE:
|
height
|
Image height in pixels.
TYPE:
|
scale
|
Font/margin scale factor.
TYPE:
|
save_html
¶
Save a figure as an interactive HTML file.
| PARAMETER | DESCRIPTION |
|---|---|
fig
|
Figure object returned by
TYPE:
|
path
|
Output file path (e.g.
TYPE:
|
theme
|
Export theme ("dark" or "light").
TYPE:
|