Name | Modified | Size | Downloads / Week |
---|---|---|---|
README.txt | 2022-08-16 | 3.2 kB | |
bmfkit.tar.gz | 2022-08-16 | 4.4 kB | |
Totals: 2 Items | 7.6 kB | 0 |
IRS BUSINESS MASTER FILE KIT There are presumably more elegant scripts and sqls that one can write. This DOES work and permits search on any combination of the 28 fields that the IRS extracts. === Everything runs as an unprivileged user. There are two scripts. === newbmf is for first time use only. It should be run as ./newbmf from wherever you extracted the five files (including this one). 1.In your home directory it will create the sub-directory ‘bmf.’ 2.The two ‘sql’ files will be moved to ~/bmf. 3.The six IRS csv files will be downloaded to ~/bmf. 4.The csv files will be processed to eliminate the header lines in each and then combined into a single bmf.csv. 5.Using ~/bmf/new.sql the database ‘bmf’ will be created. It will then create the primary table ‘org’ with 28 fields and three indices. 6.The data in bmf.csv will be loaded into the primary table. 7.Optionally, you can add a completion sound at the end of the script. I provided an example as a comment. === The second script, ‘dobmf,’ should be moved to ~/bin. The script is tied to ~/bmf/bmf.sql. This is the monthly maintenance script and assumes that the database and primary table already exist. It will download and process the six IRS csv files, delete the existing data and then load the new data into the database. === After the data is loaded it will do a pseudo-optimization. The data is copied to a new temporary table and analyzed. The primary table is then re-created and populated from the temporary table. === The IRS updates the data monthly; usually between the 8th and 10th day. You can check the update date here: https://www.irs.gov/charities-non-profits/exempt-organizations-business-master-file-extract-eo-bmf === Field documentation is here: https://www.irs.gov/pub/irs-soi/eo_info.pdf === OPTIONAL ADD-ON: You can also create a command line script for a compact search and display: #!/bin/bash subsearch=$(echo %$1 $2 $3 $4 $5|sed 's/ *$//g') searchstring="$subsearch%" echo "$searchstring" mysql bmf -e "select EIN,Name,ICO,City,State as ST,TaxPeriod as Period,FilingReq,format(Assets, 0) as Assets,format(Income, 0) as Income from org where name like '$searchstring'" === Using the above (assuming the script is named bmfcl); bmfcl national organization for marriage will return: +-----------+---------------------------------------------------+----------------+----------+------+--------+-----------+---------+---------+ | EIN | Name | ICO | City | ST | Period | FilingReq | Assets | Income +-----------+---------------------------------------------------+----------------+----------+------+--------+-----------+---------+---------+ | 207472471 | NATIONAL ORGANIZATION FOR MARRIAGE EDUCATION FUND | % NEIL CORKERY | ROCKFORD | IL | 202012 | 01 | 500,869 | 247,077 | | 260240498 | NATIONAL ORGANIZATION FOR MARRIAGEINC | % NEIL CORKERY | ROCKFORD | IL | 202012 | 01 | 109,795 | 222,166 | +-----------+---------------------------------------------------+----------------+----------+------+--------+-----------+---------+---------+