Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

converters

Small, reusable value-conversion functions (e.g. Julian Date <-> ISO 8601, first-of-list, GeoJSON bbox extraction), one Python module per function.

The one-module-per-converter layout means each converter has its own stable, dereferenceable source URL (src/converters/<name>.py) -- useful for a data-model document (e.g. a JSON-LD /vocabulary endpoint) that wants to cite exactly which code a named conversion resolves to, not just an opaque string.

Usage

from converters import CONVERTERS

CONVERTERS["jd_to_isoformat"](2451545.0)

Extracted from epntap2cql2, whose own converters.py re-exports CONVERTERS from here and adds the one converter that is specific to that service (get_datalink_url_for_item, which depends on its request context).

Adding a converter

Add src/converters/<name>.py defining one function named <name>; converters.CONVERTERS picks it up automatically at import time — no separate registration step.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages