Source code for polyswarm_api.settings

import os
import platform
import polyswarm_api

# API constants
[docs]DEFAULT_GLOBAL_API = 'https://api.polyswarm.network/v3'
[docs]DEFAULT_COMMUNITY = 'default'
[docs]DEFAULT_SCAN_TIMEOUT = 60*15
[docs]RESULT_CHUNK_SIZE = 100
[docs]POLL_FREQUENCY = 1
# HTTP settings
[docs]DEFAULT_HTTP_TIMEOUT = 30
[docs]DEFAULT_RETRIES = 0
[docs]DEFAULT_BACKOFF = 1
[docs]DEFAULT_RETRY_CODES = (502, 504)
[docs]DEFAULT_USER_AGENT = 'polyswarm-api/{} ({}-{}-{}-{})'.format( polyswarm_api.__version__, platform.machine(), platform.system(), platform.python_implementation(), platform.python_version(),
) # concurrent HTTP workers
[docs]DEFAULT_WORKER_COUNT = 8
# API maximums
[docs]MAX_HUNT_RESULTS = 20000
[docs]MAX_ARTIFACT_BATCH_SIZE = 256
# Filesystem constants
[docs]FILE_CHUNK_SIZE = 8192
[docs]MAX_OPEN_FDS = 256
# this results in worst case 32MB memory usage during downloads
[docs]DOWNLOAD_CHUNK_SIZE = 1024*1024*4
[docs]MAX_SINCE_TIME_STREAM = 2 * 60 * 24