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

Make use new pyxform API #82

Open
lindsay-stevens opened this issue Aug 3, 2024 · 0 comments
Open

Make use new pyxform API #82

lindsay-stevens opened this issue Aug 3, 2024 · 0 comments

Comments

@lindsay-stevens
Copy link

Re: #81 / https://github.com/XLSForm/pyxform/pull/712/files

Maybe XLSForm-online could use the new code? E.g. in views.py

from pyxform.xls2xform import convert

converted = convert(xlsform=request.FILES["file"])
with open(xml_path, "w") as f:
    f.write(converted.xform)
if converted.itemsets is not None:
    itemsets_csv = os.path.join(temp_dir, "itemsets.csv")
    with open(itemsets_csv, "w") as f:
        f.write(converted.itemsets)

Warnings is available in converted.warnings.

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

No branches or pull requests

1 participant