Giter Site home page Giter Site logo

suffolklitlab / docassemble-alweaver Goto Github PK

View Code? Open in Web Editor NEW
18.0 6.0 5.0 2.91 MB

A tool to help quickly generate draft interviews from an existing document (pdf or DOCX) for the docassemble platform.

Home Page: https://apps-test.suffolklitlab.org/start/ALWeaver/assembly_line/#/1

License: MIT License

Python 80.58% CSS 2.02% Gherkin 5.28% JavaScript 1.40% Mako 10.73%
docassemble access-to-justice form-builder courts pdf docx form-filling

docassemble-alweaver's Introduction

Assembly Line Weaver: Suffolk LIT Lab Document Assembly Line

PyPI version

drawing of two cartoon people collaborating on building a web application

The Assembly Line Project is a collection of volunteers, students, and institutions who joined together during the COVID-19 pandemic to help increase access to the court system. Our vision is mobile-friendly, easy to use guided online forms that help empower litigants to access the court remotely.

Our signature project is CourtFormsOnline.org.

We designed a step-by-step, assembly line style process for automating court forms on top of Docassemble and built several tools along the way that you can use in your home jurisdiction.

This package contains an automation and rapid prototyping tool to support authoring robust, consistent, and attractive Docassemble interviews that help complete court forms. Upload a labeled PDF or DOCX file, and the Assembly Line Weaver will produce a runnable, clean code, draft of a Docassemble interview that you can continue to edit and refine.

Read more on our documentation page.

Related repositories

Documentation

https://suffolklitlab.org/docassemble-AssemblyLine-documentation/

History

See the CHANGELOG for more information.

Authors

Quinten Steenhuis, [email protected]
Michelle
Bryce Willey, [email protected] Lily
David Colarusso
Nharika Singh

Installation requirements

Using auto drafting mode

As of June 2023, the Weaver includes auto drafting mode.

To use the automatic field grouping feature of auto drafting mode, you need to install either:

  1. The en_core_web_lg model on your server, or
  2. An API token for tools.suffolklitlab.org.

You can request an API token by emailing [email protected]. If you prefer to install your own copy of the en_core_web_lg model, you can access it the first time you select to use auto drafting mode when logged in as an administrator.

docassemble-alweaver's People

Contributors

brycestevenwilley avatar colarusso avatar dependabot[bot] avatar niharikasingh avatar nonprofittechy avatar plocket avatar purplesky2016 avatar

Stargazers

 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

docassemble-alweaver's Issues

No longer turn any variable that we don't explicitly handle into an attribute of an object

This is leading to errors with intrinsic names.

E.g.:

defendants_name_middle_initial is turned into defendants[0].name_middle_initial. This breaks if you have a question that looks for users[0].name_middle_initial. I think there are workarounds for that, but it's probably better to just let people decide to make them attributes if they want to, but not default to that.

Built-in fields need some more metadata to help generating review screens

Every built-in field needs a few placeholders:

  1. A label
  2. An editable variable name (e.g., users[0].name.first)
  3. A display value (for showing current value in review screen. E.g., users[0].address.block() )

These will then be usable when we generate the placeholder review screen. We could also use to improve the logic list and the PDF attachment.

Remove arbitrary attribute feature. Create plain variable names.

Currently, we have pre-determined core words that the wizard identifies in the user-created PDF field names. Ex: plaintiff. We've determined some standard attributes for those core words that we account for, but we also transform any arbitrary characters associated with a core word into an arbitrary attribute for the core word. For example, the PDF field label plaintiff_has_children_yes is turned into plaintiffs[0].has_children_yes.

It's possible there would be a small future benefit to this, but in the meantime it's causing problems. If you have the time at some point, @nonprofittechy , I'd love to have a more detailed description of those problems. An example of the intrinsic name problem could especially be useful.

Instead of forcing arbitrary values, we should use the PDF field labels as they are.

Move some "magic" code out of basic-questions and into the wizard output

This will make it easier for interview authors to reason about the code and what it is doing without clicking "source".

Look into how/where to insert a code block like this: addresses_to_search = [users[0].address]. In the interview order block, or standalone?

If it's in the interview_order block, it needs to be after users[0].address.address is defined.

Figure out to eliminate the need to have two attachment blocks with their own set of fields

Most promising idea so far:

make the attachment variable a DADict. It will have two keys: my_attachment['final'] and my_attachment['preview']. We can control whether certain fields are displayed by checking if i=="final". That will also work for fields like editable. We now only need one attachment block. Also: use fields code to make the attachment variable more concise. This means it's all Python, instead of Mako and regular text. We almost never use regular text.

other ideas:

  • use the preview attachment as the final attachment's source, with pdf template file: code. just add in the signature field (this seems the most promising approach)
  • use the Docassemble data block to create list of variables. reconsider it on the attachment block. add in the signature field just for the final attachment block. Problem: this won't work with skip undefined
  • build the list of fields in a Python block. Copy the list, and add the attachment variable. Will this cause problems of timing for when list is built?
  • Use an if statement for the signature field, keep the rest as a YAML list. Problem: we need to undefine the attachment variable to display the signature in the final version. This requires a very specific order of operations to keep working, but we use the attachment in a few different places and may not have that level of control over the timing for when it gets turned into a PDF, e.g.
  • Keep the structure basically the same, but simplify to the version that doesn't use Mako tags so it's a little easier to read
  • Send all of the interview variables to the PDF. Use a convention or make sure that all variables use the same name as in the PDF. Problem: PDFs can't handle duplicate variable names. So we already know that we'll need to handle variables like user's name in two places--it's not a 1-1 map.
  • Use a hybrid approach: create a function that processes the list of variables "just in time" and removes the signature block.

Replace "mark_unfilled_fields_empty" with use of `skip undefined`

Currently, we set every field to empty at the end of the code block before trying to assemble a PDF. We should experiment with the use of the skip undefined option instead, which should be much safer to use.

This may spark some discussion but I think the key to making this a safe choice is to explicitly trigger every screen/needed definition in the logic block; not rely on the attachment block to implicitly seek the definition of a variable.

Variable transformed that should not be

Actual result:

      {'variable': 'attorney_of_record_address_on_one_line',
       'transformed_variable': 'attorneys[0].of_record_address_on_one_line',
      'field_type': 'text',
      'field_data_type': 'text',
      },

Expected result:

  • attorney_of_record_address_on_one_line is not transformed at all

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.