Unique identification for data items in Python

0 votes
I am new to software development and am using Python to retrieve a few data items from a DB using APIs. Is there a way to uniquely identify each data item retrieved, like how a relation is identified using the primary key in a relational table?
Apr 17, 2018 in Python by spiderbean
130 views

1 answer to this question.

0 votes

Try the UUID module of Python.

For example, if you wish to create a unique alphanumeric identifier at random:

uuid.uuid4()

Many other functions are available under this module, all of which are detailed here in the docs for this module:

https://docs.python.org/3.6/library/uuid.html

answered Apr 17, 2018 by Nietzsche's daemon
• 4,260 points

Related Questions In Python

0 votes
1 answer

What are the naming conventions for variables and data types in python?

There are certain rules that we have ...READ MORE

answered May 20, 2019 in Python by Mohammad
• 3,210 points
234 views
+3 votes
5 answers

How to read multiple data files in python

Firstly we will import pandas to read ...READ MORE

answered Apr 6, 2018 in Python by DeepCoder786
• 1,720 points
9,329 views
0 votes
1 answer

Replacements for switch statement in Python?

You could use a dictionary: def f(x): ...READ MORE

answered May 29, 2018 in Python by aryya
• 7,380 points
65 views
0 votes
1 answer

What is the flow control for “continue” in python?

This is the way "continue" statement works! You ...READ MORE

answered Jul 16, 2018 in Python by Priyaj
• 57,660 points
112 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,363 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,800 points
1,011 views
0 votes
2 answers

Extracting data from a JSON file in Python

Here is what i found and was ...READ MORE

answered Nov 27, 2018 in Python by Rupali
23,544 views
0 votes
1 answer

Slice notation in Python for string reversal

The slice notation is [start:end:step]. Step = ...READ MORE

answered Apr 25, 2018 in Python by Nietzsche's daemon
• 4,260 points
149 views