I am trying to create a Python code that batch uploads shapefiles (from compressed folders stored on a local file location) to ArcGIS Online. The only way I know how to do this is using the .publish() method, which creates a hosted feature layer. Is there a method for uploading non-hosted shapefiles, or some sort of workaround? I'm looking for the equivalent of when you go into ArcGIS Online > Content > Add Item and upload a shapefile.
I've used Publishing SDs, Shapefiles and CSVs | ArcGIS for Developers as a reference, but it only utilizes the .publish() method.
I have a lot of shapefiles to upload, so I do not want to do it one-by-one using ArcGIS Online because that would be too time-consuming.