| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Registry.Pypi.Wire
Description
The PyPI registry wire JSON, decoded into a typed model.
This is a placeholder boundary, the PyPI counterpart to
Ecluse.Core.Registry.Npm.Wire. Écluse serves only npm, so the PyPI wire model covers
just the one shape another part of the system reads from a PyPI project: the list
of published version strings, taken from the releases object of the
/pypi/{project}/json response. The per-release metadata (file URLs, digests,
requires-python) is left as an opaque Value rather than modelled, so a full
PyPI adapter can grow this module the way the npm wire layer models the packument
without disturbing callers that only want the version listing.
Like the npm wire layer, the decoder is lenient: a document with no releases
object yields an empty listing rather than a decode failure, so a partial or
unexpected body still parses to "no versions" instead of throwing.
Synopsis
- newtype ProjectJson = ProjectJson {
- pjReleases :: Map Text Value
- projectVersions :: ProjectJson -> [Text]
Documentation
newtype ProjectJson Source #
A PyPI project's /pypi/{project}/json document, modelled only as far as
its releases map: each key is a published version string, each value the
(unmodelled) array of release files for that version.
Constructors
| ProjectJson | |
Fields
| |
Instances
| FromJSON ProjectJson Source # | |
Defined in Ecluse.Core.Registry.Pypi.Wire Methods parseJSON :: Value -> Parser ProjectJson Source # parseJSONList :: Value -> Parser [ProjectJson] Source # | |
| Show ProjectJson Source # | |
Defined in Ecluse.Core.Registry.Pypi.Wire Methods showsPrec :: Int -> ProjectJson -> ShowS # show :: ProjectJson -> String # showList :: [ProjectJson] -> ShowS # | |
| Eq ProjectJson Source # | |
Defined in Ecluse.Core.Registry.Pypi.Wire | |
projectVersions :: ProjectJson -> [Text] Source #
The published version strings of a PyPI project: the keys of its releases
map, exactly as PyPI lists them.