cubicweb-brainomics #2925973 Localizer importer: re-encode the Subject [resolved]

The Subject identifier must be re-encoded.

I think you just need to add a global in-memory map to translate each incoming 'nip' into a random output 'nip' that will be inserted instead in the CubicWeb database.

Use something like this to generate a random 'nip':

import random
import string
c1 = random.choice(string.ascii_lowercase)
c2 = random.choice(string.ascii_lowercase)
n6 = random.randint(0, 999999)
nip = '%c%c%06d' % (c1, c2, n6)

Discard the map as soon as the script is finished, do not keep it!

priorityimportant
typebug
done in0.2.0
load1.000
load left0.000
closed by#69c1d0737721 [ccplugin] Add a CWCTL command for identifier and file path anonynimzation, with unit tests, closes #2925973
patchFix retrieval of the external UID file [applied][ccplugin] Add a CWCTL command for identifier and file path anonynimzation, with unit tests, closes #2925973 [applied]
attachment