GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hippi345/GetBlobsOfFileTypePython

BranchesTags
Open more actions menu

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
get_blobs_of_file_type
get_blobs_of_file_type
 
 
tests
tests
 
 
.editorconfig
.editorconfig
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
main.py
main.py
 
 
pyproject.toml
pyproject.toml
 
 
requirements-lock.txt
requirements-lock.txt
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

GetBlobsOfFileTypePython

CI License: MIT

Command-line utility that lists blobs in Azure Blob Storage containers whose names end with a given file type (extension), and reports the total size of matching files.

Features

  • Scan one or more containers in a storage account
  • Filter blobs by filename suffix (e.g. .pdf)
  • Print per-blob sizes and a total size summary
  • Credentials via CLI flags or environment variables (keys are never printed)

Requirements

  • Python 3.12 or newer
  • An Azure Storage account with access to the target containers

Setup

git clone https://github.com/hippi345/GetBlobsOfFileTypePython.git
cd GetBlobsOfFileTypePython
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -e ".[dev]"

Copy .env.example to .env for local reference (do not commit .env).

Configuration

Variable Description
AZURE_STORAGE_ACCOUNT_NAME Storage account name (used with account key)
AZURE_STORAGE_ACCOUNT_KEY Storage account key
AZURE_STORAGE_CONNECTION_STRING Full connection string (optional; takes precedence when set)

CLI flags -s / -k override environment variables for account name and key when not using a connection string.

Usage

python main.py -s myaccount -k "$AZURE_STORAGE_ACCOUNT_KEY" -c container1 container2 -f .pdf

Or with environment variables:

export AZURE_STORAGE_ACCOUNT_NAME=myaccount
export AZURE_STORAGE_ACCOUNT_KEY='...'
python main.py -c logs backups -f .json

Example output:

Welcome to the storage utility...
     The containers are: ['logs', 'backups']
     The Storage account is: myaccount
     The key is: [redacted]
     The file type for search is: .pdf
     logs:
2024/report.pdf: 1024 bytes
Total size of .pdf files: 1024 bytes

Installed package entry point (optional):

get-blobs-of-file-type -c mycontainer -f .txt -s myaccount -k "$AZURE_STORAGE_ACCOUNT_KEY"

Running tests

Tests run offline with mocked storage clients (no Azure credentials required):

pytest
ruff check .
ruff format --check .

Project structure

├── get_blobs_of_file_type/   # Package: scanner + CLI
│   ├── cli.py
│   └── scanner.py
├── main.py                   # Backward-compatible entry point
├── tests/
├── pyproject.toml
├── .github/workflows/ci.yml
└── SECURITY.md

License

MIT License — Copyright (c) 2026 Joel Shearon. See LICENSE.

About

No description, website, or topics provided.

Resources

Readme
MIT license

Security policy

Security policy
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.