Skip to main content

jobmargin

Know which jobs actually made money. A CSV in, per-job P&L out: margin, markup, break-even revenue, portfolio totals, and a floor check that fails the run when a job lands under your minimum margin.

Install

pip install jobmargin

Compute job margins

jobs.csv:

job,revenue,labour_hours,labour_rate,materials,subs,other,overhead_pct
Kitchen,10000,40,50,2000,1000,500,10
Bath,8000,30,50,1500,500,0,10
jobmargin compute jobs.csv --min-margin 0.25
job                   revenue       cost     profit    margin    markup
--------------------------------------------------------------------
Kitchen             10,000.00   6,050.00   3,950.00    39.5%    65.3%
Bath                 8,000.00   4,650.00   3,350.00    41.9%    72.0%
--------------------------------------------------------------------
PORTFOLIO           18,000.00  10,700.00   7,300.00    40.6%

0 job(s) below the 25% floor: none

Exit 1 when any job is below --min-margin — drop it into a weekly cron and find the leak before the quarter ends. Defaults for missing columns come from --overhead-pct and friends; --json for automation.

Price to a target margin

jobmargin price 600 --target-margin 0.4
# Cost 600.00 at 40% margin -> price 1,000.00 (profit 400.00)

The target is a fraction of the price (40% margin ≠ 40% markup): price = cost / (1 − margin).

Break-even

jobmargin breakeven --fixed 1000 --price 50 --variable 30
# Break-even: 50.00 units at 50.00 (revenue 2,500.00)

The formulas

Metric Definition
total cost labour (hours × rate) + materials + subs + other + overhead (overhead_pct of direct costs + fixed)
margin profit ÷ revenue
markup profit ÷ cost
break-even revenue (a job) equals its cost — job costs are fixed once scope is fixed
break-even units fixed ÷ (price − variable per unit)

Zero-revenue jobs report margin as — rather than dividing by zero, and count as "below any floor" so they can't hide.

Notes

  • Pure stdlib, single file of inputs, deterministic output — safe to pipe into spreadsheets or dashboards.
  • Currencies are unitless: pass everything in the same dollars.
  • Pairs well with holdbackcalc (deadline cash drag) and gstwatch (threshold tracking) for a small-operator finance kit.

License

MIT-style: use it, ship it, no warranty.

Metadata

Release files for jobmargin 0.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 jobmargin 0.1.0
File Size Uploaded Provenance
jobmargin-0.1.0.tar.gz 8.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 16.3 kB

Release files / jobmargin-0.1.0.tar.gz

Download URL jobmargin-0.1.0.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
61355c14f611065c57adf4a491186cc273e8f2173d1bf7da65ac7c456caead26
BLAKE2b-256 checksum
How to use checksums
27239279406046fe0bca68c6faf704116562f1b3462f44d8305f3f615cabee29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / jobmargin-0.1.0-py3-none-any.whl

Download URL jobmargin-0.1.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a58196dce58c18edd6797b7915529638518c30161df6033067bbd7ee75f8ed0a
BLAKE2b-256 checksum
How to use checksums
7a587746c808e1c800c9f3e711da4dbcef87d08faace772adec211500f2fcc86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for jobmargin 0.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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