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.1.tar.gz (13.6 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.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: udi_grammar_py-0.2.1.tar.gz
  • Upload date:
  • Size: 13.6 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.1.tar.gz
Algorithm Hash digest
SHA256 7a219cbe0bc28089d2688213f2cd73c32ae1dc9b9de7e213211c0282e62c859b
MD5 03ccda8ede11a90a39d4752689db45bd
BLAKE2b-256 203f309168326c256b47e3f123845ecd597450074b11564ab2b11ef9c24b21e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for udi_grammar_py-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: udi_grammar_py-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 80779cb42b84ffef1a005c03c395beb3ce281809160027a5dc92fa18e54cf6bd
MD5 8f2230a9f760b2fbc29ab7953fe4c4d4
BLAKE2b-256 b17305ff53c9fd9b0ce78d69bbe8a8eb059a210da591d858e9ed9a6633994fc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for udi_grammar_py-0.2.1-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