• Stars
    star
    315
  • Rank 132,951 (Top 3 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created almost 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A U.S. personal income tax calculator

py1040

This is a tax calculator for one individual U.S. tax returnโ€”Internal Revenue Service form 1040.

First, you will take a short interview:

An interview form, actually a standard Python file with assignments like `status="married"` and `over_65=False`

This will generate a personalized list of inputs for you to provide:

Another standard Python file with lines for variables with names like `1040_wages` and `f1040_interest`. Lines are documented with comments.

From those, you will get output that roughly follows the tax forms:

Output, headed "Form 1040". Each line has a line number from the IRS form, a title like `taxable interest` and `tax minus credits`

Quick start

  1. Build it, via make. This will pull a copy of 1040.js (See https://b-k.github.io/1040.js for the attractive front end), and generate Python versions of the forms.
  2. Run python3 taxes.py, which will generate a file named interview.py.
  3. Open interview.py in your text editor, and follow the instructions to provide information about your tax situation.
  4. Run python3 taxes.py again. It will generate inform.py.
  5. Open inform.py and fill in the information from your W-2s and other such sources.
  6. Run python3 taxes.py again. It will calculate your taxes and print the line-by-line calculations to the screen.

Caveats

This program is not a tax tutor or advisor; there are many other sources that can help you optimize your tax situation. This is just a calculator, that may be useful in the process. For example, double-checking the work of another tax system using py1040 may reveal mistakes or even tax opportunities.

There are many elements of the system that are not yet implemented. The lead author is not self-employed and doesn't have a farm, so Schedules C and F are not implemented.

Please note this section from the license, which the license authors felt was important enough to put in all-caps:

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.

This version was first written by BK over the course of a weekend at home, and is therefore not endorsed by or otherwise related to his employer.

Contributing

Each form is represented as a file holding a dictionary of cells, where each cell represents a line of the tax code. The cell includes the text to print, the line number, the calculation to do, whether the cell needs to be part of inform.py, and the list of the cell's parent cells. That dictionary is at https://github.com/b-k/1040.js , in a relatively language-independent format that both the Javascript and Python version parse into functions. [https://github.com/b-k/1040.js/blob/master/Contributing.md] covers all the details.

Adding a form, then, consists of transcribing this information for each needed line. This is straightforward, and has proven to take only a few seconds per line. We considered using the XML schemata here: https://www.irs.gov/Tax-Professionals/e-File-Providers-&-Partners/Schemas-Business-Rules-and-Release-Memo-for-MeF-Form-1040-Series-Tax-Year-2015-Version-3_1 but it turns out to be easier to just cut/paste/modify the lines from the PDF forms.

More Repositories

1

21st-Century-Examples

Examples for _21st Century C_ by Ben Klemens
C
332
star
2

apophenia

A C library for statistical and scientific computing
C
196
star
3

1040.js

A visual implementation of individual U.S. taxes
JavaScript
37
star
4

mms

The Malcontent Management System
TeX
32
star
5

wearin

The more you play your music files, the more they wear in
C
6
star
6

Rapophenia

C
6
star
7

narratives-distributions

A table of concrete micro-level narratives known to generate closed-form statistical distributions.
TeX
5
star
8

cat_notes

My notes and flash cards for category theory
TeX
5
star
9

modeling_examples

Collected examples of modeling
C
5
star
10

dataclub

Like a book club, but with data.
Jupyter Notebook
3
star
11

tweets-are-not-news

Remove headlines from news sites with titles including words like "lambasts", "blasts", "jabs"
JavaScript
3
star
12

git-isclean

Q: Would I lose any work by deleting a local clone of a git repository? A: Run this script to find out.
3
star
13

unicode-falafel

A proposal to add a falafel emoji to the Unicode standard
TeX
2
star
14

tea-tutorial

A tutorial introduction to Tea, an R package for survey processing
TeX
2
star
15

luminosity

A paper on the using light visible at night from space and poverty
C
2
star
16

ml_for_econometricians

Slides and demo script for a talk for IMF econometricians on machine learning
TeX
2
star
17

cmh.py

Cochrane-Mantel-Hanenszel statistic calculator
Jupyter Notebook
1
star
18

small-world-motifs

Count subgraphs and generate random graphs, using a Lua library for storing graphs in a Berkeley DB.
C
1
star
19

ethical-principles-for-disruption

A discussion of ethical principles for developers and technologists
1
star