Skip to content

Commit

Permalink
Merge pull request #168 from razorpay/release/1.5.1
Browse files Browse the repository at this point in the history
Release/1.5.1
  • Loading branch information
Nemo authored Mar 13, 2020
2 parents 28c3321 + c88bf07 commit 2f3a4eb
Show file tree
Hide file tree
Showing 26 changed files with 2,501 additions and 3,559 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## UNRELEASED

## 1.5.1

### Changed

- Metadata updates
- Madhya Bihar Gramin Bank and Bihar Gramin Bank merged to form
Dakshin Bihar Gramin Bank.

### Fixed

- Fixes a critical bug in the node.js SDK which reported some valid IFSCs as invalid.
- `CENTRE` and `CITY` fields should now be present across all rows. If we don't have a value, it will be set to `NA`.

### Added

- New `DatasetTest` to ensure fields don't get missed out in the future

## 1.5.0

### Added
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This is part of the IFSC toolset released by Razorpay.
You can find more details about the entire release at
[ifsc.razorpay.com](https://ifsc.razorpay.com).

[![wercker status](https://app.wercker.com/status/bc9b22047e1b8eb55ce98ba451d7b504/s/master 'wercker status')](https://app.wercker.com/project/byKey/bc9b22047e1b8eb55ce98ba451d7b504) [![](https://images.microbadger.com/badges/image/razorpay/ifsc:1.5.0.svg)](https://microbadger.com/images/razorpay/ifsc:1.5.0) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![wercker status](https://app.wercker.com/status/bc9b22047e1b8eb55ce98ba451d7b504/s/master 'wercker status')](https://app.wercker.com/project/byKey/bc9b22047e1b8eb55ce98ba451d7b504) [![](https://images.microbadger.com/badges/image/razorpay/ifsc:1.5.1.svg)](https://microbadger.com/images/razorpay/ifsc:1.5.1) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

[![](https://images.microbadger.com/badges/version/razorpay/ifsc:1.5.0.svg)](https://microbadger.com/images/razorpay/ifsc:1.5.0) [![npm version](https://badge.fury.io/js/ifsc.svg)](https://badge.fury.io/js/ifsc) [![Gem Version](https://badge.fury.io/rb/ifsc.svg)](https://badge.fury.io/rb/ifsc) [![PHP version](https://badge.fury.io/ph/razorpay%2Fifsc.svg)](https://badge.fury.io/ph/razorpay%2Fifsc) [![Hex pm](http://img.shields.io/hexpm/v/ifsc.svg)](https://hex.pm/packages/ifsc)
[![](https://images.microbadger.com/badges/version/razorpay/ifsc:1.5.1.svg)](https://microbadger.com/images/razorpay/ifsc:1.5.1) [![npm version](https://badge.fury.io/js/ifsc.svg)](https://badge.fury.io/js/ifsc) [![Gem Version](https://badge.fury.io/rb/ifsc.svg)](https://badge.fury.io/rb/ifsc) [![PHP version](https://badge.fury.io/ph/razorpay%2Fifsc.svg)](https://badge.fury.io/ph/razorpay%2Fifsc) [![Hex pm](http://img.shields.io/hexpm/v/ifsc.svg)](https://hex.pm/packages/ifsc)

## Dataset

Expand Down Expand Up @@ -119,6 +119,7 @@ Bank::getDetails('PUNB');
// 'nach_debit' => true,
// 'name' => 'Punjab National Bank',
// 'bank_code' => '024',
// 'upi' => true
// ]

$client = new Client();
Expand Down
4 changes: 2 additions & 2 deletions ifsc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |s|
s.name = 'ifsc'
s.version = '1.5.0'
s.date = '2020-01-27'
s.version = '1.5.1'
s.date = '2020-03-12'
s.summary = 'IFSC code database to help you validate IFSC codes'
s.description = 'A simple gem by @razorpay to help you validate your IFSC codes. IFSC codes are bank codes within India'
s.authors = ['Abhay Rana', 'Nihal Gonsalves']
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule IFSC.Mixfile do
def project do
[
app: :ifsc,
version: "1.5.0",
version: "1.5.1",
elixir: "~> 1.5",
start_permanent: Mix.env == :prod,
description: description(),
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ifsc",
"version": "1.5.0",
"version": "1.5.1",
"description": "This is part of the IFSC toolset released by Razorpay. You can find more details about the entire release at [ifsc.razorpay.com](https://ifsc.razorpay.com). Includes only a validation library as of now.",
"main": "src/node/index.js",
"directories": {
Expand Down
4 changes: 2 additions & 2 deletions scraper/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ GEM
remote: https://rubygems.org/
specs:
mini_portile2 (2.4.0)
nokogiri (1.10.7)
nokogiri (1.10.8)
mini_portile2 (~> 2.4.0)
ruby-ole (1.2.12.2)
rubyXL (3.4.12)
nokogiri (>= 1.4.4)
rubyzip (>= 1.3.0)
rubyzip (2.0.0)
rubyzip (2.2.0)
spreadsheet (1.2.6)
ruby-ole (>= 1.0)

Expand Down
34 changes: 21 additions & 13 deletions scraper/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,27 @@ IFS=$'\n\t'

mkdir --parents data/by-bank sheets

# List of sublet branches, and IMPS only branches
wget --timeout=10 "https://www.npci.org.in/national-automated-clearing-live-members-1" --output-document=nach.html --user-agent="Firefox"
wget --timeout=10 "https://www.npci.org.in/upi-live-members" --output-document=upi.html --user-agent="Firefox"
wget --timestamping --no-verbose --directory-prefix=sheets/ "https://rbidocs.rbi.org.in/rdocs/content/docs/68774.xlsx" || true
wget --timestamping --no-verbose --directory-prefix=sheets/ "https://rbidocs.rbi.org.in/rdocs/RTGS/DOCs/RTGEB0815.xlsx" || true

echo "Sheet Download complete, starting export"

# Convert the NEFT and RTGS lists from RBI
ssconvert --export-file-per-sheet sheets/RTGEB0815.xlsx sheets/RTGS-%n.csv
echo "Converted RTGS file to CSV"
ssconvert --export-file-per-sheet sheets/68774.xlsx sheets/NEFT-%n.csv
echo "Converted NEFT file to CSV"
if [[ $@ == *'--no-download'* ]]; then
echo "Skipping download"
else
# List of sublet branches, and IMPS only branches
wget --timeout=10 "https://www.npci.org.in/national-automated-clearing-live-members-1" --output-document=nach.html --user-agent="Firefox"
wget --timeout=10 "https://www.npci.org.in/upi-live-members" --output-document=upi.html --user-agent="Firefox"
wget --timestamping --no-verbose --directory-prefix=sheets/ "https://rbidocs.rbi.org.in/rdocs/content/docs/68774.xlsx" || true
wget --timestamping --no-verbose --directory-prefix=sheets/ "https://rbidocs.rbi.org.in/rdocs/RTGS/DOCs/RTGEB0815.xlsx" || true

echo "Sheet Download complete, starting export"
fi

if [[ $@ == *'--no-convert'* ]]; then
echo "Skipping sheet conversion"
else
# Convert the NEFT and RTGS lists from RBI
ssconvert --export-file-per-sheet sheets/RTGEB0815.xlsx sheets/RTGS-%n.csv
echo "Converted RTGS file to CSV"
ssconvert --export-file-per-sheet sheets/68774.xlsx sheets/NEFT-%n.csv
echo "Converted NEFT file to CSV"
fi

# This is the script that does all the data generation
bundle exec ruby generate.rb
Expand Down
28 changes: 24 additions & 4 deletions scraper/scripts/methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ def parse_imps(banks)
banks.each do |code, row|
next unless row[:ifsc] && row[:ifsc].strip.to_s.length == 11



data[row[:ifsc]] = {
'BANK' => banknames[code],
'IFSC' => row[:ifsc],
Expand All @@ -36,6 +34,7 @@ def parse_imps(banks)
'ADDRESS' => 'NA',
'CONTACT' => nil,
'IMPS' => true,
'CITY' => 'NA',
'UPI' => banks[code][:upi] ? true : false
}
end
Expand All @@ -45,7 +44,7 @@ def parse_imps(banks)
def parse_neft(banks)
data = {}
codes = Set.new
sheets = 0..2
sheets = 0..1
sheets.each do |sheet_id|
row_index = 0
headings = []
Expand All @@ -58,6 +57,9 @@ def parse_neft(banks)
row['IFSC'] = row['IFSC'].upcase.gsub(/[^0-9A-Za-z]/, '')
codes.add row['IFSC']
row['NEFT'] = true

# This hopefully is overwritten by RTGS dataset
row['CENTRE'] = 'NA'
bankcode = row['IFSC'][0..3]

if banks[bankcode] and banks[bankcode].key? :upi and banks[bankcode][:upi]
Expand Down Expand Up @@ -120,6 +122,9 @@ def parse_rtgs(banks)
end
row['ADDRESS'] = row['ADDRESS'].to_s.strip
row['RTGS'] = true
# This is fallback option and we fake it
# because the RTGS sheet does not have the CITY
row['CITY'] = row['CENTRE']
data[row['IFSC']] = row
end
end
Expand Down Expand Up @@ -177,13 +182,28 @@ def merge_dataset(neft, rtgs, imps)
combined_set = Set.new(neft.keys) + Set.new(rtgs.keys) + Set.new(imps.keys)

combined_set.each do |ifsc|

data_from_neft = neft.fetch ifsc, {}
data_from_rtgs = rtgs.fetch ifsc, {}
data_from_imps = imps.fetch ifsc, {}

# Preference Order is:
# NEFT > RTGS > IMPS
combined_data = data_from_imps.merge(data_from_rtgs.merge(data_from_neft))
combined_data = data_from_imps.merge(
data_from_rtgs.merge(data_from_neft) do |key, oldval, newval|
if oldval and oldval != 'NA'
oldval
else
newval
end
end
) do |key, oldval, newval|
if oldval and oldval != 'NA'
oldval
else
newval
end
end
combined_data['NEFT'] ||= false
combined_data['RTGS'] ||= false
# IMPS is true everywhere, till we have clarity on this from NPCI
Expand Down
2 changes: 1 addition & 1 deletion src/IFSC.json

Large diffs are not rendered by default.

18 changes: 13 additions & 5 deletions src/banknames.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
"BCOX": "Bapuji Co-operative Bank",
"BCUB": "Bicholim Urban Co-operative Bank",
"BCUX": "Baghat Urban Co-operative Bank",
"BDBB": "Bahraich District Co-operative Bank",
"BDBL": "Bandhan Bank",
"BDBX": "Bellary District Co-operative Central Bank",
"BDCX": "Bijapur District Central Co-operative Bank",
Expand All @@ -135,7 +136,7 @@
"BEDX": "Beed District Central Co-operative Bank",
"BELX": "Belgaum District Central Co-operative Bank",
"BFUX": "Bhagyodaya Friends Urban Co-operative Bank",
"BGBX": "Bihar Gramin Bank",
"BGBX": "Dakshin Bihar Gramin Bank",
"BGCX": "Balageria Central Co-operative Bank",
"BGGX": "Baroda Gujarat Gramin Bank",
"BGUX": "Begusarai Central Co-operative Bank",
Expand Down Expand Up @@ -308,12 +309,12 @@
"DMCX": "Durgapur Mahila Co-operative Bank",
"DMKB": "Dattatraya Maharaj Kalambe Jaoli Sahakari Bank",
"DMKJ": "Dmk Jaoli Bank",
"DNDC": "Dhule And Nandurbar District Central Co-operative Bank",
"DNSB": "Dombivli Nagari Sahakari Bank",
"DNSX": "Deendayal Nagari Sahakari Bank",
"DOBX": "Dapoli Urban Co-operative Bank Dapoli",
"DOHB": "Doha Bank QSC",
"DRGX":
"Durg Rajnandgaon Gramin Bank (merged With Chhattisgarh Rajya Gramin Bank-cgbx)",
"DRGX": "Durg Rajnandgaon Gramin Bank (merged With Chhattisgarh Rajya Gramin Bank-cgbx)",
"DSBX": "Daivadnya Sahakara Bank Niyamit",
"DSCB": "Delhi State Co-operative Bank",
"DSHX": "District Co-operative Bank Saharanpur",
Expand Down Expand Up @@ -402,6 +403,7 @@
"HCBX": "Hasti Co-operative Bank",
"HCCX": "Hazaribag Central Co-operative Bank",
"HCLX": "HCBL Co-operative Bank",
"HDCL": "Hardoi District Co-operative Bank",
"HDCX": "Hyderabad District Co-operative Bank",
"HDFC": "HDFC Bank",
"HGBX": "Sarva Haryana Gramin Bank",
Expand All @@ -420,6 +422,7 @@
"HSDX": "Hassan District Co-operative Central Bank",
"HSSX": "Hindustan Shipyard Staff Co-operative Bank",
"HUBX": "Hubli Urban Co-operative Bank",
"HUCB": "Hadagali Urban Co-operative Bank",
"HUCX": "Hissar Urban Co-operative Bank",
"HUTX": "Hutatma Sahakari Bank",
"HVBK": "Woori Bank",
Expand All @@ -436,6 +439,7 @@
"IDUK": "Idukki District Co-operative Bank",
"IDUX": "Idukki District Co-operative Bank",
"ILCB": "Ilkal Co-operative Bank",
"IMCX": "Imperial Urban Co-operative Bank Jalandhar",
"IMPX": "Imphal Urban Co-operative Bank",
"INCX": "Indapur Urban Co-operative Bank",
"INDB": "Indusind Bank",
Expand Down Expand Up @@ -690,10 +694,11 @@
"MAPX": "Maharana Pratap Co-operative Urban Bank",
"MASX": "Mahesh Urban Co-operative Bank Solapur",
"MAUX": "Mantha Urban Co-operative Bank",
"MAWX": "Manipur Womens Co-operative Bank",
"MAVX": "Shree Mahavir Sahakari Bank",
"MAYX": "Mayani Urban Co-operative Bank",
"MBCX": "Mugberia Central Co-operative Bank",
"MBGX": "Madhya Bihar Gramin Bank",
"MBGX": "Dakshin Bihar Gramin Bank",
"MBLX": "Manmandir Co-operative Bank",
"MCAX": "Mahesh Urban Co-operative Bank Ahmedpur",
"MCBL": "Mahanagar Co-operative Bank",
Expand Down Expand Up @@ -835,6 +840,7 @@
"NPCX": "Nadiad Peoples Co-operative Bank",
"NPKX": "Nashik Zilha Sarkari & Parishad Karmachari Sb Nmt",
"NRDX": "Nasik Road Deolali Vyapari Sahakari Bank",
"NRMX": "Northern Railway Multi State Primary Co-operative Bank",
"NSBB": "Nagarik Sahakari Bank Bhiwandi",
"NSBX": "Nagrik Sahakari Bank Lucknow",
"NSCX": "Nagaland State Co-operative Bank",
Expand Down Expand Up @@ -952,6 +958,7 @@
"RAUX": "Rajlaxmi Urban Co-operative Bank",
"RBBX": "Rajarambapu Sahakari Bank Peth",
"RBCX": "Reserve Bank Employees Co-operative Bank",
"RBIN": "Reserve Bank Of India",
"RBIS": "Reserve Bank of India",
"RBIH": "IDRBT",
"RCBX": "Raniganj Co-operative Bank",
Expand Down Expand Up @@ -1076,7 +1083,7 @@
"SIBX": "Sikar Kendriya Sahakari Bank",
"SICX": "Sirsa Central Co-operative Bank",
"SIDB": "Small Industries Development Bank Of India",
"SIDC": "The Sindhudurg District Central Co-operative Bank",
"SIDC": "Sindhudurg District Central Co-operative Bank",
"SIDX": "Siddhi Co-operative Bank",
"SIGX": "Singhbhum District Central Co-operative Bank",
"SIHX": "Sihor Nagarik Sahakari Bank",
Expand Down Expand Up @@ -1415,6 +1422,7 @@
"ZMMX": "Zila Sahkari Bank Moradabad",
"ZRNB": "Rani Channamma Mahila Sahakari Bank",
"ZSAX": "Zila Sahkari Bank Mau",
"ZSBG": "Zila Sahkari Bank Gorakhpur",
"ZSBL": "Zila Sahkari Bank Ghaziabad",
"ZSBX": "Zila Sahkari Bank Bijnor",
"ZSGX": "Zila Sahkari Bank Garhwal Kotdwar",
Expand Down
Loading

0 comments on commit 2f3a4eb

Please sign in to comment.