cse.py
Asyncio API wrapper for the Google Custom Search JSON API.
Installation
PIP
pip install -U cse.py
GIT
pip3 install -U git+https://github.com/Hype3808/cse.py
Usage
import cse
client = cse.Engine("Your API Key") # create the Search client (uses Google by default!)
results = await client.search("Python", safesearch=False) # returns a list of cse.Result objects
print(results[0].title, results[0].description, results[0].url, results[0].image_url) # Title, snippet, URL, and Image URL
await client.close() # Run this when cleaning up.
Getting image results
import cse
client = cse.Engine("Your API Key") # create the Search client (uses Google by default!)
results = await client.search("Python", safesearch=False, image_search=True) # returns a list of cse.Result objects
print(results[0].title, results[0].description, results[0].url, results[0].image_url) # Title, snippet, URL, and Image URL
await client.close() # Run this when cleaning up.
To use Search objects with a custom search engine, provide the ID of the search engine.
cse.Engine("Your API Key", engine_id="015786823554162166929:mywctwj8es4")
SafeSearch can also be turned off by setting safesearch=False when using the search() method.
Getting an API key
You can get an API key by going here and scrolling down to the API key section.
Links
Metadata
Release files for cse.py 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cse.py-1.1.3.tar.gz | 4.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cse.py-1.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.0 kB
Release files / cse.py-1.1.3.tar.gz
| Download URL | cse.py-1.1.3.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9f467e39ed82cef635a1eee2f88079494fe7b981fd16b437e8ced38d7c70efd
|
|
BLAKE2b-256 checksum How to use checksums |
01bddf72fdba3f25afbcf0a25c7ab5319921427cb54f1c94ceec1db365b0cee9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / cse.py-1.1.3-py3-none-any.whl
| Download URL | cse.py-1.1.3-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35fe3e8e6e398e490cf5de3a3f37c97146063394e649a1d94e3d32745f738fe9
|
|
BLAKE2b-256 checksum How to use checksums |
9a3f2ab6de19494dcf5f6be213d3e4338748b25a3d5d0bdeef25bfe0193000a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Security for cse.py 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.