Question

I am a perfectionist and need a good name for a function that parses data that has this type of format:

userID:12,year:2010,active:1

Maybe perhaps

parse_meta_data()

I'm not sure what the correct name for this type of data format is. Please advise! Thanks for your time.

Was it helpful?

Solution

parse_dict or parse_map

OTHER TIPS

Except for the lack of braces and the quotes around the keys, it looks like either JSON or a Python dict.

parse_tagged_csv()

parse_csv()

parse_structured_csv()

parse_csv_with_attributes()

parse csvattr()

If it’s a proprietary data format, you can name it whatever you want. But it would be good to use a common term like serialized data or mapping list.

If it's just a list of simple items, each of which has a name and a value, then "key-value pairs" is probably the right term.

I would go with:

parse_named_records()

ParseCommaSeparatedNameValuePairs()

ParseDelimitedNameValuePairs()

ParseCommaSeparatedKeyValuePairs()

ParseDelimitedKeyValuePairs()

From the one line you gave, ParseJson() seems appropriate

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top