]> src.bluestatic.org Git - ustaxlib.git/blob - README.md
Add status badges to README.
[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
42 ## Getting Started
43
44 To start using the software, create a new, private NPM project, and install the necessary
45 dependencies. This will also install the HTML viewer. Then copy an example file and run the viewer
46 with it.
47
48 mkdir taxes && cd taxes
49 echo '{"private":true}' > package.json
50 npm i ts-node typescript ustaxlib ustaxviewer
51 cp node_modules/ustaxlib/examples/fed2019.ts .
52 npx ustaxviewer fed2019.ts
53
54 ## Contributing
55
56 Contributions to address bugs and not-supported forms or situations are welcome. Only forms for
57 individuals are accepted (no estates, trusts, businesses, etc.). Please include tests with your
58 contribution and keep your commit history clean.
59
60 Issues should be filed on [GitHub](https://github.com/rsesek/ustaxlib).
61
62 ## Anticipated Answers
63
64 ### Why?
65
66 This project can be used to check the values produced by other tax software, to model expected tax
67 liability throughout the year, or to learn about the US tax system.
68
69 ### Should I use this to file my own tax returns?
70
71 Please, heck no. There are guaranteed to be bugs in this software. The models do not support every
72 situation, and many more complex parts of forms are not implemented. This software is provided with
73 no warranty. There is no wizard/interview system; it is expected that you use the instructions on
74 [the IRS website](https://www.irs.gov) to set up and input data into the forms.
75
76 ### How well does it work?
77
78 I have run my personal income tax information through the fed2019 model and received identical
79 results to the commercial tax prep software I'm using to actually file my tax returns. My situation
80 is moderately complex, and it exercises most of the forms in the fed2019 module. Your results may
81 vary.