capture-pkg
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
xenogenderpreset andfastfetch/neofetchbackend. - Non-Blocking Auto Configuration: Auto-generates
hyfetch.jsonwhen 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 incapture_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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| capture_pkg-0.2.1.tar.gz | 9.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capture_pkg-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.7 kB
Release files / capture_pkg-0.2.1.tar.gz
| Download URL | capture_pkg-0.2.1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4dc72a844281dcd9fb60fa85ea93becbd71b87c0636d15bfbb1c2cbc766e21bf
|
|
BLAKE2b-256 checksum How to use checksums |
c66ab70300a77f775a34acf95ad01da0c2071ab3de5e48f5c922feb9dc938b82
|
| 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.1-py3-none-any.whl
| Download URL | capture_pkg-0.2.1-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b0b6eb0e25cbf1a091b49f7066dd3f03aa48a621272f3e66d0bde4b3a4554539
|
|
BLAKE2b-256 checksum How to use checksums |
8177f6e3b5b33952883820b44b48aced70b718f2483612b22f703469487c29e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|