Package Search Help

You can use boolean logic (e.g. AND/OR/NOT) for complex search queries. For more help and examples, see the search documentation.

Search by package name:
my-package (implicit)
name:my-package (explicit)

Search by package filename:
filename:my-package.ext 

Search by package tag:
tag:latest 

Search by package version:
version:1.0.0  prerelease:true (prereleases)
prerelease:false (no prereleases)

Search by package architecture:
architecture:x86_64 

Search by package distribution:
distribution:el 

Search by package license:
license:MIT 

Search by package format:
format:deb 

Search by package status:
status:in_progress 

Search by package file checksum:
checksum:5afba 

Search by package security status:
severity:critical 

Search by package vulnerabilities:
vulnerabilities:>1 
vulnerabilities:<1000 

Search by # of package downloads:
downloads:>8 
downloads:<100 

Search by package type:
type:binary 
type:source 

Search by package size (bytes):
size:>50000 
size:<10000 

Search by dependency name/version:
dependency:log4j 
dependency:log4j=1.0.0 
dependency:log4j>1.0.0 

Search by uploaded date:
uploaded:>"1 day ago" 
uploaded:<"August 14, 2022 EST" 

Search by entitlement token (identifier):
entitlement:3lKPVJPosCsY 

Search by policy violation:
policy_violated:true
deny_policy_violated:true
license_policy_violated:true
vulnerability_policy_violated:true

Search by repository:
repository:repo-name

Search by last download date:
last_downloaded:<"30 days ago" 
last_downloaded:>"August 14, 2022 EST" 

Search queries for all Debian-specific (and related) package types

Search by component:
deb_component:unstable

Search queries for all Maven-specific (and related) package types

Search by group ID:
maven_group_id:org.apache

Search queries for all Docker-specific (and related) package types

Search by image digest:
docker_image_digest:sha256:7c5..6d4
(full hashref only)

Search by layer digest:
docker_layer_digest:sha256:4c4..ae4
(full hashref only)

Search queries for all Generic-specific package types

Search by file path:
generic_filepath:path/to/file.txt

Search by directory:
generic_directory:path/to

Field type modifiers (depending on the type, you can influence behaviour)

For all queries, you can use:
~foo for negation

For string queries, you can use:
^foo to anchor to start of term
foo$ to anchor to end of term
foo*bar for fuzzy matching

For number/date or version queries, you can use:
>foo for values greater than
>=foo for values greater / equal
<foo for values less than
<=foo for values less / equal

Need a secure and centralised artifact repository to deliver Alpine, Cargo, CocoaPods, Composer, Conan, Conda, CRAN, Dart, Debian, Docker, Generic, Go, Helm, Hex, HuggingFace, LuaRocks, Maven, npm, NuGet, P2, Python, RedHat, Ruby, Swift, Terraform, Vagrant, VSX, Raw & More packages?

Cloudsmith is the new standard in Package / Artifact Management and Software Distribution.

With support for all major package formats, you can trust us to manage your software supply chain.

Start My Free Trial

Python logo brave-search-python-client  0.1.4

One-liner (summary)

🦁 Brave Search Python Client supporting Web, Image, News and Video search.

Description

# 🦁 Brave Search Python Client

[![License](https://img.shields.io/github/license/helmut-hoffer-von-ankershoffen/brave-search-python-client?logo=opensourceinitiative&logoColor=3DA639&labelColor=414042&color=A41831) ](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/main/LICENSE) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/brave-search-python-client.svg?logo=python&color=204361&labelColor=1E2933)](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/main/noxfile.py) [![CI](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/actions/workflows/test-and-report.yml/badge.svg)](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/actions/workflows/test-and-report.yml) [![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=helmut-hoffer-von-ankershoffen_brave-search-python-client&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_brave-search-python-client) [![Security](https://sonarcloud.io/api/project_badges/measure?project=helmut-hoffer-von-ankershoffen_brave-search-python-client&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_brave-search-python-client) [![Maintainability](https://sonarcloud.io/api/project_badges/measure?project=helmut-hoffer-von-ankershoffen_brave-search-python-client&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_brave-search-python-client) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=helmut-hoffer-von-ankershoffen_brave-search-python-client&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_brave-search-python-client) [![Coverage](https://codecov.io/gh/helmut-hoffer-von-ankershoffen/brave-search-python-client/graph/badge.svg?token=SX34YRP30E)](https://codecov.io/gh/helmut-hoffer-von-ankershoffen/brave-search-python-client) [![Ruff](https://img.shields.io/badge/style-Ruff-blue?color=D6FF65)](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/main/noxfile.py) [![GitHub - Version](https://img.shields.io/github/v/release/helmut-hoffer-von-ankershoffen/brave-search-python-client?label=GitHub&style=flat&labelColor=1C2C2E&color=blue&logo=GitHub&logoColor=white)](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-clientidge/releases) ![GitHub - Commits](https://img.shields.io/github/commit-activity/m/helmut-hoffer-von-ankershoffen/brave-search-python-client/main?label=commits&style=flat&labelColor=1C2C2E&color=blue&logo=GitHub&logoColor=white) [![PyPI - Version](https://img.shields.io/pypi/v/brave-search-python-client.svg?label=PyPI&logo=pypi&logoColor=%23FFD243&labelColor=%230073B7&color=FDFDFD)](https://pypi.python.org/pypi/brave-search-python-client) [![PyPI - Status](https://img.shields.io/pypi/status/brave-search-python-client?logo=pypi&logoColor=%23FFD243&labelColor=%230073B7&color=FDFDFD)](https://pypi.python.org/pypi/brave-search-python-client) [![Docker - Version](https://img.shields.io/docker/v/helmuthva/brave-search-python-client?sort=semver&label=Docker&logo=docker&logoColor=white&labelColor=1354D4&color=10151B)](https://hub.docker.com/r/helmuthva/brave-search-python-client/tags) [![Docker - Size](https://img.shields.io/docker/image-size/helmuthva/brave-search-python-client?sort=semver&arch=arm64&label=image&logo=docker&logoColor=white&labelColor=1354D4&color=10151B)](https://hub.docker.com/r/helmuthva/brave-search-python-client/) <!--- [![ghcr.io - Version](https://ghcr-badge.egpl.dev/helmut-hoffer-von-ankershoffen/brave-search-python-client/tags?color=%2344cc11&ignore=0.0%2C0%2Clatest&n=3&label=ghcr.io&trim=)](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/pkgs/container/brave-search-python-client) [![ghcr.io - Sze](https://ghcr-badge.egpl.dev/helmut-hoffer-von-ankershoffen/brave-search-python-client/size?color=%2344cc11&tag=latest&label=size&trim=)](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/pkgs/container/brave-search-python-client) -->

## Overview

Brave Search Python Client supporting Web, Image, News and Video search.

## Usage

## Streamlit App

![Watch it](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/7f2a3a2e306c81c3487c0b0eda067f0440ec3f36/examples/streamlit.gif)

[Try it out!](https://brave-search-python-client.streamlit.app) - [Show the code](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/main/examples/streamlit.py)

## Jupyter Notebook

![Jupyter Notebook](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/7f2a3a2e306c81c3487c0b0eda067f0440ec3f36/examples/jupyter.png)

[Show the code](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/main/examples/jupyter.ipynb)

### Minimal Python Script:

```python import asyncio import json import os

from dotenv import load_dotenv

from brave_search_python_client import (
BraveSearch, CountryCode, ImagesSearchRequest, LanguageCode, NewsSearchRequest, VideosSearchRequest, WebSearchRequest,

)

# Load .env file and check for Brave Search API Key load_dotenv() api_key = os.getenv("BRAVE_SEARCH_API_KEY") if not api_key:

raise Exception("BRAVE_SEARCH_API_KEY found in environment")
async def search():

"""Run various searches using the Brave Search Python Client"""

# Initialize the BraveSearch client, using the API key from the environment bs = BraveSearch()

# Perform a web search response = await bs.web(WebSearchRequest(q="jupyter"))

# Print results as JSON print("# Web search") print("## JSON response") print(json.dumps(response.model_dump(), indent=2))

# Iterate over web hits and render links in markdown print("## Iterate and render") for result in response.web.results if response.web else []:

print(f"[{result.title}]({result.url})")

# Advanced search with parameters response = await bs.web(

WebSearchRequest(
q="python programming", country=CountryCode.DE, search_lang=LanguageCode.DE,

)

)

print("# Advanced search results") for result in response.web.results if response.web else []:

print(f"[{result.title}]({result.url})")

# Search and render images print("# Images") response = await bs.images(ImagesSearchRequest(q="cute cats")) for image in response.results if response.results else []:

print(f"![{image.source}]({image.url})")

# Search and render videos print("# Videos") response = await bs.videos(VideosSearchRequest(q="singularity is close")) for video in response.results if response.results else []:

print(f"![{video.title}]({video.url})")

# Search and render news print("# News") response = await bs.news(NewsSearchRequest(q="AI")) for item in response.results if response.results else []:

print(f"![{item.title}]({item.url})")

# Execute the search function # Alternatively use await(search()) in an async function asyncio.run(search()) ```

[Show the code](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/main/examples/script.py)

## Command Line Interface (CLI)

### Run with uvx

Create .env file with API key:

`shell ./setup--dot-env YOUR_BRAVE_SEARCH_API_KEY `

Show available commands:

`shell uvx brave-search-python-client --help `

Search the web for "hello world":

`shell uvx brave-search-python-client web "hello world" `

Show options for web search

`shell uvx brave-search-python-client web --help `

Search images:

`shell uvx brave-search-python-client images "hello world" `

Show options for image search

`shell uvx brave-search-python-client images --help `

Search videos:

`shell uvx brave-search-python-client videos "hello world" `

Show options for videos search

`shell uvx brave-search-python-client videos --help `

Search news:

`shell uvx brave-search-python-client news "hello world" `

Show options for news search

`shell uvx brave-search-python-client news --help `

### Run with Docker

Show options for news search

`shell docker run helmuthva/brave-search-python-client news --help `

### Docker

Note: Replace YOUR_BRAVE_SEARCH_API_KEY with your API key in the following examples.

Show available commands:

`bash docker run helmuthva/brave-search-python-client --help `

Search the web:

`bash docker run --env BRAVE_SEARCH_API_KEY=YOUR_BRAVE_SEARCH_API_KEY helmuthva/brave-search-python-client web "hello world" `

Show options for web search

`bash docker run helmuthva/brave-search-python-client web --help `

Search images:

`bash docker run --env BRAVE_SEARCH_API_KEY=YOUR_BRAVE_SEARCH_API_KEY helmuthva/brave-search-python-client images "hello world" `

Show options for image search

`bash docker run helmuthva/brave-search-python-client images --help `

Search videos:

`bash docker run --env BRAVE_SEARCH_API_KEY=YOUR_BRAVE_SEARCH_API_KEY helmuthva/brave-search-python-client videos "hello world" `

Show options for video search

`bash docker run helmuthva/brave-search-python-client videos --help `

Search news:

`bash docker run --env BRAVE_SEARCH_API_KEY=YOUR_BRAVE_SEARCH_API_KEY helmuthva/brave-search-python-client news "hello world" `

Show options for news search

`bash docker run helmuthva/brave-search-python-client news --help `

## Extra: MCP Server

TK

## Contributing

Please read our [Contributing Guidelines](CONTRIBUTING.md) for how to setup your development environment, and guidance for making pull requests.

## Resources

## Star History

<a href="https://star-history.com/#helmut-hoffer-von-ankershoffen/brave-search-python-client&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=helmut-hoffer-von-ankershoffen/brave-search-python-client&type=Date&theme=dark" /> <source media="(prefers-color-scheme: lig

Size

63.5 KB

Downloads

4

Status  Completed
Checksum (MD5) 2b118bdd9ca974834046943df7393f9f
Checksum (SHA-1) df1fbe301b0807d41e577ddd277090bc2b073049
Checksum (SHA-256) 751e2ddedabc99fc2e0ff5bee6a5a9fb5d35dc7d6ab9d61b227dda752f79fdbf
Checksum (SHA-512) 8dfbf1cd778956e6b079252f10f380860e777da28ba3f2d73d8a6ae361b2d484b8…
GPG Signature
GPG Fingerprint 6811684bac0b8895434e97bdd4391b8fb999e537
Storage Region  Dublin, Ireland
Type  Binary (contains binaries and binary artifacts)
Uploaded At 4 months, 3 weeks ago
Uploaded By Fetched by Cloudsmith
Slug Id brave_search_python_client-014-py3-none-anywh-fz5f
Unique Id rrWHAv6piPokYA13
Version (Raw) 0.1.4
Version (Parsed)
  • Major: 0
  • Minor: 1
  • Patch: 4
  • Type: SemVer (Compat)
  extended metadata
Author Helmut Hoffer von Ankershoffen <helmuthva@googlemail.com>
Classifiers Development Status :: 3 - Alpha | Framework :: AsyncIO | Framework :: Pydantic | Framework :: Pytest | Intended Audience :: Developers | Intended Audience :: End Users/Desktop | License :: OSI Approved :: MIT License | Natural Language :: English | Operating System :: MacOS :: MacOS X | Operating System :: Microsoft :: Windows | Operating System :: POSIX :: Linux | Programming Language :: Python | Programming Language :: Python :: 3 | Programming Language :: Python :: 3.11 | Programming Language :: Python :: 3.12 | Programming Language :: Python :: 3.13 | Typing :: Typed
Keywords api,async,brave,bravesearch,bravesearchapi,codecov,docker,pydantic,python,ruff,search,sonarqube,typer,uv
Metadata Version 2.4
Project Urls Changelog, https://github.com/helmut-hoffer-von-ankershoffen/brave-search-pytho… | Documentation, https://helmuthva.gitbook.io/brave-search-python-client | Homepage, https://helmuthva.gitbook.io/brave-search-api-client | Issues, https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-c… | Source, https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-c…
Py Filetype bdist_wheel
Py Version py3
Requires Dist bump-my-version>=0.29.0; extra == 'dev' | cyclonedx-py>=1.0.1; extra == 'dev' | detect-secrets>=1.5.0; extra == 'dev' | git-cliff>=2.7.0; extra == 'dev' | httpx>=0.28.1 | jupyter>=1.1.1; extra == 'examples' | nox>=2024.10.9; extra == 'dev' | pip-audit>=2.7.3; extra == 'dev' | pip-licenses>=5.0.0; extra == 'dev' | pre-commit>=4.0.1; extra == 'dev' | pydantic>=2.5.2 | pyright>=1.1.391; extra == 'dev' | pytest-asyncio>=0.25.0; extra == 'dev' | pytest-cov>=6.0.0; extra == 'dev' | pytest-docker>=3.1.1; extra == 'dev' | pytest-env>=1.1.5; extra == 'dev' | pytest-xdist[psutil]>=3.6.1; extra == 'dev' | pytest>=8.3.4; extra == 'dev' | python-dotenv>=1.0.1 | ruff>=0.8.4; extra == 'dev' | streamlit>=1.41.1 | tenacity>=9.0.0 | tomli>=2.1.0; extra == 'dev' | typer>=0.15.1
Requires Python <4.0,>=3.11
pkg brave_search_python_client-0.1.… 4
63.5 KB
md5 sha1 sha256 sha512
Package Contents (brave_search_python_client-0.1.4-py3-none-any.whl)
Loading...

This package has 26 files/directories.

 Newer Python logo
brave-search-python-client
 0.4.15
6 Fetched by Cloudsmith
 Newer Python logo
brave-search-python-client
 0.4.14
4 Fetched by Cloudsmith
 Newer Python logo
brave-search-python-client
 0.4.13
5 Fetched by Cloudsmith
 Newer Python logo
brave-search-python-client
 0.4.12
5 Fetched by Cloudsmith
 Newer Python logo
brave-search-python-client
 0.4.11
5 Fetched by Cloudsmith
 Newer Python logo
brave-search-python-client
 0.4.10
4 Fetched by Cloudsmith
 Newer Python logo
brave-search-python-client
 0.4.9
5 Fetched by Cloudsmith
 Newer Python logo
brave-search-python-client
 0.4.8
4 Fetched by Cloudsmith
 Newer Python logo
brave-search-python-client
 0.4.7
4 Fetched by Cloudsmith
 Newer Python logo
brave-search-python-client
 0.4.6
5 Fetched by Cloudsmith
  Python logo
brave-search-python-client
 0.1.4
4 Fetched by Cloudsmith
 Older Python logo
brave-search-python-client
 0.1.3
5 Fetched by Cloudsmith
 Older Python logo
brave-search-python-client
 0.1.2
4 Fetched by Cloudsmith
 Older Python logo
brave-search-python-client
 0.1.1
5 Fetched by Cloudsmith
 Older Python logo
brave-search-python-client
 0.1.0
4 Fetched by Cloudsmith
 Older Python logo
brave-search-python-client
 0.0.12
5 Fetched by Cloudsmith
 Older Python logo
brave-search-python-client
 0.0.11
4 Fetched by Cloudsmith
 Older Python logo
brave-search-python-client
 0.0.10
6 Fetched by Cloudsmith
 Older Python logo
brave-search-python-client
 0.0.9
4 Fetched by Cloudsmith
 Older Python logo
brave-search-python-client
 0.0.8
5 Fetched by Cloudsmith

Last scanned

4 months, 3 weeks ago

Scan result

Clean

Vulnerability count

0

Max. severity

Unknown

You can embed a badge in another website that shows this or the latest version of this package.

To embed the badge for this specific package version, use the following:

[![This version of 'brave-search-python-client' @ Cloudsmith](https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/brave-search-python-client/0.1.4/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/?render=true)](https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/brave-search-python-client/0.1.4/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/)
|This version of 'brave-search-python-client' @ Cloudsmith|
.. |This version of 'brave-search-python-client' @ Cloudsmith| image:: https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/brave-search-python-client/0.1.4/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/?render=true
   :target: https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/brave-search-python-client/0.1.4/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/
image::https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/brave-search-python-client/0.1.4/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/?render=true[link="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/brave-search-python-client/0.1.4/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/",title="This version of 'brave-search-python-client' @ Cloudsmith"]
<a href="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/brave-search-python-client/0.1.4/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/"><img src="https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/brave-search-python-client/0.1.4/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/?render=true" alt="This version of 'brave-search-python-client' @ Cloudsmith" /></a>

rendered as: This version of 'brave-search-python-client' @ Cloudsmith

To embed the badge for the latest package version, use the following:

[![Latest version of 'brave-search-python-client' @ Cloudsmith](https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/brave-search-python-client/latest/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/?render=true&show_latest=true)](https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/brave-search-python-client/latest/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/)
|Latest version of 'brave-search-python-client' @ Cloudsmith|
.. |Latest version of 'brave-search-python-client' @ Cloudsmith| image:: https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/brave-search-python-client/latest/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/?render=true&show_latest=true
   :target: https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/brave-search-python-client/latest/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/
image::https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/brave-search-python-client/latest/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/?render=true&show_latest=true[link="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/brave-search-python-client/latest/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/",title="Latest version of 'brave-search-python-client' @ Cloudsmith"]
<a href="https://cloudsmith.io/~demo-docs/repos/awesome-repo/packages/detail/python/brave-search-python-client/latest/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/"><img src="https://api.cloudsmith.com/v1/badges/version/demo-docs/awesome-repo/python/brave-search-python-client/latest/a=noarch;xf=bdist_wheel;xn=brave-search-python-client;xv=py3/?render=true&show_latest=true" alt="Latest version of 'brave-search-python-client' @ Cloudsmith" /></a>

rendered as: Latest version of 'brave-search-python-client' @ Cloudsmith

These instructions assume you have setup the repository first (or read it).

To install/use brave-search-python-client @ version 0.1.4 ...

pip install 'brave-search-python-client==0.1.4'

You can also install the latest version of this package:

pip install --upgrade 'brave-search-python-client'

If necessary, you can specify the repository directly:

pip install \
  --index-url=https://dl.cloudsmith.io/public/demo-docs/awesome-repo/python/simple/ \
  brave-search-python-client==0.1.4

If you've got a project requirements.txt file, you can specify this as a dependency:

--index-url=https://dl.cloudsmith.io/public/demo-docs/awesome-repo/python/simple/
brave-search-python-client==0.1.4

In addition, you can use this repository as an extra index url. However, please read our documentation on this parameter before using it. For example in a requirements.txt file:

--extra-index-url=https://dl.cloudsmith.io/public/demo-docs/awesome-repo/python/simple/
brave-search-python-client==0.1.4
Warning: We highly recommend using pip (or similar) rather than installing directly.
Top