Q:

Python Object ID

I would like create a object ID in python, I explain:
I know that exist mysql, sqlite, mongoDB, etc... But I would like at least create a object ID for store data in json. 
Before I was putting the json info inside of a list and the ID was the index of this json in the list, for example:
data = [{"name": userName}]
data[0]["id"] = len(data) - 1

Then I realize that was wrong and obviously dont look like objectID, then I thought in that the ID can be the Date and Time together, but I thought was wrong too, so, I would like know the best way for make like a objectID, that represent this json inside the list.  this list will be more longer, is for users or clients (is just a personal project).  And how can be a example of a method for create the ID
Thanks so much, hope I explained good. 

A:

If you just want to create a locally unique value, you could use a really simple autoincrement approach. 
data = [
    {"name": "Bill"},
    {"name": "Javier"},
    {"name": "Jane"},
    {"name": "Xi"},
    {"name": "Nosferatu"},
]

current_id = 1

for record in data:
    record["id"] = current_id
    current_id += 1
    print(record)
# {'name': 'Bill', 'id': 1}
# {'name': 'Javier', 'id': 2}
# {'name': 'Jane', 'id': 3}
# {'name': 'Xi', 'id': 4}
# {'name': 'Nosferatu', 'id': 5}

To add a new value if you're not initializing like this, you can get the last one with max(d.get("id", 0) for d in data). 
This may cause various problems depending on your use case.  If you don't want to worry about that, you could also throw UUIDs at it; they're heavier but easy to generate with reasonable confidence of uniqueness. 
from uuid import uuid4

data = [{"name": "Conan the Librarian"}]
data[0]["id"] = str(uuid4())
print(data)
# 'id' will be different each time; example:
# [{'name': 'Conan the Librarian', 'id': '85bb4db9-c450-46e3-a027-cb573a09f3e3'}]

Without knowing your actual use case, though, it's impossible to say whether one, either, or both of these approaches would be useful or appropriate.