In order to use FastPortScanner read the following snippet

Follow the example to get list of hosts:

import asyncio
from asyncio_fast_portscanner.asyncio_fast_portscanner import FastPortScanner
loop = asyncio.get_event_loop() # Get event loop, when you are already
                                # in async function you can await awaitables
                                # instead of run_until_complete

scanner = FastPortScanner(timeout, verbose) # timeout is
                                            # max time of task to execute
result = loop.run_until_complete(scanner.loadHostListByCidr(range))
# Loading host list by CIDR accepts hosts in format
result = loop.run_until_complete(scanner.loadHostListByRange(range))
# Loads port ranges - for example
if not result[0]:
# Loading hosts return tuple of bool, str - result and reason if False

result = loop.run_until_complete(scanner.loadPortList(ports))
# Accepts collection of ints - like 22, 8080
if not result[0]:

results = loop.run_until_complete(scanner.gatherResults())
# In results you will have dicts of "host", "port", "status"