Skip to main content

A docassemble extension.

Project description

PovertyScale

Poverty scale, updated approximately on an annual basis, to use for calculating income eligibility in the United States.

Just get the JSON file

Justification

https://github.com/codeforamerica/fplapi exists but requires a dedicated server, and hasn't been updated in recent years. At Suffolk we are already maintaining and consuming this information in multiple apps; it's simple for us to maintain the API alongside it.

The intent is that you will run this on your own Docassemble server, but we may maintain a public endpoint at some point. If you run your own Docassemble server, this allows you have one source of truth for both use in Docassemble interviews (without the overhead of the REST call) and for use in any non-Docassemble webapps you may have.

Update frequency

The Federal Poverty Guidelines are updated annually, but not usually published in the federal register until a month or so into a new year. We will try to closely track that update timeline. Pull requests with updated figures are welcome.

Examples

See example and demo in demo_poverty_scale.yml

This package contains a JSON file, federal_poverty_scale.json, which can be referenced directly, as well as a module poverty.py which exports poverty_scale_income_qualifies

REST API

Once this file is installed, you can access it as a REST API with a JSON response. The following endpoints are created on your Docassemble server:

  • /poverty_guidelines (same as the JSON file)
  • /poverty_guidelines/household_size/ (per-household size)
  • /poverty_guidelines/household_size/?state=ak|hi&multiplier=2
  • /poverty_guidelines/qualifies/household_size/<household_size>?income=1000&state=AK&multiplier=1.5

You can just use the API endpoint to retrieve the contents of the JSON file, or specify a household size and optional state and multiplier to get a tailored response, with either the income limit for a given household size or a determination that someone's income is below the poverty guideline.

Income is expected to be provided on a monthly basis.

Python function signatures

def poverty_scale_income_qualifies(total_monthly_income:float, household_size:int=1, multiplier:int=1)->Union[bool,None]:
  """
  Given monthly income, household size, and an optional multiplier, return whether an individual
  is at or below the federal poverty level.
  
  Returns None if the poverty level data JSON could not be loaded.
  """
  
def poverty_scale_get_income_limit(household_size:int=1, multiplier:int=1)->Union[int, None]:
  """
  Return the income limit matching the given household size.
  """
  

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docassemble_povertyscale-2026.0.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docassemble_povertyscale-2026.0.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file docassemble_povertyscale-2026.0.0.tar.gz.

File metadata

File hashes

Hashes for docassemble_povertyscale-2026.0.0.tar.gz
Algorithm Hash digest
SHA256 2787034a6592a201d71a329d3ea10a6b24449ab39290dd23c22239501c1a7c0d
MD5 6db07ec44cb8b544c2cfc6b2a08fcdc7
BLAKE2b-256 cb9906c1f6197b0e3180a755c5802feb9ffa501ac72b071e0d74edf60e05d9ed

See more details on using hashes here.

File details

Details for the file docassemble_povertyscale-2026.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for docassemble_povertyscale-2026.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f00108be0d699b2b3eaf66e28fe45d3c017fef8a3a0acd70fa25a7ef9008276
MD5 1b22357d4d6c4765c12f8579c8a8cb87
BLAKE2b-256 2158a1f80ae34709407dad80d49e385b1bd04c7c66fe503700ffa26141990dcd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page