Skip to main content

Access reviewer services on addons.mozilla.org from python

Project description

pyamo - addons.mozilla.org for python

These tools provide some classes and a command line tool to access addons.mozilla.org. This site doesn't have a services API, therefore these tools use website scraping to determine the right information and use the same endpoints as they would be used in the browser.

The command line tool is installed under the name amo and has the following commands available:

info          Show basic information about an add-on
list          List add-ons in the given queue
get           Download one or more versions of an add-on, including sources
run           Run an add-on in Firefox (preferably in a VM)
decide        Make a review decision for an add-on, along with message
logs          Show the review logs

upload        Upload an add-on to addons.mozilla.org

adminget      Show admin manage information about an add-on
adminchange   Change the status of an add-ons and its files using the admin manage page
admindisable  Admin disable one or more add-ons, optionally with a rejection message

Configuration

The amo utility supports setting some configuration values. The file needs to be placed in ~/.amorc on Unix, or %HOME%/amorc.json on Windows.

The defaults section allows to configure defaults for optional arguments. Here are some examples:

{
  "pyamo": {
    "defaults": {
      "out": "--outdir ~/path/to/amofolder --binary ~/path/to/run_in_vm.py",
      "run": "--outdir ~/path/to/amofolder --binary ~/path/to/run_in_vm.py",
      "logs": "-k reviewer",
      "decide": "-f"
    }
  }
}

It is highly recommended to set a the --outdir argument as default, to make sure all add-ons end up in the same folder.

The auth section allows to specify an authentication key for redash, which is only necessary for admin commands.

{
  "auth": {
    "redash_key": "42c85d86fd212538f4394f47c80fa62c"
  }
}

To set default global arguments (e.g. timeout, cookies, profile), use the global key in pyamo defaults. For example, you may want to always use a Firefox profile for authentictaion:

{
  "pyamo": {
    "defaults": {
      "global": "-P 78bfnff3.default"
    }
  }
}

Examples

amo upload

Upload one or more xpi packages. Typical usage is specifying the add-on id, together with one or more occurrences of the -x parameter for each platform. Example:

amo upload lightning \
    -x linux lightning-linux.xpi \
    -x mac lightning-mac.xpi \
    -x win lightning-win32

amo get

Downloads one or more versions to the hard drive for review. Will download both the xpi and the sources and once done extract each package. The files will be saved in a sub-directory named after the addon id in the current (or specified) directory.

When specifying version numbers you can also use the tag latest to retrieve the latest version and the previous tag to get the last accepted version. This is useful when specifying multiple versions to download.

A commonly used option is the diff option -d, which automatically gets the latest and previous versions. This is useful to compare versions.

Example:

amo get -d lightning

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyamo-2.2.1.tar.gz (33.7 kB view details)

Uploaded Source

File details

Details for the file pyamo-2.2.1.tar.gz.

File metadata

  • Download URL: pyamo-2.2.1.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

File hashes

Hashes for pyamo-2.2.1.tar.gz
Algorithm Hash digest
SHA256 8219b5879bf824c75186b654a48b51c6c31b36ae5a217eeecf072acf2b3684d6
MD5 3da6f96766e8922788dacfea0cdd5550
BLAKE2b-256 b3cb716453fb115c4198f04c6e27681ce40c58b7b36794964c13ba87ad762411

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page