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

toJSON #227

Closed
mrahmadt opened this issue May 3, 2023 · 1 comment · Fixed by #228
Closed

toJSON #227

mrahmadt opened this issue May 3, 2023 · 1 comment · Fixed by #228
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mrahmadt
Copy link

mrahmadt commented May 3, 2023

Hello Everyone,

Is it possible to be able to return a json result.

I'm not an expert in Python, so not sure if it's even possible

from quantulum3 import parser
quants = parser.parse('I want 2 liters of wine')
print(quants.toJSON())
@nielstron
Copy link
Owner

You get a Quantity object. If you want to transform it to json you can write a simple wrapper for it :)

@nielstron nielstron added enhancement New feature or request good first issue Good for newcomers labels May 9, 2023
@adhardy adhardy self-assigned this May 9, 2023
@adhardy adhardy linked a pull request May 9, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants