Skip to main content

PolicyEngine Household API

Project description

PolicyEngine Household API

A version of the PolicyEngine API that runs the calculate endpoint over household object. To debug locally, run make debug.

Quick self-hosted run

If you want to try the API without requesting hosted credentials, run the published Docker image:

docker run --rm -p 8080:8080 ghcr.io/policyengine/policyengine-household-api:latest

The image can take a little time to initialize on first start and is best run on a machine with roughly 4 GB of RAM available.

Then inspect the service metadata:

curl http://localhost:8080/

and send calculations to:

http://localhost:8080/us/calculate

Hosted API docs live at https://www.policyengine.org/us/api.

Local development with Docker Compose

To run this app locally via Docker Compose:

% make docker-build
% make docker-run

and point your browser at http://localhost:8080 to access the API.

To develop the code locally, you will want to instead start only the Redis docker container and a one-off API container, with your local filesystem mounted into the running docker container.

% make services-start
% make docker-console

Then inside the container, start the Flask service:

policyapi@[your-docker-id]:/code$ make debug

and point your browser at http://localhost:8080 to access the API.

Running with other PolicyEngine services

If you're running this alongside other PolicyEngine services (e.g., the main API) and need containers to communicate across projects, use the external network mode:

% make docker-network-create   # Create shared network (once)
% make docker-run-external     # Run with external network

This connects the household API to a shared policyengine-api_default network that other PolicyEngine docker-compose projects can also join.

For development with external networking:

% make docker-network-create
% make services-start-external
% make docker-console

Development rules

  1. Every endpoint should return a JSON object with at least a "status" and "message" field.

Please note that we do not support branched operations at this time.

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

policyengine_household_api-0.14.3.tar.gz (271.2 kB view details)

Uploaded Source

Built Distribution

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

policyengine_household_api-0.14.3-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

Details for the file policyengine_household_api-0.14.3.tar.gz.

File metadata

File hashes

Hashes for policyengine_household_api-0.14.3.tar.gz
Algorithm Hash digest
SHA256 72be23255eba5f12c829ebf4ed802e2749bbc561483b3e41af48f76c10f445b2
MD5 2137901599f6aca34002aa896b6b8384
BLAKE2b-256 4a63de608039af4a914afaf304d18cd6ed26b07580541d1011174c5287cdaca0

See more details on using hashes here.

Provenance

The following attestation bundles were made for policyengine_household_api-0.14.3.tar.gz:

Publisher: deploy-staged.yml on PolicyEngine/policyengine-household-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file policyengine_household_api-0.14.3-py3-none-any.whl.

File metadata

File hashes

Hashes for policyengine_household_api-0.14.3-py3-none-any.whl
Algorithm Hash digest
SHA256 23876fb81b6d6835ab0af60cd93d3363b203a15c6b2992e710b1d120a0776595
MD5 7eb63241b87ee19d923f3e0ebc1264a7
BLAKE2b-256 65859d19a55c671870f77a7ea74662a1420b5f624c3e108d16ef5041452ce197

See more details on using hashes here.

Provenance

The following attestation bundles were made for policyengine_household_api-0.14.3-py3-none-any.whl:

Publisher: deploy-staged.yml on PolicyEngine/policyengine-household-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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