Skip to main content

Typed Python client for AnySearch.

Project description

anysearch-py

Typed Python clients for AnySearch.

The package has two first-class clients.

Client calls the REST Web API.

MCPClient calls the MCP tools/call API used by anysearch-skill/.

Both clients share the same Pydantic models, enums, validation, and serialization logic.

Install

uv add anysearch-py

REST Search

from anysearch_py import Client, SearchTag

with Client(api_key="YOUR_ANYSEARCH_API_KEY") as client:
    response = client.search(
        "Go 1.26 release notes",
        tag=SearchTag.CODE_DOC,
        params={"library": "golang"},
    )

print(response.data.results[0].url)

Async REST Search

from anysearch_py import AsyncClient

async with AsyncClient(api_key="YOUR_ANYSEARCH_API_KEY") as client:
    response = await client.search("what is quantum computing")

MCP Tools

from anysearch_py import Domain, MCPClient

with MCPClient(api_key="YOUR_ANYSEARCH_API_KEY") as client:
    markdown = client.get_sub_domains(domains=[Domain.FINANCE, Domain.HEALTH])

print(markdown)

MCP Search

from anysearch_py import Domain, MCPClient

with MCPClient(api_key="YOUR_ANYSEARCH_API_KEY") as client:
    markdown = client.search(
        "AAPL",
        domain=Domain.FINANCE,
        sub_domain="finance.quote",
        sub_domain_params="type=stock,symbol=AAPL,cn_code=",
        max_results=5,
    )

print(markdown)

Live Tests

Live tests read ANYSEARCH_API_KEY from .env or anysearch-skill/.env.

If neither file exists, those tests skip automatically.

Package code never reads .env.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anysearch_py-0.1.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anysearch_py-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file anysearch_py-0.1.0.tar.gz.

File metadata

  • Download URL: anysearch_py-0.1.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anysearch_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 938be98445fa5b4eda7ad75bbc443790a661e712ef6d51d6103a0041727401f4
MD5 c3e06966e7dce252ff843dd8d276615c
BLAKE2b-256 1fdff7ed70e97839a3e1981f992a15a1601d483e73bf873419b71aee87df0055

See more details on using hashes here.

Provenance

The following attestation bundles were made for anysearch_py-0.1.0.tar.gz:

Publisher: release.yml on WH-2099/anysearch-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anysearch_py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: anysearch_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anysearch_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 abcfeeda18374287ac6f0aea089f2e287a15175dac5ecf188af8e278426d6bf4
MD5 c700fac99b716ed0aa7752b33fe17e65
BLAKE2b-256 1c0e906db48530bfafb3aa56aa2ce1667f40f78c60c719422e9d3bdf9a297f87

See more details on using hashes here.

Provenance

The following attestation bundles were made for anysearch_py-0.1.0-py3-none-any.whl:

Publisher: release.yml on WH-2099/anysearch-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page