# RFM Package
A Python package for Recency, Frequency, Monetary model (RFM), which is an analysis is a behavior based technique used
to segment customers by examining their transaction history.
* how recently a customer has purchased (Recency)
* how often they purchase (Frequency)
* how much the customer spends (Monetary)
## License
* Free software: MIT license
* Documentation: https://rfm-package.readthedocs.io.
## Installation
You can install the package using
```
pip install rfm_package
```
## Usage Test
```
orders = pd.read_csv(r'C:/Users/Admin/Desktop/RFM-Package/rfm_package/data/orders.csv', parse_dates = ['order_date'])
columns = create_rfm_columns(orders, "customer_id", "order_date", "revenue")
print(columns)
scaled = scale_rfm_columns(columns)
print(scaled)
plot_rfm(scaled)
scores = rfm_scores(scaled)
print(rfm_scores(scaled))
named_segments = give_names_to_segments(scores)
print(named_segments)
dist = segments_distribution(named_segments)
print(dist)
visualize_segments(dist)
```
## Credits
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
=======
History
=======
0.1.0 (2022-12-15)
------------------
* First release on PyPI.
Raw data
{
"_id": null,
"home_page": "https://github.com/astghik-k/rfm_package",
"name": "rfm-package",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "rfm_package",
"author": "Astghik Kostanyan",
"author_email": "kostanyan.astghik@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f0/02/2ca6209fb42f8f0166beeb3e188b9fd2b4d427057c78351b2a02810dbe1c/rfm_package-0.1.0.tar.gz",
"platform": null,
"description": "\r\n# RFM Package\r\n\r\nA Python package for Recency, Frequency, Monetary model (RFM), which is an analysis is a behavior based technique used\r\nto segment customers by examining their transaction history.\r\n\r\n* how recently a customer has purchased (Recency)\r\n* how often they purchase (Frequency)\r\n* how much the customer spends (Monetary)\r\n\r\n\r\n## License\r\n\r\n* Free software: MIT license\r\n* Documentation: https://rfm-package.readthedocs.io.\r\n\r\n## Installation\r\nYou can install the package using\r\n```\r\npip install rfm_package\r\n\r\n```\r\n\r\n## Usage Test\r\n\r\n```\r\norders = pd.read_csv(r'C:/Users/Admin/Desktop/RFM-Package/rfm_package/data/orders.csv', parse_dates = ['order_date'])\r\n\r\ncolumns = create_rfm_columns(orders, \"customer_id\", \"order_date\", \"revenue\")\r\nprint(columns)\r\n\r\nscaled = scale_rfm_columns(columns)\r\nprint(scaled)\r\n\r\nplot_rfm(scaled)\r\n\r\nscores = rfm_scores(scaled)\r\nprint(rfm_scores(scaled))\r\n\r\nnamed_segments = give_names_to_segments(scores)\r\nprint(named_segments)\r\n\r\ndist = segments_distribution(named_segments)\r\nprint(dist)\r\n\r\nvisualize_segments(dist)\r\n\r\n```\r\n\r\n## Credits\r\n\r\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\r\n\r\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\r\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\r\n\r\n\r\n=======\r\nHistory\r\n=======\r\n\r\n0.1.0 (2022-12-15)\r\n------------------\r\n\r\n* First release on PyPI.\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "A Python package for Recency, Frequency, Monetary model (RFM)",
"version": "0.1.0",
"split_keywords": [
"rfm_package"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "dd9aad61e2d491e82b06a11899059622",
"sha256": "ef85cc89c49cb36ae7dd886f0edf9e6261793f3b2ecd7bf2c2fab73c300c27a4"
},
"downloads": -1,
"filename": "rfm_package-0.1.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "dd9aad61e2d491e82b06a11899059622",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6",
"size": 3094,
"upload_time": "2022-12-16T16:03:36",
"upload_time_iso_8601": "2022-12-16T16:03:36.918239Z",
"url": "https://files.pythonhosted.org/packages/5d/f8/f9b35172777eb49db1bb8ec05f7374dac438a20ee1a7eb77a3fd308baebf/rfm_package-0.1.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "4afa09b17e3e0dff02afa17e98f55ebf",
"sha256": "a8077a437d9530201a7203eb829c2e29f102f13e474db72b55c4f9c9b2711813"
},
"downloads": -1,
"filename": "rfm_package-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "4afa09b17e3e0dff02afa17e98f55ebf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 9269,
"upload_time": "2022-12-16T16:03:39",
"upload_time_iso_8601": "2022-12-16T16:03:39.145546Z",
"url": "https://files.pythonhosted.org/packages/f0/02/2ca6209fb42f8f0166beeb3e188b9fd2b4d427057c78351b2a02810dbe1c/rfm_package-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-16 16:03:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "astghik-k",
"github_project": "rfm_package",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "rfm-package"
}