nielstron / quantulum3

Library for unit extraction - fork of quantulum for python3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

toJSON

mrahmadt opened this issue · comments

commented

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())

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