Skip to main content

Platformics

Platformics is a GraphQL API framework that relies on code generation to implement a full featured GraphQL API on top of a PostgreSQL database, with support for authorization policy enforcement and file persistence via S3. It's built on top of the best available Python tools and frameworks!

The libraries and tools that make Platformics work:

image

Current Features

  • Express your schema in a straightforward YAML format
  • GraphQL Dataloader pattern (no n+1 queries!)
  • Authorization policy enforcement
  • Flexible Filtering
  • Data aggregation
  • Top-level pagination
  • Relationship traversal
  • DB migrations
  • Generated Test fixtures
  • pytest wiring
  • VSCode debugger integration
  • Add custom REST endpoints to generated API
  • Add custom GQL queries/mutations to generated API
  • Support arbitrary class inheritance hierarchies (1-level deep)
  • Package and publish to PyPI

Roadmap

  • Plugin hooks to add business logic to generated GQL resolvers

How to set up your own platformics API

  1. Copy the test_app boilerplate code to your own repository.
  2. Edit schema/schema.yml to reflect your application's data model.
  3. Run make build and then make init to build and run your own GraphQL API service.
  4. Browse to http://localhost:9009/graphql to interact with your api!
  5. Run make token to generate an authorization token that you can use to interact with the API. The make target copies the necessary headers to the system clipboard. Paste the token into the headers section at the bottom of the GraphQL explorer API

Versioning platformics

Platformics can be used in downstream applications by either

  • using the platformics image as the base Docker image. To select a version of platformics, add the appropriate version tags to the docker image
  • installing as a python dependency, pip install platformics.

The version in pyproject.toml is managed using poetry-dynamic-versioning which determines version based on git tags.

Iterating on your schema

  1. Make changes to schema/schema.yml
  2. Run make codegen to re-run code gen and restart the API service
  3. If your changes require DB schema changes, run make alembic-autogenerate and make alembic-upgrade-head to generate DB migrations and run them.

HOWTO

Contributing

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to opensource@chanzuckerberg.com.

Reporting Security Issues

Please disclose security issues responsibly by contacting security@chanzuckerberg.com.

Metadata

Release files for platformics 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for platformics 1.0.3
File Size Uploaded Provenance
platformics-1.0.3.tar.gz 52.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for platformics 1.0.3
File Interpreter ABI Platform
platformics-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 119.1 kB

Release files / platformics-1.0.3.tar.gz

Download URL platformics-1.0.3.tar.gz
Size 52.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5fdebe98db5630fb9c13ee38c3461a07b78091059bc9761758fe7928ef532aaf
BLAKE2b-256 checksum
How to use checksums
177af7ca9d1467d54fc4c0b42a2b57a35fd0786f5bea58241327c497f9f060b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2025.

Transparency log

Release files / platformics-1.0.3-py3-none-any.whl

Download URL platformics-1.0.3-py3-none-any.whl
Size 66.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19e1de43507b109e51de7ec6f5249ab516a46e045dd1a572a6040b1d9df9c36a
BLAKE2b-256 checksum
How to use checksums
9f5ddc2ea417feb38f2ae2a8d382b12cead07a95542cda928e06c1156c45594f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2025.

Transparency log

Security for platformics 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for platformics-1.0.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page