Skip to main content

A 'Zen Mode' infrastructure engine for Python developers.

Project description

🧘 Xenfra: Infrastructure in Zen Mode

Xenfra is a modular infrastructure engine for Python developers that automates the deployment of applications to DigitalOcean. It is designed as a library first, with a beautiful and interactive CLI as the default frontend.

It handles the complexity of server provisioning, context-aware configuration, Dockerization, and automatic HTTPS, allowing you to focus on your code.

✨ Core Philosophy

  • Engine as the Brain: xenfra.engine is the core library. It owns the DigitalOcean API, the SSH "Auto-Heal" retry loops, and the Dockerizer services. It is stateful, robust, and can be imported into any Python project.
  • Clients as the Face: Frontends like the default CLI (xenfra.cli) are thin, stateless clients responsible only for user interaction.
  • Zen Mode: If a server setup fails due to common issues like a locked package manager, the Engine automatically fixes it without exposing raw errors to the user.

🚀 Quickstart

Using the Xenfra CLI involves a simple workflow: Configure, Initialize, and then Deploy & Manage.

1. Configure

Xenfra needs your DigitalOcean API token to manage infrastructure on your behalf. Export it as an environment variable:

export DIGITAL_OCEAN_TOKEN="dop_v1_your_secret_token_here"

2. Initialize

Navigate to your project's root directory and run the init command. This command scans your project, asks a few questions, and creates a xenfra.yaml configuration file.

xenfra init

You should review the generated xenfra.yaml and commit it to your repository.

3. Deploy & Manage

Once your project is initialized, you can use the following commands to manage your application:

  • xenfra deploy: Deploys your application based on the settings in xenfra.yaml.
  • xenfra list: Instantly lists all your deployed projects from a local cache.
    • Use xenfra list --refresh to force a sync with your cloud provider.
  • xenfra logs: Streams real-time logs from a selected project.
  • xenfra destroy: Decommissions and deletes a deployed project.

📦 Supported Frameworks & Features

  • Smart Context Detection: Automatically detects your package manager (uv or pip).
  • Automatic Dockerization: If a web framework is detected (FastAPI, Flask), Xenfra will:
    • Generate a Dockerfile, docker-compose.yml, and Caddyfile.
    • Deploy your application as a container.
    • Configure Caddy as a reverse proxy with automatic HTTPS.

🤝 Contributing

Contributions are welcome! Please check our CONTRIBUTING.md for more details.

📄 Created by DevHusnainAi

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

xenfra-0.2.2.tar.gz (21.7 kB view details)

Uploaded Source

Built Distribution

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

xenfra-0.2.2-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file xenfra-0.2.2.tar.gz.

File metadata

  • Download URL: xenfra-0.2.2.tar.gz
  • Upload date:
  • Size: 21.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for xenfra-0.2.2.tar.gz
Algorithm Hash digest
SHA256 8118298236ed886e8d8cad68dc24d8b9e3ad36990a97f8bec628f42a3ab74f88
MD5 c97083d916337ccf688c60f6aa7c1e7d
BLAKE2b-256 1fd56b91b37ede1927b063133a861f5b2f47089d48686fd568d59d5f011b9f12

See more details on using hashes here.

File details

Details for the file xenfra-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: xenfra-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 30.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for xenfra-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d373ae386dab8f0268ba47afd3aaecb125b44242b70f66bfad1fca4411348112
MD5 c790dbabe7e7089ad796b8122c84b6f4
BLAKE2b-256 6032a77f31ecc384f5754eac059fce2e41414d4dccc833c3a043b6c6bb234865

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