WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Atiyakh/Fusion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ Project Under Active Development!

Fusion - Python CLI + DevOps + Notebooks — Repository Skeleton

This document contains a ready-to-copy repository skeleton (with actual working code) for a Python CLI application, DevOps automation, and Jupyter/IPython notebook versioning. The files below are consistent with the README quick start instructions.


centered image

File contents

README.md

# Python CLI + DevOps + Notebooks Skeleton

Quick start:

```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
make install

Run CLI:

python -m cli_app --help

Run tests:

make test

Push to GitHub:

./scripts/git_push.sh feature/initial origin

### src/cli_app/__init__.py

```python
"""CLI App package."""

__version__ = "0.1.0"

src/cli_app/cli.py

"""Simple CLI with Click — dummy commands."""
import click
from cli_app import __version__

@click.group()
def cli():
    """Root CLI group."""
    pass

@cli.command()
@click.option("--name", default="world", help="Name to greet")
def hello(name):
    """Print a greeting and a simple metric."""
    click.echo(f"Hello, {name}!")
    click.echo(f"name_length={len(name)}")

@cli.command()
def version():
    """Print version info."""
    click.echo(f"cli-app-dummy {__version__}")

if __name__ == "__main__":
    cli()

tests/test_cli.py

from click.testing import CliRunner
from cli_app.cli import cli


def test_hello():
    runner = CliRunner()
    result = runner.invoke(cli, ["hello", "--name", "Alice"])
    assert result.exit_code == 0
    assert "Hello, Alice!" in result.output
    assert "name_length=5" in result.output


def test_version():
    runner = CliRunner()
    result = runner.invoke(cli, ["version"])
    assert result.exit_code == 0
    assert "cli-app-dummy" in result.output

notebooks/example_py.py

# ---
# jupytext: {"formats": "ipynb,py:light", "text_representation": {"extension": ".py", "format_name": "light"}}
# ---

# # Example Notebook: Data exploration (dummy)

import math

values = [1, 2, 3, 5, 8]
mean = sum(values) / len(values)
print(f"mean={mean}")

# Example function

def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n - 1) + fibonacci(n - 2)

print("fib(5)=", fibonacci(5))

requirements.txt

click==8.1.7
pytest==7.4.0
jupytext==1.14.0
black==24.1.0
isort==5.12.0
flake8==6.1.0

pyproject.toml

[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "cli-app-dummy"
version = "0.1.0"
description = "Dummy CLI app for demo"
authors = [ {name = "Your Name", email = "[email protected]"} ]

[tool.jupytext]
formats = "ipynb,py:light"

[tool.black]
line-length = 88

.gitignore

__pycache__/
.env
.venv/
.ipynb_checkpoints/
*.pyc
.DS_Store

About

AI Training Data Management & Development Platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published