Move samples to readme

This commit is contained in:
Gabriel Augendre 2021-08-06 15:56:08 +02:00
parent 95198271d8
commit a84c41a572
2 changed files with 4 additions and 4 deletions

View file

@ -8,8 +8,7 @@ Extract data from INSEE number (France)
pyenv virtualenv 3.9.6 insee pyenv virtualenv 3.9.6 insee
pyenv local insee pyenv local insee
poetry install poetry install
python insee_number_translator/main.py insee 269059913116714 168127982980507
python insee_number_translator/main.py 123456789123456
``` ```
## Data sources ## Data sources

View file

@ -152,14 +152,15 @@ class InseeData:
def main(): def main():
numbers = ["269059913116714", "168127982980507"]
if len(sys.argv) > 1: if len(sys.argv) > 1:
numbers = sys.argv[1:] numbers = sys.argv[1:]
else:
print(f"Usage: {sys.argv[0]} insee_number_1 [insee_number_2 ...]")
sys.exit(1)
for number in numbers: for number in numbers:
data = InseeData(number) data = InseeData(number)
print(data) print(data)
pprint.pprint(data.to_dict()) pprint.pprint(data.to_dict())
print("\n\n")
if __name__ == "__main__": if __name__ == "__main__":