メインコンテンツへスキップ
commit と upload は Client または Application を使って行えます。 squarecloud.File オブジェクトを用意し、 zip ファイルのパスを渡すだけです。

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')

upload を行う

アプリケーションを upload するには、[Client] のみを使えます。
import squarecloud as square

client = square.Client(...)

async def example():
    file = square.File('path/to/you/file.zip')
    await client.upload_app(file=file)
アプリケーションを upload するには、(少なくとも)以下のファイルを含む zip が必要であることを忘れないでください:
  • メインファイル: アプリケーションの起動を担当します
  • 依存関係ファイル: どの依存関係が必要かに関する情報を含みます
  • 設定ファイル (squarecloud.app): 名前、 説明、 メインファイル名、バージョンなどを指定する設定ファイルです。設定ファイルの 詳細については、このガイドをご覧ください。
利便性のため、この設定ファイルを作成するクラスが追加されています: squarecloud.utils.ConfigFile