Skip to content

About

A practical, community-driven guide to Python 3 for system administrators and DevOps engineers

Topics

Resources

Contributing

Stars

249 stars

Watchers

13 watching

Forks

Repository files navigation

Python for SysAdmin

Read the guide Try it free GitHub stars PRs welcome

A practical, community-driven guide to Python 3 for system administrators and DevOps engineers. Each chapter teaches one module through the tasks you actually do on servers: reading configs and logs, running commands, checking disks and ports, and building your own command-line tools.

📖 Read it as a website: purutuladhar.com/python-for-sys-admin

⭐ If this guide helps you, please give it a star. It helps other sysadmins find it.

Practice hands-on, for free

You don't need a server. The iximiuz Labs Python Playground gives you a real Linux VM with root access, the latest Python 3, uv, Docker and VS Code, right in your browser. Start it, then:

git clone https://github.com/tuladhar/Python-for-SysAdmin.git
cd Python-for-SysAdmin/examples
cat /etc/passwd | python3 grep.py bash

Learn step by step with AI

Stuck on a concept? Install the free /step-by-step Claude skill. It explains any topic one short sentence at a time, and waits for you to say "understood" before it moves on:

/step-by-step how subprocess.run captures stdout and the exit code

Contents

Getting Started

  1. Set Up Your Lab
  2. Standard Input, Output and Error
  3. Working with Files
  4. Command-line Arguments

Standard Library

  1. The os Module
  2. The sys Module
  3. shutil and glob
  4. Date and Time
  5. Running Commands with subprocess
  6. Building CLIs with argparse

Data and Networking

  1. Working with JSON
  2. Working with CSV
  3. SQLite: a Database in a File
  4. Network Checks with socket

Help wanted 🙌

Regular expressions, logging, compression, XML, platform, signals, ipaddress, concurrency, HTTP APIs, SSH automation (paramiko), psutil, netmiko, boto3, Docker and Kubernetes clients, Jinja2 templating, and testing with pytest.

Pick one and write it →

All runnable scripts are in examples/.

Contributing

This guide is written by the community. Fixing a typo is as welcome as writing a new chapter. Merged chapters appear on the website automatically. Read CONTRIBUTING.md to get started, or open an issue to propose a topic.

Credits

Licensed under the terms in LICENSE.

About

A practical, community-driven guide to Python 3 for system administrators and DevOps engineers

Topics

Resources

Contributing

Stars

249 stars

Watchers

13 watching

Forks

Contributors

Languages