I would like to automate sales force package installation using python. In my day to day activity i have been spending more time in this scenario. It will be of great help if some one can throw some pointers related to this.

Thanks, Balaji.

  • It would help if you could be a little more specific with your question.
    – martin
    Commented Dec 11, 2015 at 5:38
  • I need to install managed package to salesforce org so that i can use my product for testing. Usually i will end in installing more than 3 managed package and i have all the url for the packages in an excel. Now i want to write a python script which will read the excel and install package one by one by providing access to all user while installing the package. Hope this provide some overview of my requirement: @martin Commented Dec 11, 2015 at 5:57
  • Have you heard of the Force.com Migration Tool? That would give you a pretty easy way to install managed packages programatically.
    – martin
    Commented Dec 11, 2015 at 6:07
  • If you haven't used Ant before, there would be some set up time / learning curve involved in using the Migration Tool. If you don't want to spend time learning the existing tool, using python to build into the Metadata API should also work for you.
    – martin
    Commented Dec 11, 2015 at 6:12
  • Great thoughts...@martin, can we install packages from appExchange using ANT? I am not so sure about the idea...
    – ipradhansk
    Commented Dec 11, 2015 at 6:40

1 Answer 1


It is possible to install managed packages from the appExchange using the metadata api / ant. If you want to test it out, you can try deploying this to one of your orgs: (installs Quote of the Day)


<project name="Sample usage of Salesforce Ant tasks" default="test" basedir="." xmlns:sf="antlib:com.salesforce">
<property file="build.properties"/>
<property environment="env"/>

<target name="installQuoteOfTheDay">
    <sf:deploy username="${sf.username}" password="${sf.password}" serverurl="${sf.serverurl}" maxPoll="${sf.maxPoll}" deployRoot="dirName"/>



<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">


<?xml version="1.0" encoding="UTF-8"?>
<InstalledPackage xmlns="http://soap.sforce.com/2006/04/metadata">

Of course you could also develop a tool using python to perform the deployment through the Metadata API if you don't want to use the Ant Migration Tool.

To install your managed package, you would just have to replace QOTD (Quote of the Day's namespace) with your package's namespace.

  • great @martin :)
    – ipradhansk
    Commented Dec 11, 2015 at 9:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .