Re: Need help in converting the key value pairs of JSON data into data types.

2021-08-11 Thread Kasper Laudrup
On 11/08/2021 21.20, Franck Tchouanga wrote:
> I can help you.
>

Help me with what?

Kind regards,

Kasper Laudrup

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/90dcdc26-d694-e3e0-1a1e-76178f953c40%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature


Re: Need help in converting the key value pairs of JSON data into data types.

2021-08-11 Thread Franck Tchouanga
I can help you.

On Wed, Aug 11, 2021, 6:00 PM Kasper Laudrup  wrote:

> On 11/08/2021 15.54, chinna wrote:
> > Hi All,
> >
> > I am actually working on a use case where I have to convert the JSON
> > data into a dictionary and from that  I will have to replace all the
> > keys and values to the data types.
>
> The data type is returned as a string with the builtin type() function.
>
> > For example:
> >
> > input_dict  = {'segment_idenifier': 'Segment 2',
> > 'exposed_pipe_outside_diam': 4, 'exposed_pipe_length': 2}
> >
> > output_dict = {string : string, string : integer, string : integer }
> >
> > in some cases the dictionary will have nested dictionaries or lists as
> > well. If it has, we will have to replace the key-values inside those
> > nested objects.
> >
>
> The JSON library included with the Python standard supports nested
> objects (converting them into Python dictionaries) just fine, so that
> shouldn't be an issue:
>
> https://docs.python.org/3/library/json.html
>
> > I am including the json file here.
> >
> > I was struck by this a while ago. Please help me to resolve this.
> >
>
> What have you done so far and where exactly are you facing issues?
>
> Also, how is this related to Django?
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a473aa95-8366-0834-1900-03946506b9bb%40stacktrace.dk
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANRJ%3D3kqR8DdkBANwNuRCCeT6j8jubsia-N-WjXHdbSj_-dSBA%40mail.gmail.com.


Re: Need help in converting the key value pairs of JSON data into data types.

2021-08-11 Thread Kasper Laudrup
On 11/08/2021 15.54, chinna wrote:
> Hi All,
> 
> I am actually working on a use case where I have to convert the JSON
> data into a dictionary and from that  I will have to replace all the
> keys and values to the data types. 

The data type is returned as a string with the builtin type() function.

> For example:
> 
> input_dict  = {'segment_idenifier': 'Segment 2',
> 'exposed_pipe_outside_diam': 4, 'exposed_pipe_length': 2}
> 
> output_dict = {string : string, string : integer, string : integer } 
> 
> in some cases the dictionary will have nested dictionaries or lists as
> well. If it has, we will have to replace the key-values inside those
> nested objects.
> 

The JSON library included with the Python standard supports nested
objects (converting them into Python dictionaries) just fine, so that
shouldn't be an issue:

https://docs.python.org/3/library/json.html

> I am including the json file here.
> 
> I was struck by this a while ago. Please help me to resolve this.
> 

What have you done so far and where exactly are you facing issues?

Also, how is this related to Django?

Kind regards,

Kasper Laudrup

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a473aa95-8366-0834-1900-03946506b9bb%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature