Skip to content

Hapi REST provider#285

Merged
jeandet merged 18 commits intoSciQLop:mainfrom
co-libri-org:hapi_provider_183
Apr 3, 2026
Merged

Hapi REST provider#285
jeandet merged 18 commits intoSciQLop:mainfrom
co-libri-org:hapi_provider_183

Conversation

@RichardHitier
Copy link
Copy Markdown
Contributor

Fixes issue #183
Simple mirror to HAPI REST endpoints.

Provides methods to end user

  • capabilities() -> dict
  • hapi() -> dict
  • info(dataset, param) -> dict
  • about() -> dict
  • data(dataset, param, .....) -> SpeasyVariables

Catches Hapi standard errors, returned to user:

  • 12xx
  • 14xx
  • 15xx

Comment thread speasy/core/hapi/client.py Fixed
Comment thread speasy/core/codecs/bundled_codecs/hapi/binary/codec.py Fixed
Comment thread speasy/core/codecs/bundled_codecs/hapi/csv/codec.py Fixed
Comment thread speasy/core/hapi/client.py Fixed
Comment thread speasy/core/hapi/client.py Fixed
Comment thread speasy/core/hapi/parser.py Fixed
Comment thread speasy/core/hapi/provider.py Fixed
Comment thread speasy/core/hapi/provider.py Fixed
Comment thread tests/test_hapi.py Fixed
Comment thread speasy/core/hapi/client.py Fixed
Comment thread speasy/core/hapi/provider.py Fixed
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 88.18681% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.71%. Comparing base (93ce7a0) to head (05b4226).

Files with missing lines Patch % Lines
speasy/core/hapi/client.py 86.95% 6 Missing and 6 partials ⚠️
...y/core/codecs/bundled_codecs/hapi/binary/reader.py 86.56% 5 Missing and 4 partials ⚠️
speasy/core/codecs/bundled_codecs/hapi/writer.py 52.94% 6 Missing and 2 partials ⚠️
speasy/core/codecs/bundled_codecs/hapi/codec.py 89.47% 2 Missing and 4 partials ⚠️
...y/core/codecs/bundled_codecs/hapi/binary/writer.py 91.66% 1 Missing and 2 partials ⚠️
speasy/core/hapi/exceptions.py 78.57% 3 Missing ⚠️
speasy/core/hapi/parser.py 83.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #285      +/-   ##
==========================================
- Coverage   85.10%   84.71%   -0.40%     
==========================================
  Files          69       81      +12     
  Lines        4834     5108     +274     
  Branches      668      697      +29     
==========================================
+ Hits         4114     4327     +213     
- Misses        479      525      +46     
- Partials      241      256      +15     
Flag Coverage Δ
unittests 84.71% <88.18%> (-0.40%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread speasy/core/hapi/client.py Fixed
Comment thread speasy/core/hapi/client.py Fixed
Comment thread speasy/core/hapi/client.py Fixed
Comment thread speasy/core/hapi/provider.py Fixed
Comment thread tests/test_hapi.py

from speasy.core.hapi.client import HapiClient, HapiEndpoint
from speasy.core.hapi.provider import HapiProvider
from speasy.core.hapi.exceptions import HapiRequestError, HapiServerError, HapiNoData

Check notice

Code scanning / CodeQL

Unused import Note test

Import of 'HapiServerError' is not used.
Import of 'HapiNoData' is not used.
Comment thread speasy/core/codecs/bundled_codecs/hapi/codec.py Fixed
Comment thread speasy/core/codecs/bundled_codecs/hapi/csv/reader.py Fixed
Comment thread speasy/core/codecs/bundled_codecs/hapi/csv/reader.py Fixed
Comment thread speasy/core/codecs/bundled_codecs/hapi/csv/reader.py Fixed
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@jeandet jeandet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for me, thank you.

@brenard-irap
Copy link
Copy Markdown
Collaborator

Good for me too

@jeandet jeandet merged commit 0ab88bc into SciQLop:main Apr 3, 2026
13 of 23 checks passed
@RichardHitier
Copy link
Copy Markdown
Contributor Author

Thank you for the approval

@RichardHitier RichardHitier deleted the hapi_provider_183 branch April 3, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants