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
maturincompiles the Rust code in theoct-pycrate into a native Python module.- We configure the name of this compiled module in
pyproject.tomlto beopencloudtool._internal. - The leading underscore (
_) is a standard Python convention that signals that_internalis a low-level module not meant for direct use. - Our user-facing Python code in
opencloudtool/py_api.pyimports functions from_internaland 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
- Before releasing, you must increment the version number. PyPI will not accept a version that already exists.
crates/oct-py/pyproject.toml
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opencloudtool-0.5.1.tar.gz.
File metadata
- Download URL: opencloudtool-0.5.1.tar.gz
- Upload date:
- Size: 83.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec537c2db87cadad35489ee24b4fc272ad0c9ff9d2b6d68a3738060fcedb3064
|
|
| MD5 |
d7ea55058f0e0c8363373883428194d5
|
|
| BLAKE2b-256 |
6d2721a349689956f2b53063fd1aa34d400e266e9a792ff360aa71604ac18559
|
File details
Details for the file opencloudtool-0.5.1-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: opencloudtool-0.5.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 11.7 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e3cca34e7f7fa2955f382d0e20b4c62829a33ab69196ea75ed638e890456f70
|
|
| MD5 |
321a2eab7ac4548890e78eb49c940b78
|
|
| BLAKE2b-256 |
0587b8cf0a71826b8250ecd1d25de9f9711df599b33c7ab3d7f2c1af976eda93
|