polm / posuto

🏣📮〠 Japanese postal code data.
MIT License
204 stars 11 forks source link

How to get Postal code from Preture, City and Town ? #16

Closed 284nnuS closed 2 years ago

284nnuS commented 2 years ago

I have Precture, City and Town, so i want to find this postal code.

polm commented 2 years ago

That is called "reverse lookup" and it's not a feature of posuto. I guess you could iterate over the postal data to create a dictionary that goes the other way.

Bob-Jia-catalina commented 2 years ago

if you are willing to bet that the author Mr. Paul will not make drastic change on the implementation, you could always read the embedded sqlite3

` import posuto

from posuto import DBPATH as POSUTO_DBPATH

import sqlite3

posuto_df = pd.read_sql_query('SELECT * FROM postal_data', sqlite3.connect( POSUTO_DBPATH ))

`

polm commented 2 years ago

To be clear, no, I am not going to add this as a feature.