I'm working in Python with the simple_salesforce library.
I can create new fields on my Account and Contact objects, based on info in How to update object description using simple_salesforce.
Basically, I'm doing the following for each of my new fields:
mdapi = sf.mdapi
custom_object = mdapi.CustomObject.read("Account")
custom_object.fields = [
{"fullName": "my_field__c", "label": "My Field", "type": "Text", "length": 20},
]
mdapi.CustomObject.upsert(custom_object)
This works, except that I need to set the field level security to "visible" manually. How can I do this in my code too?