To expand on @jotaefe_1980 's instruction, here's an example of how to set the sharing settings in the .sddraft file:
# Read the .sddraft file
docs = DOM.parse(sddraft_output_filename)
key_list = docs.getElementsByTagName('Key')
value_list = docs.getElementsByTagName('Value')
# Change following to "true" to share
SharetoOrganization = "false"
SharetoEveryone = "true"
SharetoGroup = "false"
# If SharetoGroup is set to "true", uncomment line below and provide group IDs
GroupID = "" # GroupID = "f07fab920d71339cb7b1291e3059b7a8, e0fb8fff410b1d7bae1992700567f54a"
# Each key has a corresponding value. In all the cases, value of key_list[i] is value_list[i].
for i in range(key_list.length):
if key_list[i].firstChild.nodeValue == "PackageUnderMyOrg":
value_list[i].firstChild.nodeValue = SharetoOrganization
if key_list[i].firstChild.nodeValue == "PackageIsPublic":
value_list[i].firstChild.nodeValue = SharetoEveryone
if key_list[i].firstChild.nodeValue == "PackageShareGroups":
value_list[i].firstChild.nodeValue = SharetoGroup
if SharetoGroup == "true" and key_list[i].firstChild.nodeValue == "PackageGroupIDs":
value_list[i].firstChild.nodeValue = GroupID
# Write to the .sddraft file
f = open(sddraft_output_filename, 'w')
docs.writexml(f)
f.close()