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.1.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.1.1.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| capture_pkg-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.3 kB
Release files / capture_pkg-0.1.1.tar.gz
| Download URL | capture_pkg-0.1.1.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
127dc286c1383863849f65f74801172ad042c3ea1995198dff195d24d6a6dfc4
|
|
BLAKE2b-256 checksum How to use checksums |
cf764695d112e368d449a8b4f99c744f5e7cc2218514b0426d88a108ff9c4f18
|
| 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.1.1-py3-none-any.whl
| Download URL | capture_pkg-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53ebd9a4e80aeda8eb013181c31071312b2d10c1316a3c063bc46cc21add59a8
|
|
BLAKE2b-256 checksum How to use checksums |
7a6e7b351fb721e9ce5cb9e7436a76ffed862002e44fe3ba36eee635517510c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.10
|