
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
ABC classification is an inventory categorisation technique. A typical example of ABC classification is the segmentation of products (entity) based on sales (value). The best-selling products that contribute to up to 70% of the total sales belong to cluster A. The products making up the next 20% of sales are in cluster B, whereas the products representing the last 10% of sales, belong to class C. Hence, the pattern is named after the three clusters (ABC).
Installation
pip install abc-classification
Import
from abc_classification.abc_classifier import ABCClassifier
Let's say we have dataframe
| product | total sold |
|---|---|
| fade cream | 27000 |
| powders | 24000 |
| shadows | 18000 |
| mascara | 16000 |
| lipstick | 6000 |
| concealer | 5000 |
| sculptors | 4000 |
You can create ABCClasifier object, pass your dataframe to it and call classify method.
abc_clf = ABCClassifier(df)
abc_df = abc_clf.classify('product', 'total sold')
This way you'll get new dataframe with classified products.
| product | total sold | class |
|---|---|---|
| fade cream | 27000 | A |
| powders | 24000 | A |
| shadows | 18000 | A |
| mascara | 16000 | B |
| lipstick | 6000 | B |
| concealer | 5000 | C |
| sculptors | 4000 | C |
You also can use brief_abc method to get aggregated information
abc_clf.brief_abc(abc_df)
| class | total sold |
|---|---|
| A | 69000 |
| B | 16000 |
| C | 15000 |
You can plot pareto chart.
from abc_classification.abc_visualiser import pareto_chart
pareto_chart(abc_df, 'total_sold', 'product')

FAQs
A package for ABC classification
We found that abc-classification demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.

Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.

Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.