Skip to main content

A rule-based and machine learning-based anomaly detection library for financial transactions.

Project description

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.

Features

  • Rule-based anomaly detection (JSON-configurable, customer-specific rules)
  • Machine learning models: IsolationForest, RandomForest, XGBoost
  • Profile-based analysis (behavioral deviation, unusual time, etc.)
  • Multi-language support (TR/EN) for all messages and reports
  • Centralized message and rule management
  • 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, utilities
  • ml/ : 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ış

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finomaly-0.1.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finomaly-0.1.3-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file finomaly-0.1.3.tar.gz.

File metadata

  • Download URL: finomaly-0.1.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for finomaly-0.1.3.tar.gz
Algorithm Hash digest
SHA256 adcf8c5760d771fed666fa2e91bd4007bd3ea7615fc607d663e6273614a744db
MD5 ca9562476eb5b9b82df26b4eaaacb690
BLAKE2b-256 e85108e66c08bd0f925d7396fb338e790c5f74f28de713252b209e06a8bbc5fa

See more details on using hashes here.

File details

Details for the file finomaly-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: finomaly-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for finomaly-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d021f624667e5851975dab9fa2b6b2a527bcbfe82698a33cc3d89354d91c23d5
MD5 4c82bcdd953c97861a2291565eba28a0
BLAKE2b-256 9901759735a6e92fc2c2f9b68bab87017f3f46485027bc4265c50aa0c620a3dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page