webtools package¶
Submodules¶
webtools.html_table module¶
webtools.html_table_data module¶
A datastructures that represent an HTML table with cells of variable height.
- class webtools.html_table_data.HTMLTableData(parameters: webtools.html_table_data.Parameters, rows: List[webtools.html_table_data.Row])[source]¶
Bases:
object
- property max_row_height¶
- parameters: Parameters¶
- class webtools.html_table_data.Parameters(headings: Dict[str, webtools.html_table_data.Markdown])[source]¶
Bases:
object
webtools.parallel module¶
Generic parallelization functions using asyncio.
- webtools.parallel.asynchronous(func, inputs, concurrency=4, **kwds)[source]¶
Executes func(task) for every task in tasks.
Parameters¶
func : async funcion(client: aiohttp.ClientSession, *) -> Result tasks : iterable of (unique) input for each function invocation * : constants arguments and keywords to be passed to each function
- webtools.parallel.run(func, items, batch_size, duration, n_threads=2, **kwds)[source]¶
Executes func(i) N x M times. It is assumed that all function invocations are independent.
Parameters¶
func : async funcion(client: aiohttp.ClientSession, *) -> Result items : inputs per function call batch_size : number of function call results that are yielded duration : timeout of the process. This evaluated between batches and not during batches. n_threads : int concurrency : max. number of async connections per thread **kwds : arguments for func. func(**kwds) must be threadsafe batches : iterable of iterables
webtools.parallel_requests module¶
- async webtools.parallel_requests.get(session: ClientSession, i: int, url='', timeout=10, **kwds)[source]¶
webtools.verify_server module¶
- webtools.verify_server.parse_url(url: str, default_scheme='http')[source]¶
Return the scheme, domain, port and path or a url
Parameters¶
The following inputs are supported: - https://example.com - www.example.com:80 - 1.0.0.1:443
Returns¶
- ParseResult(scheme=’http’, netloc=’example.com:443’, path=’/path;parameters’, params=’’,
query=’query’, fragment=’fragment’)
Module contents¶
A collection of web-related tools.
- html_table: Converts Python objects to HTML
- parallel_requests: Load testing
- verify_server: Verify connectivity to a URL