Hi Benjamin Mittler,
Here's the code you can use to append to a hosted feature layer from a gdb feature class.
You just need to change/update, add/delete the attributes based on your hosted feature layer and your gdb feature class attributes and change other variables too.
from arcgis import GIS
import pandas as pd
from arcgis.features import GeoAccessor, GeoSeriesAccessor
from arcgis import geometry
from copy import deepcopy
gis = GIS('url', 'username', 'password')
sdf_to_append = pd.DataFrame.spatial.from_featureclass(r"path to gdb feature class")
featureLayer_item = gis.content.search('type: "Feature Service" AND title:"xxxxx"')
feature_layers = featureLayer_item[0].layers
fset = feature_layers[0].query()
features_to_be_added = []
template_hostedFeature = deepcopy(fset.features[0])
for index, row in sdf_to_append.iterrows():
x = sdf_to_append.loc[index]['SHAPE']['x']
y = sdf_to_append.loc[index]['SHAPE']['y']
new_feature = deepcopy(template_hostedFeature)
input_geometry = {'y':float(y), 'x':float(x)}
output_geometry = geometry.project(geometries = [input_geometry],
in_sr = 3857,
out_sr = 3857,
gis = gis)
new_feature.geometry = output_geometry[0]
new_feature.attributes['HoleID'] = row['HoleID']
new_feature.attributes['Project'] = row['Project']
new_feature.attributes['InterFrom'] = row['InterFrom']
new_feature.attributes['InterTo'] = row['InterTo']
new_feature.attributes['Grade'] = row['Grade']
new_feature.attributes['GramMetre'] = row['GramMetre']
new_feature.attributes['RegoProf'] = row['RegoProf']
new_feature.attributes['MidPoint'] = row['MidPoint']
new_feature.attributes['IntercptNo'] = row['IntercptNo']
new_feature.attributes['Overlap'] = row['Overlap']
new_feature.attributes['EndDate'] = row['EndDate']
new_feature.attributes['EAST'] = row['EAST']
new_feature.attributes['NORTH'] = row['NORTH']
new_feature.attributes['RL'] = row['RL']
new_feature.attributes['Width'] = row['Width']
features_to_be_added.append(new_feature)
feature_layers[0].edit_features(adds = features_to_be_added)
print("Hosted feature layer is updated with gdb feature class!")
I hope that's helpful.