Skip to main content

ccnl-engine

PyPI version Python CI Coverage License: MIT

A Python library for modeling Italian collective labor agreements (CCNL) as structured, versioned data and computing gross-to-net salary and employer cost from first principles.

Interactive demo · Documentation · CCNL coverage

Why

Italian payroll is governed by collective agreements (CCNL) that define base salaries, seniority increments, and allowances as time-series values — they change at negotiated renewal dates. Existing tools either lock this data inside proprietary systems or require a full HRMS. This library treats each CCNL as a validated JSON file and the computation as a pure function:

compute(ccnl, rules, employee) → Payslip

Quickstart

from datetime import date
from ccnl_engine import (
    ContractPosition, Employee, Permanent,
    WorkArrangement, compute, load_ccnl, load_year_rules,
)

ccnl = load_ccnl("commercio-confcommercio.json")
rules = load_year_rules(2026, ccnl.meta.tax_sector, num_employees=50)
employee = Employee(
    position=ContractPosition(
        level_code="4",
        as_of=date(2026, 9, 1),
        employment=Permanent(),
    ),
    arrangement=WorkArrangement(),
)
payslip = compute(ccnl, rules, employee)

print(payslip.net_annual)              # → Decimal('...')
print(payslip.trattamento_integrativo) # → Decimal('...') — Art. 1 D.L. 3/2020 bonus
print(payslip.fiscal_simplifications)  # → frozenset of items not computed by the engine
print(payslip.employer_cost_annual)    # → Decimal('...')

CCNL coverage

85 contracts covering ~15 million employees across private and public sectors.

→ Full CCNL coverage table

What is not modelled

  • Detrazioni per carichi di famiglia (Art. 12 TUIR)
  • Bilateral system contributions (EST, Fon.Te, …)
  • Overtime, night/holiday premiums, leave accruals, sick-pay integrations
  • Preferential 5% tax on premio di risultato (Art. 1 c. 182 L. 208/2015)

See API docs for full detail.

Disclaimer

This library is not legal or tax advice. Figures are computed from publicly available CCNL tables and statutory rates as of the dates indicated in the data files. Always verify results against official sources or a qualified payroll professional.

Metadata

Release files for ccnl-engine 0.3.1

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

Source distribution (sdist)

Source distribution for ccnl-engine 0.3.1
File Size Uploaded
ccnl_engine-0.3.1.tar.gz 384.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ccnl-engine 0.3.1
File Interpreter ABI Platform
ccnl_engine-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 767.7 kB

Release files / ccnl_engine-0.3.1.tar.gz

Download URL ccnl_engine-0.3.1.tar.gz
Size 384.1 kB
Tags Source
SHA-256 checksum
How to use checksums
da4704428a4ef24e25edbd6d5d5dca00b11d03325f91669ec4455f8ceeb435bb
BLAKE2b-256 checksum
How to use checksums
9528b0e3b7bea6388fb955d2445a423e7cacb0b9c1198d839ef80cf509878379
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 6, 2026.

Transparency log

Release files / ccnl_engine-0.3.1-py3-none-any.whl

Download URL ccnl_engine-0.3.1-py3-none-any.whl
Size 383.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
330f08114a6eb4c7db447ed041f71131bfee2f89937db1daf3c1ff54781f419e
BLAKE2b-256 checksum
How to use checksums
80c7e02187fd421fc36f82c43b2785b8cf75450e61deeeea2d086c77782473ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 6, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

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