Changelog¶
All notable changes to this project will be documented in this file.
0.2.1¶
- Breaking:
crimepy.nibrs.codes.STATESis now the name of each numeric state code (it wasSTATE_NAMES), andcodes.STATE_ABBREVIATIONSis the postal abbreviation (it wasSTATES). - Each codebook of
crimepy.nibrs.codes.CODEBOOKSis also public by itself (such ascodes.RACESandcodes.WEAPONS). The "clearances" codebook iscodes.EXCEPTIONAL_CLEARANCES, and the "divisions" codebook iscodes.SUBREGIONS.codes.OFFENSEShas the name, category, whom or what it is against, and group of each offense code. crimepy.nibrs.codes.OFFENSE_TYPESlists the offense codes of each type: whom or what they are against ("Person", "Property", "Society", and "Not a Crime"), and "National Security Offenses", "Rape Offenses", "Sex Offenses", and "Immigration Offenses".- The code follows the house style throughout: lines of at most 80 characters (the tables in docstrings are now lists), section markers that group the members of each module and class, and a full docstring for every function and method, tests and private ones included.
0.2.0¶
- Breaking: crimepy keeps its data in amos's workspace (amos 0.6.0), not
in a "crimepy_data" folder of the home folder. The data folder is now the
"crime" folder (
options.DATA_SUBFOLDER) of the data folder of the workspace that holds the "code" folder (such as "projects/data/crime" for code in "projects/code"; see amos'sClerk), so NIBRS is in "data/crime/nibrs", beside the "studies" folder of amos projects' results.CRIMEPY_DATA,options.DATA_FOLDER(nowNoneunlessCRIMEPY_DATAis set), and afolderargument still name another. Move an existing "crimepy_data" folder's "nibrs" folder there (or setCRIMEPY_DATA) to keep its downloads and tables. Requires amos 0.6.0.
0.1.0¶
- Breaking:
crimepyis built onamosdatasets.crimepy.nibrs.load,load_tables,read, andtables.build(and its builders) returnamos.Datasets, whosedatais the table, and takelabel,task, andgroupsfor modeling.crimepy.nibrs.load_framereturns a plain data frame, asloaddid.crimepy.combine.stackandmergereturn datasets, andcrimepy.analyze.countreturns a new dataset of counts, whose label is the counts. - Every analysis is an
amostechnique:population_rates,crime_rates,percent_change,crosstab, andcoveragejoincount_crimes,crime_trend, andclearance_rates. The functions ofcrimepy.analyzeapply them, take datasets or data frames, and keep their tables in a dataset'stables.crime_ratesloads the agencies of the data's years and states when it is given none. - The functions of
crimepy.plottake datasets, which keep their figures infigures, andcrimepy.nibrs.decodedecodes a dataset in place. - Downloads of master files that break (as they do when the CDE's 15-minute link expires during a slow download) resume where they stopped, with a new link.
crimepyrequiresamos0.4.1.- The README has a BibTeX entry for citing
crimepy, andCITATION.cffhas the date of the release.
0.0.1¶
- Initial version, from the
snickerdoodletemplate, built onamos. crimepy.nibrsdownloads the FBI's NIBRS master files for any year from 1991 (download), converts them to parquet files (convert), and loads their tables intopandasfor any years, states, and columns (load). It reads every era of the files: the three batch header records before 2013, the fields added in 2013, fixed-length and variable-length records, and archives compressed with Deflate64.crimepy.nibrs.layoutshas the position of every field, from the FBI's record descriptions and from fields found in the files, andcrimepy.nibrs.codeshas the label of every code.crimepy.nibrs.tablesjoins the segments of incidents into tables of incidents, victims, offenses, offenders, and arrestees, with the details of their incidents and agencies.crimepy.combinestacks and joins tables while keeping their categories.crimepy.analyzecounts events, makes trends, crime rates, clearance rates, and cross-tabulations, and measures reporting coverage.crimepy.plotdraws trends, the most common values, events by hour and day, and age pyramids.amostechniques:load_nibrs,decode_nibrs,count_crimes,crime_trend,clearance_rates,trend_plot,top_values,time_heatmap, andage_pyramid.- A command line interface:
crimepy nibrs years,download,convert, andexport, andcrimepy project.