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/FileTypeSizeAzureStoragePython

BranchesTags
Open more actions menu

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
filetype_size
filetype_size
 
 
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
requirements.lock
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

FileTypeSizeAzureStoragePython

CI License: MIT

Calculate the total byte size of blobs matching a file extension across all containers in an Azure Storage account—for example, sum every .vhd or .png in the account.

The tool uses the current Azure Storage Blob SDK for Python (azure-storage-blob v12+). Credentials are read from the environment or interactive prompts; they are never stored in the repository.

Features

  • Lists every container and blob (name and size) in the storage account
  • Totals sizes for blobs whose names end with your chosen extension (e.g. .vhd)
  • Supports non-interactive runs via environment variables
  • Offline unit tests with mocked Azure clients

Requirements

  • Python 3.12+
  • An Azure Storage account with account name and key (or use a connection string pattern via env vars above)

Setup

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

Copy .env.example to .env and fill in values locally (.env is gitignored).

Configuration

Variable Description
AZURE_STORAGE_ACCOUNT_NAME Storage account name
AZURE_STORAGE_ACCOUNT_KEY Storage account access key
FILE_TYPE Extension to match (e.g. .vhd or vhd)

If any variable is missing, the program prompts for it on stdin.

Usage

With environment variables:

export AZURE_STORAGE_ACCOUNT_NAME=myaccount
export AZURE_STORAGE_ACCOUNT_KEY='...'
export FILE_TYPE=.vhd
python main.py

Console script (after install):

filetype-size-azure

Interactive (no env vars):

python main.py

Example output:

Welcome to the file size calculator for Azure Storage on Python
Printing out containers:
     my-container:
Blob name: backups/disk.vhd
Blob size: 1073741824
Total size of .vhd files: 1073741824

Running tests

Tests run fully offline with mocked Azure APIs:

ruff check .
ruff format --check .
pytest --cov=filetype_size

Project structure

├── filetype_size/
│   ├── azure_client.py   # BlobServiceClient helpers
│   ├── calculator.py     # Extension matching and totals
│   └── cli.py            # Prompts / env / output
├── main.py               # Entry point
├── tests/
├── pyproject.toml        # Package metadata and tool config
├── requirements.txt      # Runtime pins (source)
└── requirements.lock     # Locked versions for CI/reproducible installs

License

MIT License — see LICENSE (Copyright © 2026 Joel Shearon).

About

No description, website, or topics provided.

Resources

Readme
MIT license

Security policy

Security policy
Activity

Stars

0 stars

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.