Update changelog for 2.0.0.
[ustaxlib.git] / README.md
1 # ustaxlib
2
3 ![CI](https://github.com/rsesek/ustaxlib/workflows/CI/badge.svg?branch=master)
4 [![npm version](https://badge.fury.io/js/ustaxlib.svg)](https://badge.fury.io/js/ustaxlib)
5
6 This project provides modules for modeling the US tax system for individuals. The `ustaxlib/core`
7 module provides a generic framework for defining tax return forms. And peer modules like
8 `ustaxlib/fed2019` provide forms for specific revisions/years of tax returns.
9
10 There is a peer project [ustaxviewer](https://github.com/rsesek/ustaxviewer) that can render a tax
11 return as HTML.
12
13 ## Core
14
15 The `ustaxlib/core` module provides a very simple data model for tax returns:
16
17 - `TaxReturn`: An abstract class that is the root of the object graph. It holds at least one
18 `Person` and several `Form`s.
19 - `Person`: A person for whom the `TaxReturn` is being computed.
20 - `Form`: An abstract class that represents a single form in the tax system. Holds one or more
21 `Line`s. `Form`s optionally take an input object, the values of which are typically exposed
22 by an `InputLine`.
23 - `Line`: An abstract class, with several concrete subclasses provided by core, that corresponds to
24 a single line on a tax system form. A `Line`'s parametrized type corresponds to the type of
25 value that is computed by it. Examples are:
26 - `ComputedLine`: Uses a function to produce a value.
27 - `ReferenceLine`: Returns the value of a specific line of a `Form`.
28 - `InputLine`: Returns the value of a `Form`'s input.
29 - `AccumulatorLine`: Some `Form`s can have multiple instances in a `TaxReturn`, and this line
30 sums a specific line for all instances of that form type.
31
32 The core module provides what is effectively a specialized spreadsheet. Rather than sheets and rows,
33 there are forms and lines. A `TaxReturn` provides a way to find forms by their type, and a `Form`
34 provides access to the values computed by `Line`s.
35
36 ## Models
37
38 Currently ustaxlib supports the following models:
39
40 - [**fed2019**](src/fed2019/README.md)
41 - [**fed2020**](src/fed2020/README.md)
42
43 ## Getting Started
44
45 To start using the software, create a new, private NPM project, and install the necessary
46 dependencies. This will also install the HTML viewer. Then copy an example file and run the viewer
47 with it.
48
49 mkdir taxes && cd taxes
50 echo '{"private":true}' > package.json
51 npm i ts-node typescript ustaxlib ustaxviewer
52 cp node_modules/ustaxlib/examples/fed2019.ts .
53 npx ustaxviewer fed2019.ts
54
55 ## Contributing
56
57 Contributions to address bugs and not-supported forms or situations are welcome. Only forms for
58 individuals are accepted (no estates, trusts, businesses, etc.). Please include tests with your
59 contribution and keep your commit history clean.
60
61 Issues should be filed on [GitHub](https://github.com/rsesek/ustaxlib).
62
63 ## Anticipated Answers
64
65 ### Why?
66
67 This project can be used to check the values produced by other tax software, to model expected tax
68 liability throughout the year, or to learn about the US tax system.
69
70 ### Should I use this to file my own tax returns?
71
72 Please, heck no. There are guaranteed to be bugs in this software. The models do not support every
73 situation, and many more complex parts of forms are not implemented. This software is provided with
74 no warranty. There is no wizard/interview system; it is expected that you use the instructions on
75 [the IRS website](https://www.irs.gov) to set up and input data into the forms.
76
77 ### How well does it work?
78
79 I have run my personal income tax information through the fed2019 model and received identical
80 results to the commercial tax prep software I'm using to actually file my tax returns. My situation
81 is moderately complex, and it exercises most of the forms in the fed2019 module. Your results may
82 vary.