Rasterio has different ways to access datasets located on disk or at network addresses and datasets located in memory buffers. This document explains the former once again and then introduces the latter for the first time.
To access datasets on disk, give a filesystem path to rasterio.open().
import rasterio
# Open a dataset located in a local file.
with rasterio.open('data/RGB.byte.tif') as dataset: