NOSIBLE Python SDK

The NOSIBLE Python SDK provides synchronous access to Search API v2.1 and the NOSIBLE World API from one client.

Installation

pip install "nosible==0.4.0"

Python 3.9 and newer are supported.

Authentication

Create an API key in the NOSIBLE application, then set NOSIBLE_API_KEY:

$Env:NOSIBLE_API_KEY="nos_sk_..."
export NOSIBLE_API_KEY="nos_sk_..."

Search requests use the api-key header. Authenticated World requests use Authorization: Bearer. World version is always credential-free. Search Schema and Markdown delivery requests are public-first and retry once with SDK-managed bearer authentication only when a deployment rejects anonymous access and an API key is configured.

First World query

from nosible import Nosible

with Nosible() as client:
    dates = client.world.dates()
    events = client.world.events(date=dates["dates"][0])

    for event in events:
        print(event.event_id, event.event.get("title"))

The combined endpoint documentation is available at docs.nosible.com.

API reference

nosible.Nosible([nosible_api_key, ...])

High-level synchronous client for NOSIBLE Search and World.

nosible.Result([url, title, description, ...])

One losslessly represented Search result.

nosible.ResultSet([results, message, query])

Ordered, iterable collection of NOSIBLE Search results.

nosible.RichResult([page, snippet, tokens, ...])

One losslessly represented result from Rich Search.

nosible.Search([question, expansions, ...])

Parameters for a NOSIBLE Search request.

nosible.SearchSet([searches_list])

Mutable iterator and collection of Search objects.

nosible.WebPageData([full_text, languages, ...])

Extracted and processed data for one web page.

nosible.Snippet([content, images, language, ...])

A lossless snippet returned by NOSIBLE Search.

nosible.SnippetSet([snippets])

Mutable iterator and collection of snippets.

nosible.WorldClient(transport)

Provide typed synchronous access to the NOSIBLE World API.

nosible.WorldEvent([event_id, version, ...])

A World v1.2 event or a compatible lite projection.

nosible.WorldEventPage(events[, metadata, ...])

Iterable World event page that retains all endpoint metadata.