flashlight package¶
Submodules¶
flashlight.ahmia module¶
- flashlight.ahmia.get_banned(from_cache=True) list[str]¶
get hash set of banned .onion sites from ahmia.fi.
- Parameters:
from_cache – whether to use cached result or not, defaults to True
- Returns:
hash set of banned .onion sites
- Return type:
list[str]
flashlight.blockchain module¶
- class flashlight.blockchain.BalanceInfo(address: str, confirmed: int, received: int, txs: int, unconfirmed: int, utxo: int)¶
Bases:
objectdata class representing balance information of a bitcoin address.
- address: str¶
- confirmed: int¶
- received: int¶
- txs: int¶
- unconfirmed: int¶
- utxo: int¶
- flashlight.blockchain.get_balance_info(address: str) BalanceInfo¶
get balance info of a bitcoin address.
- Parameters:
address (str) – bitcoin address
- Returns:
balance info of the address
- Return type:
- flashlight.blockchain.get_tx_ids(address: str) set[str]¶
get transaction ids of a bitcoin address.
- Parameters:
address (str) – bitcoin address
- Returns:
set of transaction ids
- Return type:
set[str]
- flashlight.blockchain.get_tx_info(tx_id: str) dict¶
get transaction info by a bitcoin transaction id.
- Parameters:
tx_id (str) – bitcoin transaction id
- Returns:
transaction info
- Return type:
dict
- flashlight.blockchain.get_tx_infos(*tx_id) Iterable[dict]¶
get transaction info by a bitcoin transaction id.
- Parameters:
tx_id – bitcoin transaction id
- Returns:
transaction info
- Return type:
Iterable[dict]
flashlight.checkitonion module¶
- class flashlight.checkitonion.CheckItOnion¶
Bases:
objectclass to scrape checkitonion.online to retrieve top .onion websites.
- HEADERS = {'user-agent': 'Mozilla/5.0'}¶
- URL = 'https://checkitonion.online/'¶
- refresh()¶
refresh the list of top websites from checkitonion.online
- Parameters:
self – The instance of the class.
- property topsites: list[flashlight.checkitonion.Website]¶
get the list of top websites.
- Parameters:
self – The instance of the class.
- Returns:
list of top websites.
- Return type:
list[Website]
flashlight.model module¶
- flashlight.model.is_nsfw(raw: bytes) bool¶
classify an image as NSFW or not.
- Parameters:
raw (bytes) – raw image bytes to be classified
- Returns:
True if the image is classified as NSFW with high confidence, False otherwise
- Return type:
bool
flashlight.scrapper module¶
- flashlight.scrapper.get_image_srcs(url: str) Generator[str, None, None]¶
get image src links from a given url.
- Parameters:
url (str) – target url
- Returns:
generator of image src links
- Return type:
Generator[str, None, None]
- flashlight.scrapper.get_onion_links(html: str) Generator[str, None, None]¶
get .onion links from html content.
- Parameters:
html (str) – html content
- Returns:
generator of .onion links
- Return type:
Generator[str, None, None]
- flashlight.scrapper.traverse_hrefs(start_url: str) Generator[tuple[str, bs4.BeautifulSoup], None, None]¶
traverse href links starting from start_url.
- Parameters:
start_url (str) – starting url
- Returns:
generator of tuples of url and BeautifulSoup object
- Return type:
Generator[tuple[str, BeautifulSoup], None, None]