Skip to main content
sosw - a framework for bootstrapping AWS Lambda functions

sosw

Tests Docs PyPI - Downloads PyPI - Licence

sosw is a Python framework for bootstrapping AWS Lambda functions.

Every Lambda gets the same production-grade skeleton in a dozen lines: the Processor base class with layered configuration (code defaults + DynamoDB/SSM overrides), automatic initialization of AWS clients, statistics counters, and a generated handler that caches the Processor across warm invocations. On top of that: LambdaApi — a declarative router for functions behind API Gateway, optional AWS durable execution support, and a battle-tested library of components and helpers. The only runtime dependency is boto3.

Quick example

from sosw.app import LambdaGlobals, get_lambda_handler, Processor as SoswProcessor


class Processor(SoswProcessor):

    DEFAULT_CONFIG = {
        'init_clients': ['sts'],    # Automatically initialize `self.sts_client`.
    }

    sts_client = None


    def __call__(self, event, **kwargs):
        super().__call__(event)
        return {'account': self.sts_client.get_caller_identity()['Account']}


global_vars = LambdaGlobals()
lambda_handler = get_lambda_handler(Processor, global_vars)

The Processor initializes once per Lambda container; warm invocations reuse it. Configuration can be overridden per function through the DynamoDB config table or SSM — no redeployment needed.

Installation

pip install sosw                # Python 3.12 - 3.14
pip install sosw[durable]       # + AWS durable execution support

Documentation

https://docs.sosw.app

Coming from the 0.7.x line?

sosw began as the Serverless Orchestrator of Serverless Workers. The self-hosted orchestration layer (Orchestrator, Scheduler, Scavenger, Worker, and their managers) was removed in the 3.0 major release. Teams that use it should pin pip install 'sosw<3' (the 0.7.x line keeps working, and its docs are preserved at docs.sosw.app/previous/0.7.51) and plan the move to AWS Step Functions, EventBridge Scheduler, or durable functions — guidance in the migration guide.

Development

Getting started

Either pipenv:

pipenv sync --dev && pipenv shell

or plain pip in any virtual environment:

pip install boto3 pytest pytest-cov -r docs/requirements.txt

All package metadata lives in pyproject.toml (there is no setup.py).

Running tests

The unit suite is explicitly registered in sosw/test/suite_unit.py — new test files must be added there. It runs fully mocked (no AWS access) and is enforced at 100% line coverage in CI:

pytest ./sosw/test/suite_unit.py
pytest ./sosw/test/suite_unit.py --cov=sosw --cov-report=term-missing

Building the docs

pip install -r docs/requirements.txt
python -m sphinx -W -a -b html docs sosw-rtd; (cd sosw-rtd && python -m http.server)

Contribution guidelines

The full Contribution Guidelines with examples are in the documentation.

Release cycle

We follow both the Semantic Versioning pattern and PEP440 recommendations where they comply:

  • Branches for planned staging versions follow the pattern X_Y_Z (Major_Minor_Micro), e.g. 3_0_1.
  • Make your pull request against the closest staging branch (the smallest version after the latest release, of either the current or the next Minor).
  • Pushes to staging branches automatically publish release candidates to TestPyPI.
  • master merges are automatically packaged and published to PyPI.
  • Keep your branch up to date with the branch you are making a PR to.

Example: if the latest released version on PyPI is 3.4.0, the open staging branches are 3_4_1 and 3_5_0. A bugfix PR targets 3_4_1; a new feature targets 3_5_0.

Code style

Follow PEP8, with the following specifications:

  • both classes and functions are padded with 2 empty lines
  • dictionaries are value-aligned

Copyright

This document has been placed in the public domain.

sosw - a framework for bootstrapping AWS Lambda functions

The MIT License (MIT)
Copyright (C) 2026  sosw core contributors <info@sosw.app>:
    Nikolay Grishchenko
    Sophie Fogel
    Gil Halperin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sosw-3.0.0.tar.gz (63.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sosw-3.0.0-py3-none-any.whl (75.2 kB view details)

Uploaded Python 3

File details

Details for the file sosw-3.0.0.tar.gz.

File metadata

  • Download URL: sosw-3.0.0.tar.gz
  • Upload date:
  • Size: 63.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sosw-3.0.0.tar.gz
Algorithm Hash digest
SHA256 1a75a646c147d8a8db0ee402abc4aee00ec54d8d35b030a89e415d03d651624a
MD5 3d9cfafb18ba061ceafd64bab5e09b61
BLAKE2b-256 90deb8a3b6b10cae266e9a3645f5605a08fcd59633f6171173af342b27a521f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for sosw-3.0.0.tar.gz:

Publisher: publish-to-pypi.yml on sosw/sosw

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sosw-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: sosw-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 75.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sosw-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 293090bfe5419826e19fee7848180dbcddda14244f4a9703145bffe76a4a19e8
MD5 a1e2945e9e0c4c3e6934ea6a7337f7e1
BLAKE2b-256 d7336344c55345ef0d5b0b1e6ece81cce049fef74c364e9e53d90fc430266598

See more details on using hashes here.

Provenance

The following attestation bundles were made for sosw-3.0.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on sosw/sosw

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page