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.4.tar.gz (280.1 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.4-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for policyengine_household_api-0.14.4.tar.gz
Algorithm Hash digest
SHA256 17bfda30dc33c5e47ed7e5bf4c9d26b6cb2763aabfce7075c6cc589d8d8dd3fe
MD5 663aa77348a4aaba9676e3661f6cc9d2
BLAKE2b-256 70c219a9a40e6d7b4a243f829bbe27cfcad3820fbee71ae9db8b35bc289b4bfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for policyengine_household_api-0.14.4.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.4-py3-none-any.whl.

File metadata

File hashes

Hashes for policyengine_household_api-0.14.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c3f2dbd4c6cbc9c371ece189efc8f3882872e3c241c0073336a99d99e4c3803c
MD5 42b32a0be91265bfcbb7b871c0f1732e
BLAKE2b-256 c371b6f250cf486819d334010ce9f2e44f191880b5ff644e888ca9e2d2d31035

See more details on using hashes here.

Provenance

The following attestation bundles were made for policyengine_household_api-0.14.4-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