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.3.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.3.0
File Size Uploaded
capture_pkg-0.3.0.tar.gz 9.4 kB Details

Built distribution (wheel)

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

Total release size: 18.9 kB

Release files / capture_pkg-0.3.0.tar.gz

Download URL capture_pkg-0.3.0.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d9b24c9520dcfbaedae865538ba72ab373e68602362d86f76d651bf445553863
BLAKE2b-256 checksum
How to use checksums
a7cfeb06322e017d34333d5ef8d8abbf9bfc755ceb93e89141efd2efd77b22fa
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.3.0-py3-none-any.whl

Download URL capture_pkg-0.3.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e644ec02e10cfafb8abe1bacb502b36ac8d9c978e9cb306edfc379ee50e0358d
BLAKE2b-256 checksum
How to use checksums
4b7e48b33b1eb00a4d1c1f06772ae063bd0083eeee9ac064551c81594730aa85
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

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

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