[Python] Efficient way to set up a persistent read-only dictionary with many keys but simple...

Discussão em 'Python' iniciado por Stack, Janeiro 23, 2025.

  1. Stack

    Stack Membro Participativo

    I have roughly 100k (fairly short) unicode strings and for each of them a corresponding integer.

    I need to store them in a dicionary-like persistent object that will be then accessed only for reading.

    I'm looking for a solution that doesn't fill the ram loading the whole structure and not too much greedy of space on disk.

    I already tried dbm and shelve, but I got a resulting file of 30Mb+.

    I'm sure there are tools which fits better on this specific case, so any pointers (for both python2 or python3) are welcome.

    Continue reading...

Compartilhe esta Página