Skip to main content

A python library for creating udi-grammar specifications

Project description

udi-grammar-py

Python code for generating Universal Discovery Interface (UDI) specifications.

Quick Start Guid

pip install udi-grammar-py

from udi_grammar_py import Chart, Op
spec = (Chart()
    .source("samples", "./data/example_samples.csv")
    .groupby(["organ", "organ_condition"])
    .rollup({"count": Op.count()})
    .mark("bar")
    .x(field="count", type="nominal")
    .y(field="ogan", type="quantitative")
    .color(field="organ_condition", type="quantitative")
    .to_json(pretty=True)
)
print(spec)

Result:

{
  "source": {
    "name": "samples",
    "source": "./data/example_samples.csv"
  },
  "transformation": [
    {
      "groupby": [
        "organ",
        "organ_condition"
      ]
    },
    {
      "rollup": {
        "count": {
          "op": "count"
        }
      }
    }
  ],
  "representation": {
    "mark": "bar",
    "mapping": [
      {
        "encoding": "x",
        "field": "count",
        "type": "quantitative"
      },
      {
        "encoding": "y",
        "field": "organ",
        "type": "nominal"
      },
      {
        "encoding": "color",
        "field": "organ_condition",
        "type": "nominal"
      }
    ]
  }
}

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

udi_grammar_py-0.2.7.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

udi_grammar_py-0.2.7-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file udi_grammar_py-0.2.7.tar.gz.

File metadata

  • Download URL: udi_grammar_py-0.2.7.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for udi_grammar_py-0.2.7.tar.gz
Algorithm Hash digest
SHA256 74803382e81c6026c986f2af0fa85b66c7a8e1f4ab42535851c2321b6449ea3c
MD5 75906d066f3f2980e73e0ecd86135bd7
BLAKE2b-256 9de0ee13593b969c47ac944526c83fcddc1e2fcefdb8b36f6834e8c3c2a2cd0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for udi_grammar_py-0.2.7.tar.gz:

Publisher: release.yml on hms-dbmi/udi-grammar-py

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

File details

Details for the file udi_grammar_py-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: udi_grammar_py-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for udi_grammar_py-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 04b552bf23f327db64886f8f20c01b68db806fec5f70465e9a79338ac7ba5d19
MD5 1a58e9022c4b3ecaf430c3909043226a
BLAKE2b-256 142b3b6040a6a6e5e2e564804db3e17bdf6efbf08d1d275fc235b8d0bdfceab6

See more details on using hashes here.

Provenance

The following attestation bundles were made for udi_grammar_py-0.2.7-py3-none-any.whl:

Publisher: release.yml on hms-dbmi/udi-grammar-py

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