Skip to main content

No project description provided

Project description

Opencloudtool Python Library

A tool to hide the complexity of the cloud, now available as a Python library. This library allows you to deploy services directly from your Python scripts.The core of this library is written in Rust for high performance and reliability.

Installation

You can install the library from PyPI using pip

pip install opencloudtool

Basic Usage

To use the library, you need an oct.toml configuration file in your project directory. The library provides deploy and destroy functions to manage your stack.

Example deploy.py

import opencloudtool as oct

# The path to the project directory containing oct.toml
project_path = "./my-app"

oct.deploy(path=project_path)

To destroy infrastructure:

oct.destroy(path=project_path)

Main repo opencloudtool

Dev

How it works: Python-Rust binding

The connection between Python and Rust is managed by maturin and PyO3

  1. maturin compiles the Rust code in the oct-py crate into a native Python module.
  2. We configure the name of this compiled module in pyproject.toml to be opencloudtool._internal.
  3. The leading underscore (_) is a standard Python convention that signals that _internal is a low-level module not meant for direct use.
  4. Our user-facing Python code in opencloudtool/py_api.py imports functions from _internal and presents them as a clean, stable API.

1. Navigate to the Python Directory

cd crates/oct-py

2. Create and activate the Virtual environment

uv venv

source .venv/bin/activate # Windows: .venv\Scripts\activate

3. Install dependencies

uv sync --group dev

4. Build the Library

maturin develop

5. Run the example

cd ../../examples/projects/single-host-python-lib

You can now run python deploy.py or python destroy.py to test your changes.

Releasing the Python Library

Bump the Version Number

  1. Before releasing, you must increment the version number. PyPI will not accept a version that already exists.
  • crates/oct-py/pyproject.toml
  1. Build & upload the Release Packages:
cd crates/oct-py

maturin sdist

maturin build --release

cd ../..

twine upload target/wheels/*

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

opencloudtool-0.6.0.tar.gz (81.1 kB view details)

Uploaded Source

Built Distribution

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

opencloudtool-0.6.0-cp312-cp312-macosx_11_0_arm64.whl (12.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file opencloudtool-0.6.0.tar.gz.

File metadata

  • Download URL: opencloudtool-0.6.0.tar.gz
  • Upload date:
  • Size: 81.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for opencloudtool-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b7b3b352b33431823cb22e9ae3f2df3697267003efec7db3c1b87db4f23eb96a
MD5 45563fb54adb43b12465b1e395b87dd3
BLAKE2b-256 5c9fa70998dd4b91cd0703e48507e284ac15fab1bb019a3069e8739e5e123dda

See more details on using hashes here.

File details

Details for the file opencloudtool-0.6.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for opencloudtool-0.6.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eab9fa112dc411f911d441775e52c25debaa74488a192a40d588e353cc9f7b9b
MD5 e0a7e46c7073ba8fdfbc6f230f0cb33c
BLAKE2b-256 e30c1636a7052290d4b06428a84da2fd423e7322a978078aa6deb04c28362cd4

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