GithubHelp home page GithubHelp logo

luca's Introduction

========================================== Luca: YAML accounting and JSON tax forms

You can find the Luca documentation at Read The Docs:

https://luca.readthedocs.org/en/latest/

Luca is prounounced “Lew-cha” and is named after Luca Pacioli, the Italian friend of Leonardo's who invented modern accounting.

Luca is not yet on the Python Package Index, but can be installed directly from GitHub:

git clone https://github.com/brandon-rhodes/luca.git
pip install luca/

luca's People

Contributors

brandon-rhodes avatar punchagan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

luca's Issues

Error using "complete" command possibly due to missing PDF templates

When I attempt to run the complete command on a default input file created using the form command, I'm presented with the following error:

(luca_example)ubuntu@ip-172-31-6-233:~/luca_example/2012$ luca complete 2012-f1040.json 2012-f1040.json
Traceback (most recent call last):
  File "/home/ubuntu/anaconda/envs/luca_example/bin/luca", line 11, in <module>
    sys.exit(main())
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/commandline.py", line 34, in main
    for line in _main(args, terminal):
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/commandline.py", line 64, in _main
    luca.forms.actions.complete(args['<tax-filing.json>'], not args['-j'])
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/forms/actions.py", line 79, in complete
    pdf_path = save_pdf(json_path, form_module, form)
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/forms/actions.py", line 126, in save_pdf
    form_module.fill_out(form, pdf)
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/forms/us/f1040.py", line 115, in fill_out
    pdf.load('us.f1040--{}.pdf'.format(f.form_version))
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/forms/actions.py", line 191, in load
    ['pdftk', self.original_pdf_path, 'dump_data_fields'])
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

This appears to occur because 'us.f1040--{}.pdf' is missing. I don't see any .pdf files in the repo.

Any chance I could get the required files? Or am I interpreting this incorrectly?

f1040sse_long fails to generate due to incorrect `versions` declaration

When running luca form us.f1040sse_long 2012, the command used to generate default form json in the format used by most forms, but for us.f1040sse_long, we receive this usage error:

Please specify a particular version of this form with a command like:
   luca form us.f1040sse_long 2
   luca form us.f1040sse_long 0
   luca form us.f1040sse_long 1
   luca form us.f1040sse_long 3

This is because the code that checks if the version is applicable expects an array of strings for form_module.versions:

# luca/forms/actions.py L46-50

if form_version is None or form_version not in form_module.versions:
    print ('Please specify a particular version of this form'
           ' with a command like:')
    for version in form_module.versions:
        print '   luca form {} {}'.format(form_name, version)
    return

Which is indeed the case for all forms except f1040sse_long, where:

# luca/forms/us/f1040sse_long.py L4
versions = u'2013'

To fix this, we simply need to add a comma

# luca/forms/us/f1040sse_long.py L4
versions = u'2013',

Though I wonder if this particular form is unusable with the form command because perhaps it's not meant to be used?

`luca form` usage error message for unrecognized filling year could be more helpful

If I run

luca form us.f1040sa

I receive

Please specify a particular version of this form with a command like:
   luca form us.f1040sa 2012

If I'm a user preparing tax forms, I'm inclined to retry the command with the year I'm filing for:

luca form us.f1040sa 2014

But I still receive

Please specify a particular version of this form with a command like:
   luca form us.f1040sa 2012

Instead, I would expect to receive a us.f1040sa form for 2014 if Luca is able to prepare it, or an error message telling me that Luca does not yet support that year for this tax form.

Error using "complete" command on us.1040 due to missing f1040-tax-table.csv

When running the complete command on a default json input created using the form command, I'm presented with the following error:

(luca_example)ubuntu@ip-172-31-6-233:~/luca_example/2012$ luca complete 2012-f1040.json
2012-f1040.json
Traceback (most recent call last):
  File "/home/ubuntu/anaconda/envs/luca_example/bin/luca", line 11, in <module>
    sys.exit(main())
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/commandline.py", line 34, in main
    for line in _main(args, terminal):
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/commandline.py", line 64, in _main
    luca.forms.actions.complete(args['<tax-filing.json>'], not args['-j'])
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/forms/actions.py", line 70, in complete
    form_module, form = complete_form(json_path)
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/forms/actions.py", line 110, in complete_form
    form, form_module = process(json_data)
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/forms/actions.py", line 157, in process
    form_module.compute(form)
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/forms/us/f1040.py", line 100, in compute
    f.line44 = tax_from_tax_table(f.line43, f.filing_status)
  File "/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/forms/us/f1040.py", line 201, in tax_from_tax_table
    with open(os.path.join(here, 'f1040-tax-table.csv')) as f:
IOError: [Errno 2] No such file or directory: '/home/ubuntu/anaconda/envs/luca_example/lib/python2.7/site-packages/luca/forms/us/f1040-tax-table.csv'

This appears to occur because the version of Luca distributed via pip is missing https://github.com/brandon-rhodes/luca/blob/master/luca/forms/us/f1040-tax-table.csv

Manually inserting this file into the downloaded library fixes this issue.

Completing Tax Forms workflow needs to be updated to reflect `defaults` -> `form` command name change

In https://luca.readthedocs.org/en/latest/completing-forms.html we see:

  1. I ask Luca to build an initial, blank version of the form, that lists the default value of each field. I can choose whatever filename I want. I typically start each filename with the year and (if applicable) quarter so that they sort by date when I list the directory.

luca defaults us.f941 > 2012-Q1-f941.json

whereas it should be

luca form us.f941 2012 > 2012-Q1-f941.json

And yes, I'm happy to make this change as a PR in the next few days.

Code mistakes

Hi,

  • There are some "print" lines on "commandline.py" without parenthesis.
  • Creating a rule raises an error: ModuleNotFoundError: No module named '_curses'
    It's supposed that PIP included all the modules needed during install.

I got stuck at the very beginning, and it's a shame, because I have a lot of interest on it.

EDIT: probably a more experienced user would be able to override those "errors", but I'm unfortunately not in that group.

Thanks for your work.

`luca form` should take an output file as an argument

When using the luca form command as detailed in the walkthrough, but for form f1040:

luca form us.f1040 > 2012-Q1-f1040.json

We receive no error messages, but the generated file 2012-Q1-f941.json has these contents:

Please specify a particular version of this form with a command like:
   luca form us.f1040 2012
   luca form us.f1040 2013
   luca form us.f1040 2014

This is, of course, because the proposed usage is to capture the output of the command to a file. In this case, the command wasn't run properly, so what's saved to the file is the error message instead of the expected contents.

It may be preferable to take an output file name as an argument, so that in cases of incorrect usage the error message can be raised directly to the user. It's hard to imagine a scenario when a user actually wants to see the json output in the console instead of going directly to a file. This would also allow you to have a standard file naming format that obviates the need to enter any file name.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.