귀하는 로그인되어 있지 않습니다. 이대로 편집하면 귀하의 IP 주소가 편집 기록에 남게 됩니다.스팸 방지 검사입니다. 이것을 입력하지 마세요!== 실전 사용 예시 == === 데이터 과학 프로젝트 시작 === <syntaxhighlight lang="bash"> # 프로젝트 초기화 uv init data-analysis cd data-analysis # 파이썬 버전 고정 uv python pin 3.12 # 무거운 패키지들도 빠르게 설치 uv add numpy pandas matplotlib scikit-learn jupyter # GPU 버전 PyTorch 추가 uv add torch --index-url https://download.pytorch.org/whl/cu121 # 개발 도구 추가 uv add --dev pytest ruff mypy # Jupyter 실행 uv run jupyter lab </syntaxhighlight> === 웹 API 개발 === <syntaxhighlight lang="bash"> uv init my-api cd my-api uv add fastapi "uvicorn[standard]" sqlalchemy pydantic-settings uv add --dev pytest httpx pytest-asyncio uv run uvicorn app.main:app --reload </syntaxhighlight> === 간단한 일회성 스크립트 === <syntaxhighlight lang="python"> # web_scraper.py # /// script # requires-python = ">=3.11" # dependencies = [ # "httpx", # "beautifulsoup4", # "rich", # ] # /// import httpx from bs4 import BeautifulSoup from rich import print resp = httpx.get("https://news.ycombinator.com") soup = BeautifulSoup(resp.text, "html.parser") titles = [a.text for a in soup.select(".titleline > a")[:10]] for i, title in enumerate(titles, 1): print(f"[cyan]{i}.[/cyan] {title}") </syntaxhighlight> <syntaxhighlight lang="bash"> # 위 스크립트를 공유받은 사람은 그냥 이렇게만 실행하면 끝 uv run web_scraper.py </syntaxhighlight> === 기존 pip 프로젝트 마이그레이션 === <syntaxhighlight lang="bash"> # 기존 requirements.txt 기반 프로젝트 cd existing-project # 방법 1: pip 인터페이스로 그대로 사용 (가장 쉬움) uv pip install -r requirements.txt uv pip sync requirements.txt # 방법 2: 완전한 uv 프로젝트로 전환 uv init . # pyproject.toml 생성 uv add $(cat requirements.txt | grep -v "^#" | tr '\n' ' ') uv lock # uv.lock 생성 </syntaxhighlight> 편집 요약 가온 위키에서의 모든 기여는 크리에이티브 커먼즈 저작자표시-동일조건변경허락 라이선스로 배포된다는 점을 유의해 주세요(자세한 내용에 대해서는 가온 위키:저작권 문서를 읽어주세요). 만약 여기에 동의하지 않는다면 문서를 저장하지 말아 주세요. 또한, 직접 작성했거나 퍼블릭 도메인과 같은 자유 문서에서 가져왔다는 것을 보증해야 합니다. 저작권이 있는 내용을 허가 없이 저장하지 마세요! 취소 편집 도움말 (새 창에서 열림)