🗃️ 프로그램
home
EveryData엑셀
home

엑셀, 파이썬 xlwings를 품고 진짜 날개를 달다. xlwings Lite

xlwingsLite 엑셀추가기능

xlwings Lite 설치방법

xlwings Lite: a better way to use Python in Excel
xlwings Lite brings the VBA experience into the modern age by offering a privacy-first, secure, and developer-friendly way to automate Excel and write custom functions with Python. - Free & easy to install: Available for free in the Office add-in store for both personal and commercial use. No login required, simply install and create amazing things! - Cross-platform: Works on Windows, macOS, and Excel for the web. It’s compatible with Microsoft 365 as well as recent perpetual versions like Office 2024. - No Python installation required: You don’t need to have Python installed as Python runs inside the browser that powers modern Excel add-ins (using WebAssembly via Pyodide). - Easy distribution: Python code is stored inside the workbook, making the xlwings Lite add-in the only requirement to run your workbook. - Custom functions & scripts: Define native custom functions (a.k.a. user-defined functions “UDFs”) and run automation scripts by clicking a button. - Excel object model: Access the Excel object model to insert a new sheet, format an Excel range as table, set the color of a cell, etc. - Install packages: Install and use libraries like pandas, Polars, DuckDB, or even your own custom Python packages. - Web API access: Fetch data from APIs that support CORS. - Lightning-fast: All code runs locally on your machine, eliminating network latency and delivering lightning-fast performance! - Fully local & private: Runs entirely on your computer without sending data out. The only exception is Microsoft’s mandatory telemetry, which you can eliminate through self-hosting. - Familiar & powerful editor: xlwings Lite uses the same editor as VS Code, supporting many of the same keyboard shortcuts to make you more efficient. - Self-hosting: For maximum security, you can deploy xlwings Lite on your own infrastructure, behind your firewall (“on-premise installation”). - Works offline: xlwings Lite only requires an network connection for loading the add-in. Once loaded, xlwings Lite works offline.

xlwings Lite 기능 요약

1.
Office 스토어에서 무료 설치, 로그인 불필요
2.
Windows, macOS, 웹 Excel 모두 지원
3.
Python 설치 없이 브라우저에서 실행
4.
코드가 통합 문서에 포함되어 배포 간편
5.
사용자 정의 함수와 자동화 스크립트 실행 가능
6.
시트 삽입, 셀 서식 등 Excel 제어 가능
7.
pandas 등 외부 패키지 사용 가능
8.
웹 API에서 데이터 가져오기 가능
9.
로컬 실행으로 빠른 성능
10.
외부 전송 없이 로컬에서만 동작
11.
VS Code 스타일 편집기 제공
12.
방화벽 내부 온프레미스 배포 가능
13.
로딩 후 오프라인 사용 가능

Script 데코레이터 샘플

@script def hello_world(book: xw.Book): sheet = book.sheets.active sheet["A1"].value = "Hello xlwings!"
Python
복사
위 예시처럼 @script 데코레이터를 함수 위에 추가하면 해당 함수를 Excel의 매크로처럼 실행할 수 있습니다.
Excel에서 Python 함수를 직접 호출할 수 있게 해줍니다.
현재 활성화된 통합 문서와 시트에 쉽게 접근할 수 있습니다.
매개변수를 받아 동적으로 Excel 작업을 수행할 수 있습니다.
스크립트 데코레이터를 사용하면 복잡한 Excel 자동화 작업을 Python으로 쉽게 구현할 수 있습니다.

func 데코레이터

@func 데코레이터는 Excel에서 Python 함수를 사용자 정의 함수(UDF)로 사용할 수 있게 해주는 기능입니다.
@func def DOUBLE(x): return x * 2
Python
복사
위 예시처럼 @func 데코레이터를 사용하면 Excel 셀에서 직접 Python 함수를 호출할 수 있습니다.
Excel 셀에서 =DOUBLE(A1)과 같이 함수를 호출할 수 있습니다.
Excel의 기본 함수처럼 사용할 수 있어 편리합니다.
pandas, numpy 등 외부 라이브러리를 활용한 복잡한 계산도 가능합니다.
사용자 정의 함수를 통해 Excel의 기능을 Python으로 확장하여 더 강력한 데이터 처리와 분석이 가능해집니다.