Skip to main content

Coolipy - (Un)official Coolify - coolify.io - Python client!

Reason this release was yanked:

broken build

Project description

Coolipy

The first (un)official Python client for the Coolify. Coolipy simplifies programmatically interacting with Coolify by providing wrappers around Coolify API, enabling you to manage projects, deployments, servers, services, and more with python scripts.

Installation

Install Coolipy using pip:

pip install coolipy

Features

  • Manage Coolify projects, servers, applications, deployments and more (everything the Coolify App offers);
  • Infra as code;
  • 1 dependency: requests>=2.32.3;
  • Datamodels for all endpoints;
  • Datamodels specific for creation with only the required fields;
  • All responses come from Datamodels;

TO DO:

  • Async support.

Lib Assets

  • coolipy.models: hold all data models used to hold retrieved data. Create methods use models names following the pattern: <service>ModelCreate;
  • coolipy.services: methods used to interact with the Coolify API.

Quick Start Guide/Examples

  • Import and Initialize
from coolipy import Coolipy

coolify_client = Coolipy(
    coolify_api_key="your_coolify_api_key",
    coolify_endpoint="your_coolify_instance_address",
)

Example Usage

  • Get Project Information
my_project = coolify_client.projects.get(project_uuid="your_project_uuid")
  • Create a Service
from coolipy.models.service import ServiceModelCreate

service_data = ServiceModelCreate(
    type=COOLIFY_SERVICE_TYPES.glance,
    name="Example Service",
    project_uuid="your_project_uuid",
    server_uuid="your_server_uuid",
    destination_uuid="your_destination_uuid",
    instant_deploy=True,
    environment_name="production"
)
new_service = coolify_client.services.create(service_data)
  • List Servers
servers = coolify_client.servers.list()
  • Create a DB:
from coolipy.models.databases import PostgreSQLModelCreate

postgres_db = PostgreSQLModelCreate(
    project_uuid="your_project_uuid",
    server_uuid="your_server_uuid",
    environment_name="production",
    is_public=False,
    limits_cpu_shares=0,
    limits_cpus=0,
    limits_cpuset=0,
    limits_memory=0,
    limits_memory_reservation=0,
    limits_memory_swap=0,
    limits_memory_swappiness=0,
    instant_deploy=True,
    postgres_user="dbuser",
    postgres_password="password",
    postgres_db="mydatabase",
    name="My PostgreSQL DB",
    postgres_conf="LQ==",  # Example config
    postgres_host_auth_method="-",
    postgres_initdb_args="-"
)

my_database = coolify_client.databases.create(database_model_create=postgres_db)
  • Create an App
from coolipy.models.applications import ApplicationPrivateGHModelCreate

app_data = ApplicationPrivateGHModelCreate(
    project_uuid="your_project_uuid",
    server_uuid="your_server_uuid",
    environment_name="production",
    ports_exposes="8080",
    github_app_uuid="your_github_app_uuid",
    git_repository="your_github_repo",
    git_branch="main",
    build_pack=COOLIFY_BUILD_PACKS.dockerfile,
    instant_deploy=True,
    name="MyApp"
)

new_app = coolify_client.applications.create(app_data)

Contributing

  • Before opening a pull request or issue, take some time to understand if the issue should be treated at this client level OR the Coolify REST API;
  • Create a fork of this repo and then submit a pull request;
  • Respect Python PEPs and type inference;
  • Test your code or changes introduced and deliver unit tests on the PR;
  • No breaking changes unless if necessary due Coolipy REST API change (please provide Coolipy PR/commits of the change).

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

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

coolipy-0.0.5.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coolipy-0.0.5-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file coolipy-0.0.5.tar.gz.

File metadata

  • Download URL: coolipy-0.0.5.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for coolipy-0.0.5.tar.gz
Algorithm Hash digest
SHA256 0ab61941e0dba8608e5b949ddb55aae063cbca79283ff39aa948e943132783b2
MD5 7d9c39ba78a737865c8996b94baf3551
BLAKE2b-256 6e17ca50879ce071dc597aad5c59c98546a91743298a7f8557cd36fbea1e499f

See more details on using hashes here.

File details

Details for the file coolipy-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: coolipy-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for coolipy-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 903b08c7e848be70ff795883d5f8bff7e0dde331f9d4a0c272cc2b66a7eb5cd9
MD5 0c3c6d59f45d5e59bd2948ddd8310406
BLAKE2b-256 d61e607f98b5c2c7484db8f7ef872a255e8d24b10ff743a0c5e10fe7bece8167

See more details on using hashes here.

Supported by

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