{"id":47939682,"url":"https://github.com/jrasband-dev/metric-forge","last_synced_at":"2026-04-04T07:58:59.510Z","repository":{"id":237356241,"uuid":"794372370","full_name":"jrasband-dev/metric-forge","owner":"jrasband-dev","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-02T02:15:30.000Z","size":2095,"stargazers_count":7,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-04T07:58:57.627Z","etag":null,"topics":["math","metrics","polars","polars-dataframe","pypi","pypi-package","python"],"latest_commit_sha":null,"homepage":"https://docs.metric-forge.com/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jrasband-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-01T02:15:39.000Z","updated_at":"2025-10-14T05:14:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"c062bf3f-7b2a-4118-93ad-4bc60aa2727e","html_url":"https://github.com/jrasband-dev/metric-forge","commit_stats":null,"previous_names":["jrasband-dev/metric-forge"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/jrasband-dev/metric-forge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrasband-dev%2Fmetric-forge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrasband-dev%2Fmetric-forge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrasband-dev%2Fmetric-forge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrasband-dev%2Fmetric-forge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jrasband-dev","download_url":"https://codeload.github.com/jrasband-dev/metric-forge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrasband-dev%2Fmetric-forge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31392188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T04:26:24.776Z","status":"ssl_error","status_checked_at":"2026-04-04T04:23:34.147Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["math","metrics","polars","polars-dataframe","pypi","pypi-package","python"],"created_at":"2026-04-04T07:58:55.620Z","updated_at":"2026-04-04T07:58:59.502Z","avatar_url":"https://github.com/jrasband-dev.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metric Forge\n\n\u003cimg src=\"https://raw.githubusercontent.com/jrasband-dev/metric-forge/fb6a5ed63c35eda1443c3e6cedd9b4f4b18d5e41/static/metric-forge.svg\" alt=\"Description of the image\" width=\"300\" height=\"300\"\u003e\n\nMetric Forge is your ultimate toolkit for measuring and evaluating performance across various business domains.\n\n### Disclaimer\n\nMetric Forge provides a collection of calculations across various domains, including finance, mortgage, marketing, and more. While every effort has been made to ensure the accuracy and reliability of the calculations and methods provided, Metric Forge is intended for informational and educational purposes only.\n\nImportant Notice:\n\nNo Warranty: The calculations and methods provided in this package are offered \"as-is\" without any guarantees or warranties of any kind, either express or implied. The package's creators do not assume any responsibility for errors or omissions or for any damages resulting from the use of the package.\n\nNot Professional Advice: The results produced by the package should not be considered as professional financial, investment, legal, or any other type of advice. Users should consult with qualified professionals before making any decisions based on the outputs generated by this package.\n\nUse at Your Own Risk: Users of Metric Forge assume full responsibility for the use of the package and its results. The creators of the package shall not be held liable for any decisions made based on the information provided or for any consequences arising from the use of the package.\n\nBy using this package, you acknowledge and agree to this disclaimer. If you do not agree, please refrain from using the Metric Forge package.\n\n\n## Getting Started \ninstall the package via pip\n\n```python\npip install metric-forge\n```\n\n## Ecommerce\nYou can use Ecommerce Metrics in two different ways:\n* With Polars\n* As a Single Value Function (SVF)\n\nMetric Forge extends the Polars expression library; making it possible to perform row-wise-calculations for various metrics. In addition to mass calculations, you can also perform single value calculations that return just one value. \n\n\n```python\nfrom metric_forge.ecommerce import * \nimport polars as pl\ndata = pl.read_csv('datasets/ecommerce_metrics.csv')\ndata.head()\n```\n\n\n\n\n\u003cdiv\u003e\u003cstyle\u003e\n.dataframe \u003e thead \u003e tr,\n.dataframe \u003e tbody \u003e tr {\n  text-align: right;\n  white-space: pre-wrap;\n}\n\u003c/style\u003e\n\u003csmall\u003eshape: (5, 15)\u003c/small\u003e\u003ctable border=\"1\" class=\"dataframe\"\u003e\u003cthead\u003e\u003ctr\u003e\u003cth\u003emonth\u003c/th\u003e\u003cth\u003etotal_revenue\u003c/th\u003e\u003cth\u003enumber_of_orders\u003c/th\u003e\u003cth\u003ecost_of_acquisition\u003c/th\u003e\u003cth\u003enew_customers\u003c/th\u003e\u003cth\u003ecarts_created\u003c/th\u003e\u003cth\u003ecompleted_purchases\u003c/th\u003e\u003cth\u003erevenue_from_ads\u003c/th\u003e\u003cth\u003eadvertising_spend\u003c/th\u003e\u003cth\u003enum_conversions\u003c/th\u003e\u003cth\u003enum_visitors\u003c/th\u003e\u003cth\u003erevenue_per_customer\u003c/th\u003e\u003cth\u003eaverage_customer_lifetime\u003c/th\u003e\u003cth\u003enum_customers_lost\u003c/th\u003e\u003cth\u003etotal_customers_beginning\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003estr\u003c/td\u003e\u003ctd\u003ef64\u003c/td\u003e\u003ctd\u003ei64\u003c/td\u003e\u003ctd\u003ef64\u003c/td\u003e\u003ctd\u003ei64\u003c/td\u003e\u003ctd\u003ei64\u003c/td\u003e\u003ctd\u003ei64\u003c/td\u003e\u003ctd\u003ef64\u003c/td\u003e\u003ctd\u003ef64\u003c/td\u003e\u003ctd\u003ei64\u003c/td\u003e\u003ctd\u003ei64\u003c/td\u003e\u003ctd\u003ef64\u003c/td\u003e\u003ctd\u003ef64\u003c/td\u003e\u003ctd\u003ei64\u003c/td\u003e\u003ctd\u003ei64\u003c/td\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u0026quot;2023-01\u0026quot;\u003c/td\u003e\u003ctd\u003e87454.011885\u003c/td\u003e\u003ctd\u003e991\u003c/td\u003e\u003ctd\u003e22958.350559\u003c/td\u003e\u003ctd\u003e406\u003c/td\u003e\u003ctd\u003e1969\u003c/td\u003e\u003ctd\u003e1425\u003c/td\u003e\u003ctd\u003e81339.957696\u003c/td\u003e\u003ctd\u003e5390.910169\u003c/td\u003e\u003ctd\u003e300\u003c/td\u003e\u003ctd\u003e13154\u003c/td\u003e\u003ctd\u003e202.427329\u003c/td\u003e\u003ctd\u003e3.159364\u003c/td\u003e\u003ctd\u003e239\u003c/td\u003e\u003ctd\u003e3306\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u0026quot;2023-02\u0026quot;\u003c/td\u003e\u003ctd\u003e145071.430641\u003c/td\u003e\u003ctd\u003e913\u003c/td\u003e\u003ctd\u003e18736.874206\u003c/td\u003e\u003ctd\u003e234\u003c/td\u003e\u003ctd\u003e1506\u003c/td\u003e\u003ctd\u003e1421\u003c/td\u003e\u003ctd\u003e76875.083402\u003c/td\u003e\u003ctd\u003e15585.037018\u003c/td\u003e\u003ctd\u003e427\u003c/td\u003e\u003ctd\u003e14762\u003c/td\u003e\u003ctd\u003e116.173436\u003c/td\u003e\u003ctd\u003e1.812245\u003c/td\u003e\u003ctd\u003e124\u003c/td\u003e\u003ctd\u003e4680\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u0026quot;2023-03\u0026quot;\u003c/td\u003e\u003ctd\u003e123199.394181\u003c/td\u003e\u003ctd\u003e1305\u003c/td\u003e\u003ctd\u003e28355.586842\u003c/td\u003e\u003ctd\u003e120\u003c/td\u003e\u003ctd\u003e1497\u003c/td\u003e\u003ctd\u003e965\u003c/td\u003e\u003ctd\u003e116505.482191\u003c/td\u003e\u003ctd\u003e14872.037954\u003c/td\u003e\u003ctd\u003e367\u003c/td\u003e\u003ctd\u003e10056\u003c/td\u003e\u003ctd\u003e384.265156\u003c/td\u003e\u003ctd\u003e4.771414\u003c/td\u003e\u003ctd\u003e177\u003c/td\u003e\u003ctd\u003e4675\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u0026quot;2023-04\u0026quot;\u003c/td\u003e\u003ctd\u003e109865.84842\u003c/td\u003e\u003ctd\u003e885\u003c/td\u003e\u003ctd\u003e14184.81582\u003c/td\u003e\u003ctd\u003e428\u003c/td\u003e\u003ctd\u003e1963\u003c/td\u003e\u003ctd\u003e1102\u003c/td\u003e\u003ctd\u003e106008.046381\u003c/td\u003e\u003ctd\u003e12337.204368\u003c/td\u003e\u003ctd\u003e132\u003c/td\u003e\u003ctd\u003e19948\u003c/td\u003e\u003ctd\u003e144.356328\u003c/td\u003e\u003ctd\u003e3.395462\u003c/td\u003e\u003ctd\u003e299\u003c/td\u003e\u003ctd\u003e2972\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u0026quot;2023-05\u0026quot;\u003c/td\u003e\u003ctd\u003e65601.864044\u003c/td\u003e\u003ctd\u003e691\u003c/td\u003e\u003ctd\u003e18764.339456\u003c/td\u003e\u003ctd\u003e266\u003c/td\u003e\u003ctd\u003e1009\u003c/td\u003e\u003ctd\u003e801\u003c/td\u003e\u003ctd\u003e97258.809912\u003c/td\u003e\u003ctd\u003e5351.995568\u003c/td\u003e\u003ctd\u003e147\u003c/td\u003e\u003ctd\u003e13110\u003c/td\u003e\u003ctd\u003e275.734601\u003c/td\u003e\u003ctd\u003e3.77914\u003c/td\u003e\u003ctd\u003e296\u003c/td\u003e\u003ctd\u003e3768\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/div\u003e\n\n\n\n#### Customer Acquisition Cost\n\n\n```python\ndata.select(pl.col('cost_of_acquisition'),\n            pl.col('new_customers'),\n            pl.col('*').forge_ecommerce.customer_acquisition_cost('cost_of_acquisition', 'new_customers'))\n```\n\n#### Average Order Value\n\n\n```python\ndata.select(pl.col('total_revenue'),\n            pl.col('new_customers'),\n            pl.col('*').forge_ecommerce.average_order_value('total_revenue', 'number_of_orders'))\n```\n\n#### Cart Abandonment Rate\n\n\n```python\ndata.select(pl.col('carts_created'),\n            pl.col('completed_purchases'),\n            pl.col('*').forge_ecommerce.cart_abandonment_rate('carts_created', 'completed_purchases'))\n\n```\n\n#### Return on Advertising Spend\n\n\n```python\ndata.select(pl.col('revenue_from_ads'),\n            pl.col('advertising_spend'),\n            pl.col('*').forge_ecommerce.return_on_advertising_spend('revenue_from_ads', 'advertising_spend'))\n```\n\n#### Conversion Rate\n\n\n```python\ndata.select(pl.col('num_conversions'),\n            pl.col('num_visitors'),\n            pl.col('*').forge_ecommerce.conversion_rate('num_conversions', 'num_visitors'))\n```\n\n#### Customer Lifetime Value\n\n\n```python\ndata.select(pl.col('revenue_per_customer'),\n            pl.col('average_customer_lifetime'),\n            pl.col('*').forge_ecommerce.customer_lifetime_value(revenue_per_customer_column='revenue_per_customer',average_customer_lifetime_column='average_customer_lifetime',method='basic'))\n```\n\n\n\n\n\u003cdiv\u003e\u003cstyle\u003e\n.dataframe \u003e thead \u003e tr,\n.dataframe \u003e tbody \u003e tr {\n  text-align: right;\n  white-space: pre-wrap;\n}\n\u003c/style\u003e\n\u003csmall\u003eshape: (12, 3)\u003c/small\u003e\u003ctable border=\"1\" class=\"dataframe\"\u003e\u003cthead\u003e\u003ctr\u003e\u003cth\u003erevenue_per_customer\u003c/th\u003e\u003cth\u003eaverage_customer_lifetime\u003c/th\u003e\u003cth\u003ecustomer_lifetime_value\u003c/th\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003ef64\u003c/td\u003e\u003ctd\u003ef64\u003c/td\u003e\u003ctd\u003ef64\u003c/td\u003e\u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e202.427329\u003c/td\u003e\u003ctd\u003e3.159364\u003c/td\u003e\u003ctd\u003e639.54169\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e116.173436\u003c/td\u003e\u003ctd\u003e1.812245\u003c/td\u003e\u003ctd\u003e210.534716\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e384.265156\u003c/td\u003e\u003ctd\u003e4.771414\u003c/td\u003e\u003ctd\u003e1833.488253\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e144.356328\u003c/td\u003e\u003ctd\u003e3.395462\u003c/td\u003e\u003ctd\u003e490.156408\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e275.734601\u003c/td\u003e\u003ctd\u003e3.77914\u003c/td\u003e\u003ctd\u003e1042.039585\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u0026hellip;\u003c/td\u003e\u003ctd\u003e\u0026hellip;\u003c/td\u003e\u003ctd\u003e\u0026hellip;\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e290.148089\u003c/td\u003e\u003ctd\u003e2.182535\u003c/td\u003e\u003ctd\u003e633.258286\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e325.310229\u003c/td\u003e\u003ctd\u003e1.421977\u003c/td\u003e\u003ctd\u003e462.583676\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e378.206435\u003c/td\u003e\u003ctd\u003e2.826138\u003c/td\u003e\u003ctd\u003e1068.863683\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e155.732582\u003c/td\u003e\u003ctd\u003e1.873762\u003c/td\u003e\u003ctd\u003e291.805755\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e341.766952\u003c/td\u003e\u003ctd\u003e2.66604\u003c/td\u003e\u003ctd\u003e911.164293\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrasband-dev%2Fmetric-forge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjrasband-dev%2Fmetric-forge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrasband-dev%2Fmetric-forge/lists"}