Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/deedy5/ddgs
/ functions
Functions
277 in github.com/deedy5/ddgs
⨍
Functions
277
◇
Types & classes
55
↳
Endpoints
28
↓ 55 callers
Method
get
Get cached results if not expired.
ddgs/dht/cache.py:96
↓ 27 callers
Method
append
Add an item to the cache. Register an occurrence of `item`. First time we see its key, we store the item; every time we bump the coun
ddgs/results.py:128
↓ 16 callers
Function
_expand_proxy_tb_alias
Expand "tb" to a full proxy URL if applicable.
ddgs/utils.py:68
↓ 12 callers
Function
_get_ddgs
Create a DDGS instance with proxy configuration from environment.
ddgs/api_server/api.py:39
↓ 12 callers
Method
astart
Async wrapper for start() for backwards compatibility. Args: timeout: Maximum time to wait for service to start. Returns
ddgs/dht/libp2p_client.py:390
↓ 11 callers
Method
astop
Async wrapper for stop() for backwards compatibility. Args: timeout: Maximum time to wait for service to stop.
ddgs/dht/libp2p_client.py:783
↓ 9 callers
Function
get_dht_service
Get the global DHT service instance. Returns: DhtService singleton.
ddgs/api_server/dht_service.py:261
↓ 9 callers
Method
set
Store results with TTL and enforce max size.
ddgs/dht/cache.py:122
↓ 8 callers
Function
compute_query_hash
Compute a normalized hash for a query. Normalization: - Strip whitespace - Lowercase - Sort words alphabetically for deterministic ke
ddgs/dht/types.py:44
↓ 8 callers
Method
set
Store results in the DHT. Args: key: The cache key (query hash). results: The search results to cache. tt
ddgs/dht/libp2p_client.py:573
↓ 7 callers
Method
extract
Fetch a URL and extract its content. Args: url: The URL to fetch and extract content from. fmt: Output format: "text_
ddgs/ddgs.py:476
↓ 7 callers
Method
request
Make a request to the search engine.
ddgs/base.py:65
↓ 7 callers
Method
start
Start the DHT client. Returns: True if DHT connection successful.
ddgs/dht/__init__.py:90
↓ 7 callers
Method
text
Perform a text search.
ddgs/ddgs.py:456
↓ 6 callers
Function
_save_data
(query: str, data: list[dict[str, str]], function_name: str, filename: str | None)
ddgs/cli.py:51
↓ 6 callers
Method
images
Perform an image search.
ddgs/ddgs.py:460
↓ 5 callers
Function
_print_data
(data: list[dict[str, str]], *, no_color: bool = False)
ddgs/cli.py:74
↓ 5 callers
Function
_sanitize_query
(query: str)
ddgs/cli.py:101
↓ 5 callers
Method
_search_sync
Perform a search across engines in the given category. Args: category: The category of search engines (e.g., 'text', 'images', et
ddgs/ddgs.py:351
↓ 5 callers
Method
books
Perform a book search.
ddgs/ddgs.py:472
↓ 5 callers
Method
count
Get total number of cached entries.
ddgs/dht/cache.py:179
↓ 5 callers
Method
get_cached
Get cached results for a query. Checks local cache first, then DHT DHT (or REST API). Args: query: The search query.
ddgs/dht/__init__.py:137
↓ 5 callers
Method
news
Perform a news search.
ddgs/ddgs.py:464
↓ 5 callers
Function
normalize_query
Normalize query for display/storage. Args: query: The search query. Returns: Normalized query string.
ddgs/dht/types.py:68
↓ 5 callers
Method
videos
Perform a video search.
ddgs/ddgs.py:468
↓ 4 callers
Method
__setattr__
Override setattr to apply normalization functions to certain attributes.
ddgs/results.py:30
↓ 4 callers
Function
_download_results
( query: str, results: list[dict[str, str]], function_name: str, proxy: str | None = None,
ddgs/cli.py:127
↓ 4 callers
Method
_run_in_trio
Run an async function in the Trio event loop from another thread.
ddgs/dht/libp2p_client.py:500
↓ 4 callers
Method
aget
Async wrapper for get() for backwards compatibility. Args: key: The cache key (query hash). timeout: Timeout in secon
ddgs/dht/libp2p_client.py:631
↓ 4 callers
Method
aset
Async wrapper for set() for backwards compatibility. Args: key: The cache key (query hash). results: The search resul
ddgs/dht/libp2p_client.py:644
↓ 4 callers
Method
cache
Cache search results locally and on DHT. Args: query: The search query. results: The search results. cate
ddgs/dht/__init__.py:182
↓ 4 callers
Method
get
Get cached results from the DHT. Args: key: The cache key (query hash). timeout: Timeout in seconds for DHT query.
ddgs/dht/libp2p_client.py:522
↓ 3 callers
Function
_extract_vqd
Extract vqd from html bytes.
ddgs/utils.py:15
↓ 3 callers
Method
_load_real
(cls)
ddgs/__init__.py:27
↓ 3 callers
Method
_run_in_trio
Run an async function in the Trio event loop from another thread.
ddgs/api_server/dht_service.py:116
↓ 3 callers
Method
aconnect_peer
Async wrapper for connect_peer() for backwards compatibility. Args: peer_addr: The multiaddress of the peer to connect to.
ddgs/dht/libp2p_client.py:488
↓ 3 callers
Method
add_negative
Add an entry to the negative cache (no results found).
ddgs/dht/cache.py:192
↓ 3 callers
Method
afind_peers
Async wrapper for find_peers() for backwards compatibility. Returns: List of peer addresses.
ddgs/dht/libp2p_client.py:713
↓ 3 callers
Method
delete
Delete a cached result.
ddgs/dht/cache.py:160
↓ 3 callers
Method
extend
Add a list of items to the cache.
ddgs/results.py:141
↓ 3 callers
Method
extract_tree
Extract html tree from html text.
ddgs/base.py:77
↓ 3 callers
Method
size_bytes
Get database size in bytes.
ddgs/dht/cache.py:188
↓ 3 callers
Method
stop
Stop the DHT client.
ddgs/dht/__init__.py:250
↓ 2 callers
Function
_get_async_loop
Get or create shared async loop running in dedicated thread.
ddgs/ddgs.py:104
↓ 2 callers
Function
_get_http_client
Get or create the shared primp HTTP client.
ddgs/ddgs.py:96
↓ 2 callers
Method
_get_network_client
Get the network client for caching. Returns: DhtClient instance if available, None otherwise.
ddgs/ddgs.py:256
↓ 2 callers
Method
_has_any_token
Check if any token is a substring of the lower-cased text.
ddgs/similarity.py:28
↓ 2 callers
Method
_hashes
Generate hash positions for a key using SHA-256 for consistency.
ddgs/dht/cache.py:29
↓ 2 callers
Function
_save_csv
(csvfile: str | Path, data: list[dict[str, str]])
ddgs/cli.py:65
↓ 2 callers
Function
_save_json
(jsonfile: str | Path, data: list[dict[str, str]])
ddgs/cli.py:60
↓ 2 callers
Method
add
Add a key to the filter.
ddgs/dht/cache.py:41
↓ 2 callers
Method
get_neighbors
Get all peers from routing table with complete metadata. Returns: List of peer dictionaries with metadata.
ddgs/dht/libp2p_client.py:689
↓ 2 callers
Method
get_status
Get DHT service status. Returns: Dict with status information.
ddgs/api_server/dht_service.py:187
↓ 2 callers
Method
request
Make a request to the HTTP client.
ddgs/http_client2.py:64
↓ 2 callers
Method
request
Make a request to the HTTP client.
ddgs/http_client.py:62
↓ 2 callers
Method
search
Search the engine.
ddgs/base.py:103
↓ 1 callers
Method
_cache_results_async
Cache search results asynchronously.
ddgs/ddgs.py:265
↓ 1 callers
Method
_connect_bootstrap
Connect to bootstrap nodes.
ddgs/dht/libp2p_client.py:437
↓ 1 callers
Method
_create_host
Create a host with Mplex muxer (default security includes Noise).
ddgs/dht/libp2p_client.py:184
↓ 1 callers
Method
_ensure_network_running
Ensure the network service is running. If not running, spawn a new ddgs api process only if spawn_api is True.
ddgs/ddgs.py:181
↓ 1 callers
Method
_extract_tokens
Split on non-word characters & filter out short tokens.
ddgs/similarity.py:24
↓ 1 callers
Function
_get_cache_executor
Get shared thread pool executor for background cache operations.
ddgs/ddgs.py:87
↓ 1 callers
Method
_get_engines
Retrieve a list of search engine instances for a given category and backend. Args: category: The category of search engines (e.g.
ddgs/ddgs.py:288
↓ 1 callers
Method
_get_from_api
Get cached results from API.
ddgs/dht/__init__.py:116
↓ 1 callers
Method
_get_key
(self, item: T)
ddgs/results.py:117
↓ 1 callers
Function
_get_random_ssl_context
(*, verify: bool | str)
ddgs/http_client2.py:102
↓ 1 callers
Method
_get_vqd
Get vqd value for a search query using DuckDuckGo.
ddgs/engines/duckduckgo_videos.py:38
↓ 1 callers
Method
_get_vqd
Get vqd value for a search query using DuckDuckGo.
ddgs/engines/duckduckgo_news.py:31
↓ 1 callers
Method
_get_vqd
Get vqd value for a search query using DuckDuckGo.
ddgs/engines/duckduckgo_images.py:42
↓ 1 callers
Method
_init_db
(self, conn: sqlite3.Connection)
ddgs/dht/cache.py:72
↓ 1 callers
Method
_parse_results
Parse JSON results safely.
ddgs/dht/cache.py:89
↓ 1 callers
Function
_resolve_dnsaddr
Resolve /dnsaddr/ multiaddrs into concrete addresses using DNS TXT records. Follows libp2p dnsaddr specification: - Queries TXT records at _d
ddgs/dht/libp2p_client.py:39
↓ 1 callers
Method
_run_main_loop
Run main DHT event loop.
ddgs/dht/libp2p_client.py:287
↓ 1 callers
Method
_setup_dht
Set up DHT instance with validator.
ddgs/dht/libp2p_client.py:250
↓ 1 callers
Method
_setup_relay
Set up Circuit Relay v2 for NAT traversal.
ddgs/dht/libp2p_client.py:402
↓ 1 callers
Method
build_payload
Build a payload for the search request.
ddgs/base.py:53
↓ 1 callers
Method
cache
Cache search results synchronously (for use from FastAPI). Args: query: The search query. results: The search results
ddgs/api_server/dht_service.py:163
↓ 1 callers
Function
cli
DDGS CLI tool.
ddgs/cli.py:162
↓ 1 callers
Function
extract_date
Extract date from string.
ddgs/engines/bing_news.py:15
↓ 1 callers
Function
extract_date
Extract date from string.
ddgs/engines/yahoo_news.py:26
↓ 1 callers
Method
extract_dicts
Return a list of items, sorted by descending frequency. Each item is returned as a dict.
ddgs/results.py:146
↓ 1 callers
Function
extract_image
Sanitize image url.
ddgs/engines/yahoo_news.py:46
↓ 1 callers
Method
extract_results
Extract search results from html text.
ddgs/base.py:85
↓ 1 callers
Function
extract_source
Remove ' via Yahoo' from string.
ddgs/engines/yahoo_news.py:52
↓ 1 callers
Function
extract_url
Sanitize url.
ddgs/engines/yahoo.py:12
↓ 1 callers
Function
extract_url
Sanitize url.
ddgs/engines/yahoo_news.py:40
↓ 1 callers
Method
find_peers
Find other peers in the network. Returns: List of peer addresses.
ddgs/dht/libp2p_client.py:666
↓ 1 callers
Method
get
Make a GET request to the HTTP client.
ddgs/http_client.py:73
↓ 1 callers
Method
get_cached
Get cached results synchronously (for use from FastAPI). Args: query: The search query. category: The search category
ddgs/api_server/dht_service.py:127
↓ 1 callers
Method
get_peers
Get list of connected peers. Returns: List of peer IDs.
ddgs/api_server/dht_service.py:223
↓ 1 callers
Method
get_sc
Get sc param.
ddgs/engines/startpage.py:31
↓ 1 callers
Function
get_ua
Return one random Android Google App User-Agent string.
ddgs/engines/google.py:13
↓ 1 callers
Method
invalidate
Invalidate cached results for a query. Args: query: The search query. category: The search category.
ddgs/dht/__init__.py:224
↓ 1 callers
Method
is_running
Check if the client is running.
ddgs/dht/libp2p_client.py:723
↓ 1 callers
Method
post
Make a POST request to the HTTP client.
ddgs/http_client.py:77
↓ 1 callers
Method
post_extract_results
Post-process search results.
ddgs/base.py:99
↓ 1 callers
Method
pre_process_html
Pre-process html_text before extracting results.
ddgs/base.py:81
↓ 1 callers
Method
pre_process_html
Pre-process the HTML text before parsing it.
ddgs/engines/annasarchive.py:45
↓ 1 callers
Method
rank
Rank a list of docs based on a query string.
ddgs/similarity.py:33
↓ 1 callers
Method
result_type
Get result type based on category.
ddgs/base.py:41
next →
1–100 of 277, ranked by callers