Skip to main content

Downloads License Python

Pali

Pali (Python Applications Lightweight Initiator) is a lightweight foundation library for Python Applications. Built entirely in native Python with zero dependencies.

Python applications repeatedly solve the same infrastructure problems—configuration, logging, concurrency, persistence, data pipelines, and service lifecycle management. Pali provides a lightweight, dependency-free collection of reusable building blocks for these common application patterns, allowing developers to focus on application logic instead of reinventing infrastructure. Adopt only the components you need, with no hidden framework overhead.

Start with Quick Start to see how fast it is to build with Pali.

Why Pali?

  • ✅ Lightweight — Minimal footprint, no external dependencies.
  • ✅ Native Python — Pure Python implementation, works well in constrained and dependency-sensitive environments (e.g. ESX).
  • ✅ 12-factor friendly — Designed for config, concurrency, logging, and disposability.
  • ✅ Production-tested — Real-world utilities refined over years.
  • ✅ Modular — Import only what you use.

When should I consider Pali ?

Pali is a good fit when you are building:

  • Infrastructure automation
  • DevOps tooling
  • Background workers
  • Long-running daemons
  • Backend services
  • Microservices
  • Batch processing applications
  • Data pipelines
  • Integration services
  • CLI utilities

Micro-Examples

Structured logging — Standardized application logging:

from pali import setup_logging, getLogger

# Setup logging once when application starts. 
setup_logging(log_dir="./", log_file="my_app.log")

# Now every module can get logger and add logs.
log = getLogger(__name__)
log.info('Application started')

Configuration management — Load and validate settings:

# Define a .ini format based Config file for application.
# config/pali.cfg
[DEFAULT]
debug = true

[DATABASE]
host = localhost
port = 5432
from pali import ConfigManager

# Initialize ConfigManager with app config file.
cfg = ConfigManager('config/pali.cfg')

# Read a value from the DATABASE section
db_host = cfg.get('DATABASE', 'host')

# Read a default value from the DEFAULT section
debug = cfg.get('DEFAULT', 'debug')

Data pipelines — Sequential processing stages:

from pali import Pipeline, Stage

class HeatWaterStage(Stage):
    def __init__(self):
        super(HeatWaterStage, self).__init__('Heat Water')

    def run(self, data):
        data['temperature'] = 100
        data['state'] = 'water heated'

class AddTeaStage(Stage):
    def __init__(self):
        super(AddTeaStage, self).__init__('Add Tea')

    def run(self, data):
        data['tea'] = 'green'
        data['state'] = 'tea added'

class SteepTeaStage(Stage):
    def __init__(self):
        super(SteepTeaStage, self).__init__('Steep Tea')

    def run(self, data):
        data['steeped'] = True
        data['state'] = 'tea steeped'

class ServeTeaStage(Stage):
    def __init__(self):
        super(ServeTeaStage, self).__init__('Serve Tea')

    def run(self, data):
        data['served'] = True
        data['result'] = 'cup of tea ready'

pipeline = Pipeline(
    name='TeaPipeline',
    stages=[HeatWaterStage(), AddTeaStage(), SteepTeaStage(), ServeTeaStage()],
    data={'cup': 'empty'}
)
pipeline._run()
print(pipeline.data)

Parallel task execution — Process items concurrently:

from pali import Task, ThreadPool

class ProcessItem(Task):
    def _run(self):
        self.result = expensive_operation(self.data)

items = [1, 2, 3]
tasks = [ProcessItem(item) for item in items]
with ThreadPool(4) as pool:
    for t in tasks:
        pool.append_task(t)
results = [t.result for t in tasks]

Requirements

  • Python 2.7+ or Python 3.4+
  • No external dependencies

Contributing

See the Contributing Guide for details.

Support

License

Pali is licensed under the MIT License. See LICENSE for details.

Changelog

See CHANGELOG.md for version history and release notes.

Acknowledgments

Pali was built with simplicity and ease of use in mind. It draws inspiration from various threading and task queue libraries while maintaining a minimal footprint and zero external dependencies.


Ready to get started? Check out the Quick Start Guide!

Metadata

Release files for pali 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pali 1.1.0
File Size Uploaded Provenance
pali-1.1.0.tar.gz 35.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pali 1.1.0
File Interpreter ABI Platform
pali-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 80.5 kB

Release files / pali-1.1.0.tar.gz

Download URL pali-1.1.0.tar.gz
Size 35.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a790c6f64ce14945ee4fb3ed365543d035f15b0924037aa8b0baf0eb674a0a7f
BLAKE2b-256 checksum
How to use checksums
d10aabc2121b7e611fedfca324c1a655afa286ed7d03d5979902ae4e416a1c7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / pali-1.1.0-py3-none-any.whl

Download URL pali-1.1.0-py3-none-any.whl
Size 45.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6ebf6bdc18fe982283ccfe845ca3e6bcbb305ff6ca3a10f74cf9305399bf095
BLAKE2b-256 checksum
How to use checksums
5189a5c1c1e376ec462bfd3eba17648498f6615c65150e5e8b0b3c1a73e0fa98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for pali 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page