A practical, step-by-step roadmap to learn how to:
- Build reusable Python SDKs
- Package and publish them
- Use them in Jenkins pipelines
- Automate real-world SRE workflows (alerts, infra, APIs)
๐ง Big Picture Architecture
Python Script โ Internal SDK โ HTTP API โ External System โ Jenkins (cron/scheduled execution)
You are learning how to build internal automation platforms, not just scripts.
๐ Phase 1: Python Foundations (Automation-Focused)
What to Learn
- Functions, modules, imports
- Virtual environments (venv)
- JSON & YAML handling
- Exception handling
- Basic classes & objects
Resources
- ๐ Automate the Boring Stuff with Python ๐https://automatetheboringstuff.com/
- ๐ Python Crash Course ๐ https://ehmatthes.github.io/pcc/
- ๐ Real Python (Core Concepts) ๐ https://realpython.com/
๐ Phase 2: APIs First (Before SDKs)
What to Learn
- HTTP methods: GET, POST, DELETE
- Headers & authentication
- JSON request/response
- Status codes
- Timeouts & Retries
Resources
๐ MDN HTTP Guide
๐ https://developer.mozilla.org/en-US/docs/Web/HTTP๐ฆ Python requests Library
๐ https://docs.python-requests.org/โก FastAPI Tutorial (API understanding)
๐ https://fastapi.tiangolo.com/
๐งช Practice
Write a script that:
- Calls an API
- Fetches data
- Sends POST request
- Deletes a resource
๐ฆ Phase 3: Python Packaging (VERY IMPORTANT)
What to Learn
- setup.py vs pyproject.toml
- pip install mechanics
- wheel format
- package versioning
- private package repositories
Resources
๐ Python Packaging User Guide
๐ https://packaging.python.org/๐ฆ setuptools Documentation
๐ https://setuptools.pypa.io/๐ฆ Poetry Documentation
๐ https://python-poetry.org/docs/๐ฆ Twine (Publishing Packages)
๐ https://twine.readthedocs.io/๐ Real Python Packaging Guide
๐ https://realpython.com/pypi-publish-python-package/
๐งช Practice
- Create a Python package
- Build it (
python -m build) - Install locally using
pip - Import it in another project
๐๏ธ Phase 4: Building SDK-Style Code
What to Learn
- Class-based design
- Client abstraction
- BaseClient pattern
- Error handling
- Code structure
Typical SDK Structure
my_sdk/
โโโ client.py
โโโ base_client.py
โโโ models.py
โโโ exceptions.py
โโโ utils.py
โโโ init.py
Resources
๐ Clean Code in Python
๐ https://www.packtpub.com/product/clean-code-in-python/9781788835831๐ Cosmic Python (Architecture)
๐ https://www.cosmicpython.com/๐ Fluent Python (Advanced)
๐ https://www.oreilly.com/library/view/fluent-python/9781492056348/
๐งช Practice
Build a client like:
client = MonitoringClient()
client.create_event()
client.get_events()
client.delete_event()
โ๏ธ Phase 5: Jenkins + Python Integration
What to Learn
- Jenkins pipelines (Jenkinsfile)
- Running Python scripts
- Environment variables
- Cron scheduling
- Dependency installation (pip in pipeline)
Resources
๐ Jenkins Pipeline Docs
๐ https://www.jenkins.io/doc/book/pipeline/๐ KodeKloud Jenkins Course
๐ https://kodekloud.com/courses/jenkins/
๐งช Practice
Create pipeline:
- Install package via pip
- Run Python script
- Capture output
- Trigger via cron
๐งช Phase 6: Testing (CRITICAL for SRE)
What to Learn
- pytest basics
- mocking APIs
- testing client methods
- safe execution patterns
Resources
๐ฆ pytest Documentation
๐ https://docs.pytest.org/๐ Python Testing with pytest
๐ https://pragprog.com/titles/bopytest/python-testing-with-pytest/๐ Real Python Testing Guide
๐ https://realpython.com/pytest-python-testing/
โก Phase 7: Async Python (Advanced)
What to Learn
- async / await
- event loop
- concurrent API calls
- async HTTP clients
Resources
๐ Real Python Async Guide
๐ https://realpython.com/async-io-python/๐ Python asyncio Docs
๐ https://docs.python.org/3/library/asyncio.html๐ฆ HTTPX (async HTTP client)
๐ https://www.python-httpx.org/
๐งฑ Real-World Pattern You Are Learning
This pattern is used everywhere in platform engineering:
- Internal Python SDK
- Published as package
- Stored in private repo
- Installed in pipelines
- Used for automation tasks
- Triggered via cron
๐ฅ Mini Project (Must Do)
Project: Monitoring Automation SDK
Structure
monitoring-sdk/
โโโ monitoring_client/
โ โโโ client.py
โ โโโ base_client.py
โ โโโ models.py
โ โโโ exceptions.py
โ โโโ utils.py
โโโ scripts/
โ โโโ create_event.py
โ โโโ cleanup_event.py
โโโ tests/
โโโ pyproject.toml
โโโ Jenkinsfile
Features
- Create event (POST)
- List events (GET)
- Delete event (DELETE)
- Package SDK
- Install via pip
- Run via Jenkins
๐ 7-Day Fast-Track Plan
Day 1
- Learn venv, pip
- Run Python scripts
Day 2
- Learn requests
- Call an API
Day 3
- Write API client class
Day 4
- Convert to package
Day 5
- Install package locally
Day 6
- Write automation script
Day 7
- Run via Jenkins pipeline
๐ง Final Insight
You are not learning Python.
You are learning to build:
๐ Internal Developer Platforms
๐ Automation of Toolings,API and Systems
๐ Reusable Engineering Tools used internally and are created using Python
This is exactly what strong SREs/DevOps and Platform Engineers do.
This is how in future you can even contribute to Open Source Software
๐ Next Step : Coming Soon (WIP)
๐ A complete working project template (SDK + Jenkins + API mock).
๐ Tailored to this above workflow.
Just share it further on LinkedIn, Substack ๐
Top comments (0)