Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Read_SDMX method #159

Closed
wants to merge 28 commits into from
Closed

Conversation

javihern98
Copy link
Contributor

@javihern98 javihern98 commented Dec 18, 2024

Summary of changes:

  • Added convenience method read_sdmx to use same method for all parsers.
  • Added SDMXFormat enumeration with the supported formats
  • Refactored message.py to avoid circular imports and place there only the Message and Header classes
  • Enhanced input_processor to check for xml, csv and json files
  • Fixed readers to use always Short_URN as keys of the result, to be placed on Message structure or data fileds
  • Changed data type on Component.concept to Union[Concept, ItemReference] to allow the reading of DataStructureDefinition files without references.
  • Added support for URL retrieving
  • Made httpx dependency as mandatory

Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
@javihern98 javihern98 linked an issue Dec 18, 2024 that may be closed by this pull request
… their classes. Added read_sdmx method to reader

Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
… content. Use ItemReference as ConceptIdentity if necessary. Fixed tests accordingly.

Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
…dd-read_sdmx-convenience-method

# Conflicts:
#	src/pysdmx/model/message.py
…es. Added get_datasets methods. Maxed code coverage in all code.

Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
@javihern98 javihern98 requested review from sosna and stratosn December 19, 2024 16:21
@javihern98
Copy link
Contributor Author

@sosna @stratosn I would like to inclñude this as well on release 1.0.0, if we have still time to review this tomorrow. We will adapt the documentation as well if this is approved on time.

@javihern98 javihern98 marked this pull request as ready for review December 19, 2024 16:22
"""Enumeration of supported SDMX read formats."""

SDMX_ML_2_1 = "SDMX-ML 2.1"
# SDMX_JSON_2 = "SDMX-JSON 2.0.0"
Copy link
Contributor Author

@javihern98 javihern98 Dec 19, 2024

Choose a reason for hiding this comment

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

@sosna This is a placeholder to include as well methods to read the JSON formats, still I have not found the way to implement them. Any ideas?

@@ -108,7 +109,7 @@ class Component(Struct, frozen=True, omit_defaults=True):
id: str
required: bool
role: Role
concept: Concept
concept: Union[Concept, ItemReference]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sosna In order to add the compatibility to the "Concept Identity Reference", I added the tag attribute to true both here and in ItemReference. It passes all the tests, but pelase check if it may raise any future problems (As far as I could check, it should not)

Copy link
Collaborator

@sosna sosna left a comment

Choose a reason for hiding this comment

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

Hi @javihern98. There is a lot of work we need to do next year about formats serialization and deserialization. Is there any important reason to "rush" this now, a bit as a last minute addition, or is this something we can discuss when there is more capacity early next year?

@javihern98
Copy link
Contributor Author

Hi @javihern98. There is a lot of work we need to do next year about formats serialization and deserialization. Is there any important reason to "rush" this now, a bit as a last minute addition, or is this something we can discuss when there is more capacity early next year?

We do not need to rush it and discuss it further after Christmas😁

Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
…detection on SDMX-ML. Fixed tests.

Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
…_datasets method.

Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
…rage.

Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
…ency.

Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
…thod' into 156-add-read_sdmx-convenience-method
@javihern98
Copy link
Contributor Author

Awaiting to finish #164 before merging this

@javihern98 javihern98 marked this pull request as draft January 10, 2025 12:32
…with mocks.

Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
Signed-off-by: javier.hernandez <javier.hernandez@meaningfuldata.eu>
@javihern98
Copy link
Contributor Author

Closing as it is included in #172

@javihern98 javihern98 closed this Jan 13, 2025
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.

Add read_sdmx convenience method
2 participants