Jupyter Notebook을 HTML 웹 페이지로 배포

Jupyter Notebook을 HTML 웹 페이지로 배포한 방법을 보여주기 위해 이 게시물을 작성하고 있습니다. Python에서 솔루션을 구현하기로 결정한 문제 설명이 제공되었을 때 이 방법을 발견했을 때 출력과 함께 코드 스니펫을 표시하는 Python 스크립트를 공유하는 다양한 방법을 탐색하고 있었습니다.

여기에서 최종 출력을 확인할 수 있습니다 👇🏻

프로덕션 애플리케이션 테스트 - 프로젝트 웹페이지



문제 설명 📄 (출처: Intercom )



We have some customer records in a text file, one customer per line, JSON formatted lines. We want to invite any customer within 100km of our Dublin office for some food and drinks on us. Write a program that will read the full list of customers and output the names and user ids of matching customers (within 100km), sorted by User ID (ascending).

  • You must use the first formula from this Wikipedia article to calculate distance. Don't forget, you'll need to convert degrees to radians.
  • The GPS coordinates for our Dublin office are 53.339428 and -6.257664.
  • You can find the Customer list here.


구현 🏗



  • Google Colaboratory ⚗️ Python 스크립트 구현

  • Folium 🗺 사무실 및 고객 위치에 대한 지도 및 마커 렌더링

  • URLlib Module 📁 고객 데이터 가져오기 및 처리
  • 초기 전처리
  • 후 데이터를 처리하는 내장형JSON Package 🧾

  • Pandas 📊 처리된 고객 데이터
  • 작업
  • 기본 단위 테스트
  • 를 구현하기 위한 내장형UnitTest Library 📋

  • GitHub Pages 💻 생성된 웹 페이지 호스팅용

  • 배포 🚀



    주피터 노트북을 HTML로



    나는 jupyter nbconvert을 사용하여 ipynb 스크립트를 html로 변환했습니다.

    jupyter nbconvert <input-file> --to <output-format>
    

    Supported output formats은 HTML, PDF, LaTeX 등입니다.

    추가Configuration Options를 사용하여 노트북을 다른 형태로 변환하는 경험을 풍부하게 할 수 있습니다. 내가 사용한 한 가지 옵션은 기본적으로 Light로 설정된 노트북의 테마를 변경하는 것이었습니다. HTMLExporter.theme CLI 플래그를 사용하여 수행할 수 있습니다.

    사용법 예시:

    jupyter nbconvert script.ipynb --to html --HTMLExporter.theme=dark 
    

    HTML 파일을 생성한 후 섹션으로 이동하기 위한 탐색 모음을 추가하고 배경색 jp-Notebook 클래스를 검정색에서 Grey20 색상(#333333)으로 변경하는 등 HTML 코드를 변경했습니다. GitHub 리포지토리에서 직접 GitHub 페이지를 사용하여 호스팅했습니다.

    GitHub 리포지토리 📥




    ParthKetanDoshi / 프로덕션-애플리케이션-테스트


    좋은 웹페이지 즐겨찾기