This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unicodedata | |
import pandas as pd | |
import grequests | |
from serenata_toolbox.datasets import fetch | |
fetch('2017-05-22-brazilian-cities.csv', 'data/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2016-07-26-AnoAnterior.zip | |
2016-07-26-AnoAtual.zip | |
2016-07-26-AnosAnteriores.zip | |
2016-08-08-AnoAnterior.csv | |
2016-08-08-AnoAnterior.zip | |
2016-08-08-AnoAtual.csv | |
2016-08-08-AnoAtual.zip | |
2016-08-08-AnosAnteriores.csv | |
2016-08-08-AnosAnteriores.zip | |
2016-08-08-ceap-datasets.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
data = pd.read_csv('../serenata-data/2017-05-25-reimbursements.xz', dtype={'applicant_id': np.str, | |
'cnpj_cpf': np.str, | |
'congressperson_id': np.str, | |
'subquota_number': np.str}, | |
low_memory=False) | |
data = data[data['subquota_description'] == 'Taxi, toll and parking'] | |
data2014 = data[data['year'] == 2014] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python -m unittest discover tests | |
.................F................Could not find config.ini file. | |
You need Amazon section in it to interact with S3 | |
(Check config.ini.example if you need a reference.) | |
.You need an Amazon section in config.ini to interact with S3 (Check config.ini.example if you need a reference.) | |
.Could not find config.ini file. | |
You need Amazon section in it to interact with S3 | |
(Check config.ini.example if you need a reference.) | |
.Could not find config.ini file. | |
You need Amazon section in it to interact with S3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python setup.py sdist | |
running sdist | |
running egg_info | |
writing serenata_toolbox.egg-info/PKG-INFO | |
writing dependency_links to serenata_toolbox.egg-info/dependency_links.txt | |
writing requirements to serenata_toolbox.egg-info/requires.txt | |
writing top-level names to serenata_toolbox.egg-info/top_level.txt | |
reading manifest file 'serenata_toolbox.egg-info/SOURCES.txt' | |
writing manifest file 'serenata_toolbox.egg-info/SOURCES.txt' | |
running check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python setup.py bdist_wheel --plat-name='any' | |
running bdist_wheel | |
running build | |
running build_py | |
creating build | |
creating build/lib | |
creating build/lib/serenata_toolbox | |
creating build/lib/serenata_toolbox/federal_senate | |
copying serenata_toolbox/federal_senate/__init__.py -> build/lib/serenata_toolbox/federal_senate | |
copying serenata_toolbox/federal_senate/dataset.py -> build/lib/serenata_toolbox/federal_senate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ twine upload dist/* | |
Uploading distributions to https://upload.pypi.org/legacy/ | |
Uploading serenata_toolbox-12.0.4-py3-none-any.whl | |
Uploading serenata-toolbox-12.0.4.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python manage.py test | |
Creating test database for alias 'default'... | |
System check identified no issues (0 silenced). | |
.................FF.................................................................................................................................... | |
====================================================================== | |
FAIL: test_contents (jarbas.api.tests.test_reimbursement_view.TestRetrieveApi) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/Users/temporal/src/dsbr/serenata/jarbas/jarbas/api/tests/test_reimbursement_view.py", line 119, in test_contents | |
self.assertEqual(self.sample_response, contents) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python rosie.py run chamber_of_deputies | |
/Users/temporal/src/dsbr/serenata/rosie/rosie/chamber_of_deputies/adapter.py:25: DtypeWarning: Columns (10) have mixed types. Specify dtype option on import or set low_memory=False. | |
self.update_datasets() | |
Merging all datasets… | |
Loading reimbursements-2009.xz… | |
Loading reimbursements-2010.xz… | |
Loading reimbursements-2011.xz… | |
Loading reimbursements-2012.xz… | |
Loading reimbursements-2013.xz… | |
Loading reimbursements-2014.xz… |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: python | |
cache: | |
directories: | |
- $HOME/virtualenv/python3.5.3/ | |
env: | |
- TEST_SUITE=unit | |
- TEST_SUITE=journey | |
python: 3.5 | |
install: | |
- python setup.py develop |