Giter Site home page Giter Site logo

nmi-finder's Introduction

Installation

You can install the NMI Checker package directly from GitHub using the following command:

pip install git+https://github.com/Threadlet/nmi-finder.git

Usage

The primary method for checking NMIs is process_input, which can take either a single string or a list of strings as input. Based on the input type, it will process and return the results accordingly.

Example:

NOTE: We have used NMIs directly in this example but process_input method is capable to process OCR output of bills in the form of string datatype, it can search for NMI and run it through all the processes.

  1. Using a list of strings:
from nmi_checker import RangeChecker
r = RangeChecker()
results = r.process_input('123')
print(results)

range_checker = RangeChecker()
test_strings = ["2501000000", "QB05414270", "QB09999999", "12345", "QB0A999999"]
results = range_checker.process_input(test_strings)
print(results)

Output:


[
 {'original': '2501000000',
  'output': (('2501000000', 'PWCLNSP'), True),
  'reason': 'NMI Found, Checksum Passed, Found in Range'},
 {'original': 'QB05414270',
  'output': 
{
 'original': '2501000000',
 'output': (('2501000000', 'PWCLNSP'), True),
 'reason': 'NMI Found, Checksum Passed, Found in Range'
}
,
  'reason': 'NMI Found, Checksum Passed, Found in Range'},
 {'original': 'QB09999999',
  'output': (('QB09999999', 'ENERGEXP'), True),
  'reason': 'NMI Found, Checksum Passed, Found in Range'},
 {'original': None,
  'output': (None, False),
  'reason': 'Not in given Ranges of AEMO'},
 {'original': 'QB0A999999',
  'output': (None, False),
  'reason': 'Not in given Ranges of AEMO'}
]

  1. Using a single string:
result = range_checker.process_input("2501000000")
print(result)

Output:


{
 'original': '2501000000',
 'output': (('2501000000', 'PWCLNSP'), True),
 'reason': 'NMI Found, Checksum Passed, Found in Range'
}

New Methods in RangeChecker class:

There are two new methods added to the RangeChecker class: to_df and to_csv.

NOTE : The to_df and to_csv methods can only be called when the input to process_input is a list of strings.

to_df:

This method converts the result of process_input into a DataFrame.

Usage:

r = RangeChecker()
result = r.process_input(["2501000000", "QB05414270", "QB09999999", "12345", "QB0A999999"])
out_df = r.to_df()

out_df now contains the output dataframe.

to_csv:

This method saves the result of process_input to a CSV file. It requires a filename as an argument.

Usage:

r = RangeChecker()
result = r.process_input(["2501000000", "QB05414270", "QB09999999", "12345", "QB0A999999"])
r.to_csv("csv_fun_check.csv")

This will generate a CSV file named csv_fun_check.csv.

nmi-finder's People

Contributors

dempstert avatar fonzzy1 avatar

Watchers

Akhlaq Ahmed avatar  avatar

Forkers

fonzzy1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.