python-aidはMisskeyのaid/aidxのPython向けの実装です。
Misskeyで利用されているID生成アルゴリズムです。
from python_aid import aid
generated = aid.genAid()
print("aid: " + generated)
print("time: " + aid.parseAid(generated).strftime('%Y-%m-%d %H:%M:%S.%f'))
from python_aid import aid
generated = aid.genAid(timestamp=1718546963) # 1718546963 = 2024/06/16 23:09:23 (JST)
print("aid: " + generated)
print("time: " + aidx.parseAid(generated).strftime('%Y-%m-%d %H:%M:%S.%f'))
from python_aid import aidx
generated = aidx.genAidx()
print("aidx: " + generated)
print("time: " + aidx.parseAidx(generated).strftime('%Y-%m-%d %H:%M:%S.%f'))
from python_aid import aidx
generated = aidx.genAidx(timestamp=1718546963) # 1718546963 = 2024/06/16 23:09:23 (JST)
print("aidx: " + generated)
print("time: " + aidx.parseAidx(generated).strftime('%Y-%m-%d %H:%M:%S.%f'))