2024. 6. 30. 15:51ㆍ정보처리,전산/Python
1. Selenium (웹 자동화 라이브러리)
- 웹 브라우저를 자동화할 수 있는 라이브러리이다.
- 웹 애플리케이션을 테스트하거나 데이터를 스크래핑하는 데 사용된다.
- 설치: pip install selenium
from selenium import webdriver
driver = webdriver.Chrome()
driver.get("http://example.com")
2. Pandas (데이터 처리 라이브러리)
- DataFrame과 Series와 같은 구조를 제공하여 데이터 처리를 간편하게 한다.
- 설치: pip install pandas
import pandas as pd
df = pd.read_csv("data.csv")
print(df.head())
3. PIL (Python Imaging Library, 이미지 처리 라이브러리)
- 이미지 작업을 쉽게 처리할 수 있게 해주는 라이브러리이다.
- 현재는 Pillow로 포크되어 유지보수되고 있다.
- 설치: pip install Pillow
from PIL import Image
image = Image.open("example.jpg")
image.show()
4. python-pptx (PPT 제어 라이브러리)
- PowerPoint 파일을 생성하고 수정할 수 있는 라이브러리이다.
- 설치: pip install python-pptx
from pptx import Presentation
prs = Presentation()
slide = prs.slides.add_slide(prs.slide_layouts[0])
title = slide.shapes.title
title.text = "Hello, World!"
prs.save("example.pptx")
5. python-docx (워드 제어 라이브러리)
- Microsoft Word 파일을 생성하고 수정할 수 있는 라이브러리이다.
- 설치: pip install python-docx
from docx import Document
doc = Document()
doc.add_heading("Document Title", 0)
doc.add_paragraph("Hello, World!")
doc.save("example.docx")
6. NumPy (행렬 계산 라이브러리)
- 과학 계산을 위한 강력한 라이브러리로, 다차원 배열 객체를 제공하며 다양한 수학 함수도 지원한다.
- 설치: pip install numpy
import numpy as np
arr = np.array([1, 2, 3])
print(arr)
7. smtplib (이메일 라이브러리)
- 이메일을 보내는 데 사용되는 표준 라이브러리이다.
- 설치: Python 표준 라이브러리에 포함되어 있어 별도의 설치가 필요 없다.
import smtplib
server = smtplib.SMTP('smtp.example.com', 587)
server.starttls()
server.login("user@example.com", "password")
server.sendmail("user@example.com", "recipient@example.com", "Hello, World!")
server.quit()
추가적으로 유용한 라이브러리들:
8. Matplotlib (데이터 시각화 라이브러리)
- 다양한 유형의 그래프와 플롯을 그릴 수 있는 라이브러리이다.
- 설치: pip install matplotlib
import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4])
plt.ylabel('some numbers')
plt.show()
9. Requests (HTTP 요청 라이브러리)
- 간편하게 HTTP 요청을 보내고 응답을 처리할 수 있는 라이브러리이다.
- 설치: pip install requests
import requests
response = requests.get("http://example.com")
print(response.text)
10. BeautifulSoup (HTML 및 XML 파싱 라이브러리)
- HTML 및 XML 파일을 파싱하여 데이터 추출을 쉽게 할 수 있는 라이브러리이다.
- 설치: pip install beautifulsoup4
n
from bs4 import BeautifulSoup
html_doc = "<html><head><title>The Dormouse's story</title></head><body><p class='title'><b>The Dormouse's story</b></p></body></html>"
soup = BeautifulSoup(html_doc, 'html.parser')
print(soup.title.string)
11. OpenCV (컴퓨터 비전 라이브러리)
- 실시간 컴퓨터 비전 애플리케이션을 개발하기 위한 라이브러리이다.
- 설치: pip install opencv-python
'정보처리,전산 > Python' 카테고리의 다른 글
웹크롤링 엔터키 적용 (0) | 2024.06.30 |
---|---|
네이버 키워드 검색 후 기사 텍스트 추출 (1) | 2024.06.30 |
클래스 인스턴스 생성 (0) | 2024.06.29 |
map (0) | 2024.06.29 |
Set (0) | 2024.06.29 |