Calibration Utilities#

utils.py modules

ogzaf.utils#

class ogzaf.utils.CustomHttpAdapter(ssl_context=None, **kwargs)[source]#

The UN Data Portal server doesn’t support “RFC 5746 secure renegotiation”. This causes and error when the client is using OpenSSL 3, which enforces that standard by default. The fix is to create a custom SSL context that allows for legacy connections. This defines a function get_legacy_session() that should be used instead of requests().

init_poolmanager(connections, maxsize, block=False)[source]#

Initializes a urllib3 PoolManager.

This method should not be called from user code, and is only exposed for use when subclassing the HTTPAdapter.

Parameters:
  • connections – The number of urllib3 connection pools to cache.

  • maxsize – The maximum number of connections to save in the pool.

  • block – Block when no free connections are available.

  • pool_kwargs – Extra keyword arguments used to initialize the Pool Manager.