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.
brave-search-python-client
0.1.4
One-liner (summary)
Description
# 🦁 Brave Search Python Client
[ ](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/main/LICENSE) [](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/main/noxfile.py) [](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/actions/workflows/test-and-report.yml) [](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_brave-search-python-client) [](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_brave-search-python-client) [](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_brave-search-python-client) [](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_brave-search-python-client) [](https://codecov.io/gh/helmut-hoffer-von-ankershoffen/brave-search-python-client) [](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/main/noxfile.py) [](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-clientidge/releases)  [](https://pypi.python.org/pypi/brave-search-python-client) [](https://pypi.python.org/pypi/brave-search-python-client) [](https://hub.docker.com/r/helmuthva/brave-search-python-client/tags) [](https://hub.docker.com/r/helmuthva/brave-search-python-client/) <!--- [](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/pkgs/container/brave-search-python-client) [](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.
- Modern async Python client for Web, Image, Video and News search powered by [Brave Search](https://brave.com/search/api/)
- Various Examples: - [Streamlit App](https://brave-search-python-client.streamlit.app/) deployed on [Streamlit Community Cloud](https://streamlit.io/cloud) - [Jupyter Notebook](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/main/examples/jupyter.ipynb) - [Simple Python Script](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/main/examples/script.py)
- Thorough validation of both [requests](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/blob/main/src/brave_search_python_client/requests.py) and [responses](https://github.com/helmut-hoffer-von-ankershoffen/brave-search-python-client/tree/main/src/brave_search_python_client/responses) (powered by Pydantic)
- [100% test coverage](https://app.codecov.io/gh/helmut-hoffer-von-ankershoffen/brave-search-python-client) including unit and E2E tests (reported on Codecov)
- 100% compliance with modern linting and formatting standards (powered by [Ruff](https://github.com/astral-sh/ruff))
- 100% up-to-date dependencies (monitored by [Renovate](https://github.com/renovatebot/renovate))
- [A-grade code quality](https://sonarcloud.io/summary/new_code?id=helmut-hoffer-von-ankershoffen_brave-search-python-client) in security, maintainability, and reliability (verified by SonarQube)
- 1-liner for installation and execution of command line interface (CLI) via [uv(x)](https://github.com/astral-sh/uv) or [Docker](https://hub.docker.com/r/helmuthva/brave-search-python-client/tags)
- Setup for developing inside a [devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) included (supports VSCode and GitHub Codespaces)
- Later: [MCP server](https://www.anthropic.com/news/model-context-protocol) to connect Brave Search with Claude Desktop and other MCP clients
## Usage
## Streamlit App
[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

[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"")
# 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"")
# Search and render news print("# News") response = await bs.news(NewsSearchRequest(q="AI")) for item in response.results if response.results else []:
print(f"")
# 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
- [API](https://brave.com/search/api/)
- [MCP Specification and SDKs](https://github.com/modelcontextprotocol)
## 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
| 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 |
|
| Slug Id | brave_search_python_client-014-py3-none-anywh-fz5f |
| Unique Id | rrWHAv6piPokYA13 |
| Version (Raw) | 0.1.4 |
| Version (Parsed) |
|
| 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 |
This package has 26 files/directories.
| Newer |
|
brave-search-python-client |
6 |
|
||
| Newer |
|
brave-search-python-client |
4 |
|
||
| Newer |
|
brave-search-python-client |
5 |
|
||
| Newer |
|
brave-search-python-client |
5 |
|
||
| Newer |
|
brave-search-python-client |
5 |
|
||
| Newer |
|
brave-search-python-client |
4 |
|
||
| Newer |
|
brave-search-python-client |
5 |
|
||
| Newer |
|
brave-search-python-client |
4 |
|
||
| Newer |
|
brave-search-python-client |
4 |
|
||
| Newer |
|
brave-search-python-client |
5 |
|
||
|
|
brave-search-python-client |
4 |
|
|||
| Older |
|
brave-search-python-client |
5 |
|
||
| Older |
|
brave-search-python-client |
4 |
|
||
| Older |
|
brave-search-python-client |
5 |
|
||
| Older |
|
brave-search-python-client |
4 |
|
||
| Older |
|
brave-search-python-client |
5 |
|
||
| Older |
|
brave-search-python-client |
4 |
|
||
| Older |
|
brave-search-python-client |
6 |
|
||
| Older |
|
brave-search-python-client |
4 |
|
||
| Older |
|
brave-search-python-client |
5 |
|
Last scanned
4 months, 3 weeks ago
Scan result
Clean
Vulnerability count
0
Max. severity
UnknownPackage statistics are no longer available on cloudsmith.io. Please visit our new web app to access this feature.
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:
[](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:
To embed the badge for the latest package version, use the following:
[](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:
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