Skip to content

Import possibility of sources e.g. based on CSV file into objects #68

Answered by cedricbonhomme
cwm77 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

I had the same need some years ago, importing CSV data in MOSP. For this I simply used the API of MOSP with a simple script. You can see an example here:
https://github.com/NC3-LU/PyMOSP/blob/master/old/csv_to_mosp.py

As you can see the script in its current definition will imports assets from a CSV file (assets.csv).
You need to give the id of the validating schema and the if of the owning organization.

The loop "for" simply creates the JSON file, then the content of the JSON file is sent with a HTML POST request to the API of MOSP.

I hope this helps.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cedricbonhomme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants