💼 AzureStorageファイルDatalakePy
Azureのクラウド上で大量のデータを効率的に管理
📺 まず動画で見る(YouTube)
▶ 【自動化】AIガチ勢の最新活用術6選がこれ1本で丸分かり!【ClaudeCode・AIエージェント・AI経営・Skills・MCP】 ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
Azure Data Lake Storage Gen2 SDK for Python. Use for hierarchical file systems, big data analytics, and file/directory operations.
🇯🇵 日本人クリエイター向け解説
Azureのクラウド上で大量のデータを効率的に管理
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o azure-storage-file-datalake-py.zip https://jpskill.com/download/2543.zip && unzip -o azure-storage-file-datalake-py.zip && rm azure-storage-file-datalake-py.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/2543.zip -OutFile "$d\azure-storage-file-datalake-py.zip"; Expand-Archive "$d\azure-storage-file-datalake-py.zip" -DestinationPath $d -Force; ri "$d\azure-storage-file-datalake-py.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
azure-storage-file-datalake-py.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
azure-storage-file-datalake-pyフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
💬 こう話しかけるだけ — サンプルプロンプト
- › Azure Storage File Datalake Py で、私のビジネスを分析して改善案を3つ提案して
- › Azure Storage File Datalake Py を使って、来週の会議用の資料を作って
- › Azure Storage File Datalake Py で、現状の課題を整理してアクションプランに落として
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Python 用 Azure Data Lake Storage Gen2 SDK
ビッグデータ分析ワークロード向けの階層型ファイルシステムです。
インストール
pip install azure-storage-file-datalake azure-identity
環境変数
AZURE_STORAGE_ACCOUNT_URL=https://<account>.dfs.core.windows.net
認証
from azure.identity import DefaultAzureCredential
from azure.storage.filedatalake import DataLakeServiceClient
credential = DefaultAzureCredential()
account_url = "https://<account>.dfs.core.windows.net"
service_client = DataLakeServiceClient(account_url=account_url, credential=credential)
クライアント階層
| クライアント | 目的 |
|---|---|
DataLakeServiceClient |
アカウントレベルの操作 |
FileSystemClient |
コンテナー (ファイルシステム) の操作 |
DataLakeDirectoryClient |
ディレクトリの操作 |
DataLakeFileClient |
ファイルの操作 |
ファイルシステム操作
# ファイルシステム (コンテナー) の作成
file_system_client = service_client.create_file_system("myfilesystem")
# 既存のファイルシステムの取得
file_system_client = service_client.get_file_system_client("myfilesystem")
# 削除
service_client.delete_file_system("myfilesystem")
# ファイルシステムの一覧表示
for fs in service_client.list_file_systems():
print(fs.name)
ディレクトリ操作
file_system_client = service_client.get_file_system_client("myfilesystem")
# ディレクトリの作成
directory_client = file_system_client.create_directory("mydir")
# ネストされたディレクトリの作成
directory_client = file_system_client.create_directory("path/to/nested/dir")
# ディレクトリクライアントの取得
directory_client = file_system_client.get_directory_client("mydir")
# ディレクトリの削除
directory_client.delete_directory()
# ディレクトリの名前変更/移動
directory_client.rename_directory(new_name="myfilesystem/newname")
ファイル操作
ファイルのアップロード
# ファイルクライアントの取得
file_client = file_system_client.get_file_client("path/to/file.txt")
# ローカルファイルからのアップロード
with open("local-file.txt", "rb") as data:
file_client.upload_data(data, overwrite=True)
# バイトのアップロード
file_client.upload_data(b"Hello, Data Lake!", overwrite=True)
# データの追加 (大きなファイルの場合)
file_client.append_data(data=b"chunk1", offset=0, length=6)
file_client.append_data(data=b"chunk2", offset=6, length=6)
file_client.flush_data(12) # データのコミット
ファイルのダウンロード
file_client = file_system_client.get_file_client("path/to/file.txt")
# 全コンテンツのダウンロード
download = file_client.download_file()
content = download.readall()
# ファイルへのダウンロード
with open("downloaded.txt", "wb") as f:
download = file_client.download_file()
download.readinto(f)
# 範囲のダウンロード
download = file_client.download_file(offset=0, length=100)
ファイルの削除
file_client.delete_file()
コンテンツのリスト表示
# パス (ファイルとディレクトリ) のリスト表示
for path in file_system_client.get_paths():
print(f"{'DIR' if path.is_directory else 'FILE'}: {path.name}")
# ディレクトリ内のパスのリスト表示
for path in file_system_client.get_paths(path="mydir"):
print(path.name)
# 再帰的なリスト表示
for path in file_system_client.get_paths(path="mydir", recursive=True):
print(path.name)
ファイル/ディレクトリのプロパティ
# プロパティの取得
properties = file_client.get_file_properties()
print(f"Size: {properties.size}")
print(f"Last modified: {properties.last_modified}")
# メタデータの設定
file_client.set_metadata(metadata={"processed": "true"})
アクセス制御 (ACL)
# ACL の取得
acl = directory_client.get_access_control()
print(f"Owner: {acl['owner']}")
print(f"Permissions: {acl['permissions']}")
# ACL の設定
directory_client.set_access_control(
owner="user-id",
permissions="rwxr-x---"
)
# ACL エントリの更新
from azure.storage.filedatalake import AccessControlChangeResult
directory_client.update_access_control_recursive(
acl="user:user-id:rwx"
)
非同期クライアント
from azure.storage.filedatalake.aio import DataLakeServiceClient
from azure.identity.aio import DefaultAzureCredential
async def datalake_operations():
credential = DefaultAzureCredential()
async with DataLakeServiceClient(
account_url="https://<account>.dfs.core.windows.net",
credential=credential
) as service_client:
file_system_client = service_client.get_file_system_client("myfilesystem")
file_client = file_system_client.get_file_client("test.txt")
await file_client.upload_data(b"async content", overwrite=True)
download = await file_client.download_file()
content = await download.readall()
import asyncio
asyncio.run(datalake_operations())
ベストプラクティス
- ファイルシステムセマンティクスには階層型名前空間を使用してください。
- 大容量ファイルのアップロードには
append_data+flush_dataを使用してください。 - ACL はディレクトリレベルで設定し、子に継承させてください。
- 高スループットのシナリオには非同期クライアントを使用してください。
- ディレクトリの完全なリスト表示には
recursive=Trueを指定したget_pathsを使用してください。 - カスタムファイル属性にはメタデータを設定してください。
- シンプルなオブジェクトストレージのユースケースにはBlob APIを検討してください。
使用する場面
このスキルは、概要に記載されているワークフローやアクションを実行するのに適用できます。
制限事項
- このスキルは、タスクが上記の範囲と明確に一致する場合にのみ使用してください。
- 出力を、環境固有の検証、テスト、または専門家によるレビューの代わりとして扱わないでください。
- 必要な入力、アクセス許可、安全境界、または成功基準が不足している場合は、停止して明確化を求めてください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Azure Data Lake Storage Gen2 SDK for Python
Hierarchical file system for big data analytics workloads.
Installation
pip install azure-storage-file-datalake azure-identity
Environment Variables
AZURE_STORAGE_ACCOUNT_URL=https://<account>.dfs.core.windows.net
Authentication
from azure.identity import DefaultAzureCredential
from azure.storage.filedatalake import DataLakeServiceClient
credential = DefaultAzureCredential()
account_url = "https://<account>.dfs.core.windows.net"
service_client = DataLakeServiceClient(account_url=account_url, credential=credential)
Client Hierarchy
| Client | Purpose |
|---|---|
DataLakeServiceClient |
Account-level operations |
FileSystemClient |
Container (file system) operations |
DataLakeDirectoryClient |
Directory operations |
DataLakeFileClient |
File operations |
File System Operations
# Create file system (container)
file_system_client = service_client.create_file_system("myfilesystem")
# Get existing
file_system_client = service_client.get_file_system_client("myfilesystem")
# Delete
service_client.delete_file_system("myfilesystem")
# List file systems
for fs in service_client.list_file_systems():
print(fs.name)
Directory Operations
file_system_client = service_client.get_file_system_client("myfilesystem")
# Create directory
directory_client = file_system_client.create_directory("mydir")
# Create nested directories
directory_client = file_system_client.create_directory("path/to/nested/dir")
# Get directory client
directory_client = file_system_client.get_directory_client("mydir")
# Delete directory
directory_client.delete_directory()
# Rename/move directory
directory_client.rename_directory(new_name="myfilesystem/newname")
File Operations
Upload File
# Get file client
file_client = file_system_client.get_file_client("path/to/file.txt")
# Upload from local file
with open("local-file.txt", "rb") as data:
file_client.upload_data(data, overwrite=True)
# Upload bytes
file_client.upload_data(b"Hello, Data Lake!", overwrite=True)
# Append data (for large files)
file_client.append_data(data=b"chunk1", offset=0, length=6)
file_client.append_data(data=b"chunk2", offset=6, length=6)
file_client.flush_data(12) # Commit the data
Download File
file_client = file_system_client.get_file_client("path/to/file.txt")
# Download all content
download = file_client.download_file()
content = download.readall()
# Download to file
with open("downloaded.txt", "wb") as f:
download = file_client.download_file()
download.readinto(f)
# Download range
download = file_client.download_file(offset=0, length=100)
Delete File
file_client.delete_file()
List Contents
# List paths (files and directories)
for path in file_system_client.get_paths():
print(f"{'DIR' if path.is_directory else 'FILE'}: {path.name}")
# List paths in directory
for path in file_system_client.get_paths(path="mydir"):
print(path.name)
# Recursive listing
for path in file_system_client.get_paths(path="mydir", recursive=True):
print(path.name)
File/Directory Properties
# Get properties
properties = file_client.get_file_properties()
print(f"Size: {properties.size}")
print(f"Last modified: {properties.last_modified}")
# Set metadata
file_client.set_metadata(metadata={"processed": "true"})
Access Control (ACL)
# Get ACL
acl = directory_client.get_access_control()
print(f"Owner: {acl['owner']}")
print(f"Permissions: {acl['permissions']}")
# Set ACL
directory_client.set_access_control(
owner="user-id",
permissions="rwxr-x---"
)
# Update ACL entries
from azure.storage.filedatalake import AccessControlChangeResult
directory_client.update_access_control_recursive(
acl="user:user-id:rwx"
)
Async Client
from azure.storage.filedatalake.aio import DataLakeServiceClient
from azure.identity.aio import DefaultAzureCredential
async def datalake_operations():
credential = DefaultAzureCredential()
async with DataLakeServiceClient(
account_url="https://<account>.dfs.core.windows.net",
credential=credential
) as service_client:
file_system_client = service_client.get_file_system_client("myfilesystem")
file_client = file_system_client.get_file_client("test.txt")
await file_client.upload_data(b"async content", overwrite=True)
download = await file_client.download_file()
content = await download.readall()
import asyncio
asyncio.run(datalake_operations())
Best Practices
- Use hierarchical namespace for file system semantics
- Use
append_data+flush_datafor large file uploads - Set ACLs at directory level and inherit to children
- Use async client for high-throughput scenarios
- Use
get_pathswithrecursive=Truefor full directory listing - Set metadata for custom file attributes
- Consider Blob API for simple object storage use cases
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.