Finomaly
PyPI & Source Code
PyPI: https://pypi.org/project/finomaly/
Source Code: https://github.com/Barisaksel/finomaly
Finomaly is a modular, open-source Python library for anomaly detection in financial transactions. It supports both rule-based and machine learning-based detection, multi-language reporting, and professional reporting formats.
🆕 NLP Modules & Language-Aware Message Management
TextEmbeddingAnomalyDetector
Provides text anomaly detection using TF-IDF vectorization and IsolationForest. All error and user messages are centrally managed and support multiple languages.
Usage:
from finomaly.nlp.embeddings import TextEmbeddingAnomalyDetector
# You can provide a list of texts, or an Excel file path and column name.
texts = ["Money transfer completed", "Credit card purchase", "Suspicious transaction"]
detector = TextEmbeddingAnomalyDetector(lang='en')
detector.fit(texts)
anomalies = detector.predict(["Very large amount transfer"])
print(anomalies)
# Or load texts directly from an Excel file:
# detector.fit('transactions.xlsx', column='Description')
# anomalies = detector.predict('new_transactions.xlsx', column='Description')
TransactionDescriptionClassifier
Categorizes transaction descriptions using TF-IDF and Logistic Regression. All messages are centrally managed and support multiple languages.
Usage:
from finomaly.nlp.text_classifier import TransactionDescriptionClassifier
# You can provide lists, or load from Excel file with text and label columns.
texts = ["Grocery shopping", "Bill payment", "ATM withdrawal"]
labels = ["Shopping", "Bill", "Cash"]
clf = TransactionDescriptionClassifier(lang='en')
clf.fit(texts, labels)
pred = clf.predict(["Electricity bill"])
print(pred)
# Or load texts and labels from Excel:
# import pandas as pd
# df = pd.read_excel('train.xlsx')
# clf.fit(df['Description'], df['Category'])
# pred = clf.predict(['Electricity bill'])
Multi-Language Support & Message Management
- All error and user messages are centrally managed in
finomaly/core/messages_config.jsonaccording to the selected language. - If a message key or language is missing, the system automatically returns the default English message without raising an error.
Requirements
- scikit-learn, pandas, numpy
- (For NLP) openpyxl (Excel support), language file: messages_config.json
Features
- Rule-based anomaly detection (JSON-configurable, customer-specific rules)
- Machine learning models: IsolationForest, RandomForest, XGBoost
- NLP modules: TextEmbeddingAnomalyDetector (text anomaly), TransactionDescriptionClassifier (text classification)
- Profile-based analysis (behavioral deviation, unusual time, etc.)
- Multi-language support (TR/EN) for all messages and reports
- Centralized message and rule management (with fallback to default language)
- Professional reporting: Excel, HTML, PDF (with optional charts)
- Visual analytics: anomaly distribution, scatter plots
- Easy integration, clean API, and extensible modular structure
Installation
pip install finomaly
Quick Start
import pandas as pd
from finomaly.core.anomaly_system import CorporateAnomalySystem
# Load your data
train_df = pd.read_excel('train.xlsx')
predict_df = pd.read_excel('predict.xlsx')
# Define features and rules
features = ['Tutar', 'Saat']
rules_path = 'rules.json'
# Initialize system
system = CorporateAnomalySystem(features, rules_path=rules_path, ml_method='isolation_forest', lang='en')
# Train model
system.fit('train.xlsx', customer_col='MusteriID', amount_col='Tutar')
# Predict anomalies
output_path = system.predict('predict.xlsx', customer_col='MusteriID', amount_col='Tutar')
result = pd.read_excel(output_path)
print(result.head())
Reporting & Visualization
from finomaly.report.visualizer import Visualizer
from finomaly.report.pdf_reporter import PDFReporter
visualizer = Visualizer()
visualizer.plot_anomaly_distribution(result, amount_col='Tutar', anomaly_col='ML_Anomaly')
pdf_reporter = PDFReporter()
pdf_reporter.generate_pdf_report(result, 'report.pdf')
Project Structure
core/: Rule engine, model management, utilitiesml/: ML models (IsolationForest, RandomForest, XGBoost)profile/: Profile-based analysis (behavioral, time-based)report/: Reporting and visualization (Excel, HTML, PDF, charts)
Contributing
Finomaly is open-source and welcomes contributions. Please open issues or pull requests for improvements, bug fixes, or new features.
License
MIT License
Author
Barış
Metadata
Release files for finomaly 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| finomaly-0.1.5.tar.gz | 5.1 kB | Without provenance | Details for finomaly-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| finomaly-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for finomaly-0.1.5-py3-none-any.whl |
Total release size: 9.5 kB
Release files / finomaly-0.1.5.tar.gz
| Download URL | finomaly-0.1.5.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bae934050b8d8276156cad1ff6a00562ee681b415ea873c67f1bb2898c0de207
|
|
BLAKE2b-256 checksum How to use checksums |
d058c64f1a3bb6ddedcf76610d98188e0fe3372720014b83d557a56879697425
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / finomaly-0.1.5-py3-none-any.whl
| Download URL | finomaly-0.1.5-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d1a85003a6a5050588e7a8272789d7be3410eb3b09d03b96bf2b23f9c2ea2cdb
|
|
BLAKE2b-256 checksum How to use checksums |
5ec8aecc6ea749a4ce184d0997368135525a1a2408a1dddbbb0689bdd5c412d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Security for finomaly 0.1.5
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.