You can make commits and uploads using Client or Application. You just need a squarecloud.File object and pass the path where your zip file is.

Making a commit

import squarecloud as square

client = square.Client('API_KEY')

async def example():
    file = square.File('path/to/you/file.zip')
    await client.commit(file=file, app_id='application_id')

Making a upload

To upload an application, you only use the [Client] and the CLI.

import squarecloud as square

client = square.Client(...)

async def example():
    file = square.File('path/to/you/file.zip')
    await client.upload_app(file=file)

Remember that to upload an application you need a zip that contains (at least) the following files::

  • Main file: responsible for starting your application
  • Dependencies file: contains information about which dependencies are necessary
  • Configuration file (squarecloud.app): a configuration file specifying the name, description, main file name, version, etc. To learn more about the configuration file, take a look at this guide.

For your convenience, a function has been added to create this configuration file: squarecloud.create_config_file.

You can also create the configuration file using the command line squarecloud create_config_file.