Skip to content

melodi - #306

Merged
tfardet merged 18 commits into
masterfrom
feat/melodi
Oct 18, 2026
Merged

melodi#306
tfardet merged 18 commits into
masterfrom
feat/melodi

Conversation

@tgrandje

@tgrandje tgrandje commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@tgrandje tgrandje self-assigned this Apr 7, 2026
@tgrandje tgrandje changed the title melodi catalog melodi Apr 7, 2026
@tgrandje

Copy link
Copy Markdown
Collaborator Author

@hadrilec @linogaliana @tfardet @RLesur do any of you guys see the point in covering MELODI's "référentiel" endpoint through pynsee?

It doesn't seem to be used in the R package and I have no usecase in my mind right now (that and the fact that the json returned seem overly complex to be used in a generic way)...

@tgrandje

Copy link
Copy Markdown
Collaborator Author

Note: 2 tickets have been opened on INSEE's API portal.

  • one regarding problems with pagination (for instance querying DS_POPULATIONS_REFERENCE with no filters). I don't think any workaround can be done for this in pynsee.
  • one regarding X-INSEE-Api-Key-Integration header were MELODI seems to confuse the header with the one used for SIRENE consumption. I've added a fix in pynsee in the PynseeAPISession object.

@hadrilec

hadrilec commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

Hi, I had started in the branch catalog to write a function retrieving the list of datasets available via melodi. On the long term, I think it makes sense, as I understand more INSEE datasets shall be available melodi. I understand that DoReMiFaSol already uses melodi: https://github.com/InseeFrLab/DoReMIFaSol

@tgrandje

Copy link
Copy Markdown
Collaborator Author

Hi @hadrilec , I've already re-used your code for the catalog (which I also think is gonna be madatory). I was instead speaking of the "référentiel" endpoint and I haven't quite seen the point (yet ?).

Right now, you got catalog (as already said), you got all available dimensions and values for a given dataset using the "range" endpoint : it seems to me that's enough ?

GrasClement and others added 4 commits October 14, 2026 11:08
* add .vscode to gitignore

* add notebooks to gitignore

* wip docstrings and fixes data.py

* fix measures column issue in _parse_dataset_observations

* fix(melodi): handle non-MELODI idbanks

* test(melodi): add pytest coverage and fix update/silent signatures

Signed-off-by: GrasClement <gras.clement@orange.fr>

* test(melodi): finish tests for melodi

Signed-off-by: GrasClement <gras.clement@orange.fr>

* doc(melodi): add melodi to the documentation

Signed-off-by: GrasClement <gras.clement@orange.fr>

* doc(melodi): linting

Signed-off-by: GrasClement <gras.clement@orange.fr>

* doc(melodi): fix spacing

Signed-off-by: GrasClement <gras.clement@orange.fr>

* fix(melodi): simplify measures parsing, log empty idbank results

Signed-off-by: GrasClement <gras.clement@orange.fr>

* test(melodi): fix redundant checks and update comments per review

Signed-off-by: GrasClement <gras.clement@orange.fr>

* doc(melodi): reorder modules and flag metadata as deprecated

Signed-off-by: GrasClement <gras.clement@orange.fr>

---------

Signed-off-by: GrasClement <gras.clement@orange.fr>
Co-authored-by: cgras <clement.gras@ccomptes.fr>
@tgrandje
tgrandje marked this pull request as ready for review October 14, 2026 09:31
@tgrandje
tgrandje requested a review from tfardet October 14, 2026 09:57
@tgrandje

Copy link
Copy Markdown
Collaborator Author

This should be ok, let's review @tfardet when you got time enough !

@tfardet tfardet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @tgrandje and @GrasClement for this new additions.
I have a few points of discussions that I opened regarding naming and descriptions, let me know what you think.

Comment thread pynsee/melodi/data.py Outdated
Comment thread pynsee/melodi/data.py Outdated
Comment thread pynsee/melodi/data.py Outdated
Comment thread pynsee/melodi/data.py
Comment thread pynsee/melodi/data.py Outdated
Comment thread pynsee/utils/requests_session.py
Comment thread pynsee/utils/requests_session.py Outdated
Comment thread pynsee/__init__.py
Comment thread pyproject.toml
Comment thread tests/melodi/__init__.py Outdated
tgrandje and others added 3 commits October 14, 2026 20:19
Co-authored-by: tfardet <79037344+tfardet@users.noreply.github.com>
Co-authored-by: tfardet <79037344+tfardet@users.noreply.github.com>
Co-authored-by: tfardet <79037344+tfardet@users.noreply.github.com>
Comment thread pyproject.toml Outdated
@GrasClement

Copy link
Copy Markdown
Contributor

Just spotted that Melodi isn't in the sources listed in the "Data Search and Collection Advice" section of root README.md yet, might want to add it rightaway ?

@tgrandje

Copy link
Copy Markdown
Collaborator Author

@GrasClement thanks, I had completly forgotten about that : I've altered it, please have a look.

@GrasClement @tfardet feel free to complete/correct this PR without me, I'll be unavailable for the next 10-ish days.

@GrasClement

Copy link
Copy Markdown
Contributor

Thanks @tgrandje looks almost ready (going back to python 3.10 and the README and we're good?). I don’t see any new commits on the PR. If you haven’t pushed, I’m happy to complete the remaining work with @tfardet while you’re unavailable.

@tfardet

tfardet commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

@GrasClement yes, if you can make a PR against this branch with these two things I can include it and merge everything, thanks!

@GrasClement

Copy link
Copy Markdown
Contributor

@tfardet #312 It's done and ready to merge whenever you've got time, thanks :)

* add Melodi to README.md, rollback to 3.10 in toml and minor dosctring wording change

* also mention get_series in README

---------

Co-authored-by: tfardet <79037344+tfardet@users.noreply.github.com>
@tfardet

tfardet commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Failing tests are unrelated, so merging as is

@tfardet
tfardet merged commit 4f9d419 into master Oct 18, 2026
2 of 4 checks passed
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