Skip to content

mavratsas/Benford-Law

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Benford's Law App - Installation and Usage Instructions Introduction This document provides step-by-step instructions for installing and running the Benford's Law Application. The application is designed to help users analyze numeric datasets using Benford's Law to detect anomalies or irregularities, which is often used in accounting audits and cybersecurity investigations. 1. Step-by-Step Installation Instructions Windows

  1. Download and install Python from the official website: https://www.python.org/downloads/. Ensure you check the option to 'Add Python to PATH' during installation.
  2. Download the application (benfords_law_app.py) from the provided GitHub link(https://github.com/mavratsas/Benford-Law/blob/main/benfords_law_app.py).
  3. Open the Command Prompt and navigate to the folder where you saved the benfords_law_app.py file. You can do this by using the command 'cd' followed by the folder path.
  4. Install the required Python libraries by typing the following commands in the Command Prompt: pip install pandas matplotlib ttkthemes scipy numpy
  5. After the installations are complete, you can run the application using the command: python benfords_law_app.py
  6. If you want to package the app into an executable, follow the packaging instructions below. Mac
  7. macOS typically comes with Python pre-installed. If not, download and install Python from https://www.python.org/downloads/. Ensure Python is added to your system's PATH.
  8. Download the application (benfords_law_app.py) from the provided GitHub link(https://github.com/mavratsas/Benford-Law/blob/main/benfords_law_app.py).
  9. Open the Terminal and navigate to the folder where you saved the benfords_law_app.py file using 'cd' command.
  10. Install the required libraries by typing the following commands in the Terminal: pip install pandas matplotlib ttkthemes scipy numpy
  11. Run the application using the command: python benfords_law_app.py
  12. For packaging instructions, see the next section. Linux
  13. Install Python if it is not already installed by running the command in the terminal: sudo apt install python3
  14. Download the application (benfords_law_app.py) from the provided GitHub link(https://github.com/mavratsas/Benford-Law/blob/main/benfords_law_app.py).
  15. Navigate to the folder where you saved the benfords_law_app.py file using 'cd'.
  16. Install the required libraries by typing the following commands: pip install pandas matplotlib ttkthemes scipy numpy
  17. Run the application with the command: python3 benfords_law_app.py 2. Packaging Instructions If you would like to package the application into an executable so that it can be run directly without the command line, follow these steps for each operating system. Packaging for Windows
  18. Install PyInstaller: pip install pyinstaller
  19. Navigate to the folder where the benfords_law_app.py file is located.
  20. Run the following command in the Command Prompt: pyinstaller --onefile --windowed benfords_law_app.py
  21. After the process completes, an executable will be created in the 'dist' folder. Packaging for Mac
  22. Install PyInstaller: pip install pyinstaller
  23. Navigate to the folder where the benfords_law_app.py file is saved.
  24. Run the following command in the Terminal: pyinstaller --onefile --windowed benfords_law_app.py
  25. The application will be packaged, and the executable will be available in the 'dist' folder. Packaging for Linux
  26. Install PyInstaller: sudo apt install pyinstaller
  27. Navigate to the folder containing the benfords_law_app.py file.
  28. Run this command in the terminal: pyinstaller --onefile --windowed benfords_law_app.py
  29. The executable will be created in the 'dist' folder.
  30. Note on Running the Application If you do not wish to package the application, you can always run it directly from the command line using: python benfords_law_app.py Even if you package the app, you can still run it from the command line, which might be faster. 4. What is Benford's Law? Benford's Law, also known as the First-Digit Law, is a phenomenon observed in many real-life sets of numerical data, where the first digit is more likely to be small. For example, in a dataset, the number '1' is more likely to appear as the first digit than '9'. This can be used to detect anomalies or fraud in datasets. Applications in Accounting and Auditing In accounting and auditing, Benford's Law is often used to detect fraud or irregularities in financial data. For example, you can run Benford's Law on the sales amount of each invoice in a dataset (the column should be numeric). If the distribution of the first digits deviates significantly from the expected distribution according to Benford's Law, it may indicate suspicious activity. Applications in Cybersecurity In cybersecurity, Benford's Law can be used to detect anomalies in log files or data streams. For instance, you could analyze the frequency of certain numeric values, such as byte counts in network traffic or system logs, to see if the data distribution follows Benford's Law. A significant deviation may suggest unusual or malicious activity.

About

Helping Analyze Fraudulent Activities

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages