okfn-brasil / serenata-toolbox

📦 pip module containing code shared across Serenata de Amor's projects | ** Este repositório não recebe atualizações frequentes **
MIT License
154 stars 69 forks source link

Config file for downloading datasets #205

Closed letssteal closed 5 years ago

letssteal commented 5 years ago

As @letssteal deleted the original post, I (@cudocos) am recovering it from the notification email. @letssteal please, let me know if you're OK with that.

Hello, I'm trying to download the datasets by using the code from the README.rst in python shell.

from serenata_toolbox.datasets import fetch, fetch_latest_backup
fetch('2018-01-05-reimbursements.xz', 'data/')

I get the following result :

from serenata_toolbox.datasets import fetch,fetch_latest_backup
fetch('2018-01-05-reimbersements.xz','data/')
2018-11-15 01:33:53,878 - root - INFO - Could not find config.ini file.
2018-11-15 01:33:53,878 - root - INFO - You need Amazon section in it to interact with S3
2018-11-15 01:33:53,878 - root - INFO - (Check config.ini.example if you need a reference.)
Traceback (most recent call last):
File "", line 1, in 
File "/home/jessie/.virtualenvs/venv/lib/python3.5/site-packages/serenata_toolbox/datasets/init.py", line 78, in fetch
datasets = Datasets(destination_path)
File "/home/jessie/.virtualenvs/venv/lib/python3.5/site-packages/serenata_toolbox/datasets/init.py", line 59, in init
**self.remote.credentials
TypeError: type object argument after ** must be a mapping, not NoneType
fetch('2018-01-05-reimbersements.xz','data/')
2018-11-15 01:33:56,926 - root - INFO - Could not find config.ini file.
2018-11-15 01:33:56,926 - root - INFO - You need Amazon section in it to interact with S3
2018-11-15 01:33:56,926 - root - INFO - (Check config.ini.example if you need a reference.)
Traceback (most recent call last):
File "", line 1, in 
File "/home/jessie/.virtualenvs/venv/lib/python3.5/site-packages/serenata_toolbox/datasets/init.py", line 78, in fetch
datasets = Datasets(destination_path)
File "/home/jessie/.virtualenvs/venv/lib/python3.5/site-packages/serenata_toolbox/datasets/init.py", line 59, in init
**self.remote.credentials
TypeError: type object argument after ** must be a mapping, not NoneType

Should I place config file /datasets folder ? what should be the contents of the config file ? I couldn't find config.ini.example.

cuducos commented 5 years ago

Hi @letssteal. Would you mind keeping your original post and the reason why you closed the issue? I recovered it from the email notification, is that OK? This is important since it might be helpful in case other people have the same doubt.

From the email notification I understand you're running an old version of the toolbox because you're running on Python 3.5. The current architecture of the project requires Python 3.6 and once you update your Python, pip will get you the updated version of the toolbox.