Skip to main content

capture-pkg

PyPI Version Python Version License: MIT

A modular Python package providing capture capabilities and HyFetch console branding for the x-ray application and standalone Python services.


✨ Features

  • HyFetch Console Branding: Automatic system fetch console banner with custom xenogender preset and fastfetch / neofetch backend.
  • Non-Blocking Auto Configuration: Auto-generates hyfetch.json when missing to ensure non-interactive servers (FastAPI/Uvicorn) never hang on setup wizards.
  • FastAPI / Server Ready: Provides helper functions (print_banner(), get_info(), process_capture()) ready for API consumption.
  • CLI Executable: Pre-configured terminal command capture-pkg.

🚀 Quick Start

1. Installation from PyPI

pip install capture-pkg

2. Run CLI Command

Execute directly in your terminal to see the HyFetch banner and package status:

capture-pkg

💻 Usage in Python & FastAPI (x-ray)

Import in FastAPI App / Routes

from fastapi import APIRouter
import capture_pkg

router = APIRouter()

# Display HyFetch banner at server startup (Non-blocking)
capture_pkg.print_banner()

@router.get("/api/v1/capture/info")
def get_capture_info():
    return capture_pkg.get_info()

@router.post("/api/v1/capture/process")
def trigger_capture(bl_number: str, camera_id: int = 1):
    return capture_pkg.process_capture(source_id=bl_number, camera_id=camera_id)

🛠️ Local Development (Editable Mode)

When developing or modifying capture-pkg locally, install in editable mode:

cd capture_pkg
pip install -e .[dev]

Note: In editable mode (pip install -e .), any code changes made in capture_pkg/ take effect immediately without needing to reinstall!


📦 Package Publishing & Update Workflow

PyPI package releases are immutable. Whenever you update code and want to publish a new release:

1. Configure PyPI Token Credentials

Create a .env file in the project root:

TWINE_USERNAME=__token__
TWINE_PASSWORD=pypi-AgEIcHlwaS5vcmcC...

2. Bump Version Number

Update the version in both pyproject.toml and capture_pkg/__init__.py:

# pyproject.toml
version = "0.1.1"

3. Build Distribution Packages

Clean previous artifacts and build new .whl and .tar.gz archives:

python -m build

4. Upload to PyPI

Publish the new version using Twine:

python -m twine upload dist/*

5. Upgrade Client Installation

On client servers or inside your x-ray virtual environment, update to the latest release:

pip install --upgrade capture-pkg

📄 License

Distributed under the MIT License.

Metadata

Release files for capture-pkg 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for capture-pkg 0.2.0
File Size Uploaded
capture_pkg-0.2.0.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for capture-pkg 0.2.0
File Interpreter ABI Platform
capture_pkg-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.2 kB

Release files / capture_pkg-0.2.0.tar.gz

Download URL capture_pkg-0.2.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e97f5b3d706876642ecd54ab060a0bd4452f3b03ca19c4c421314ad9eb2097c3
BLAKE2b-256 checksum
How to use checksums
c23c5f7559ea8bf4c8a477eb039ff6200e83bf5e9533a9d1793b0cbd70d34edd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / capture_pkg-0.2.0-py3-none-any.whl

Download URL capture_pkg-0.2.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c4694632104443dacbb633006158154397b106c154a0e6afe374e365696d659
BLAKE2b-256 checksum
How to use checksums
daca9611434a8452b196ac2c8e387ec6ea8c4bc7cb2ce0baf1a5ed6a30f80be0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.0

2 release files

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page