0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AWS Lambda(Python 3.x)で必ず使える標準ライブラリ(stdlib)

Posted at

Python 3.12ベースの代表的な標準ライブラリ一覧

毎回何をデプロイするか悩むのが嫌だから、自分用の一覧

これらはLambdaですべて デプロイ・レイヤー不要でimportできる
(まれにエラーが出る場合もあるらしい…Chatgpt談)

一般ユーティリティ

abc
argparse
array
base64
bisect
calendar
cmath
collections
copy
datetime
decimal
enum
functools
fractions
hashlib
heapq
hmac
importlib
inspect
itertools
json
logging
math
numbers
operator
pathlib
random
re
statistics
string
struct
time
typing
uuid
warnings
weakref

OS / ファイル関連

os
sys
shutil
stat
tempfile
glob
fnmatch
subprocess
zipfile
tarfile
filecmp
pathlib

ネットワーク / 通信

socket
urllib
http
ssl
email
ipaddress
selectors

セキュリティ / 暗号化

hmac
hashlib
secrets
ssl
base64

並行処理

threading
multiprocessing  (※Lambdaでは制限ありだが、importはできる)
concurrent.futures
asyncio
queue

テキスト・データ処理

csv
json
xml
html
plistlib

デバッグ / テスト

traceback
unittest
doctest
pdb

データフォーマット

pickle
marshal
struct
codecs
gzip
bz2
lzma

Web / HTTP 関連

http.client
http.server
urllib.request
urllib.parse
urllib.error

おまけ

デプロイかレイヤーが必要な標準ではないライブラリ例

requests
pandas
numpy
scipy
opencv
psycopg2
PyMySQL
paramiko
lxml

標準ライブラリではないがAWSが独自に最初から入れているライブラリ例

  • デプロイ/レイヤーなしで使える!
boto3
botocore

レイヤーが必要だと知らずに実行してエラーに苦しんだので
戒めに、、

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?