okfn-brasil / perfil-politico Goto Github PK
View Code? Open in Web Editor NEWA platform for profiling public figures in Brazilian politics
Home Page: https://perfilpolitico.serenata.ai/
License: GNU General Public License v3.0
A platform for profiling public figures in Brazilian politics
Home Page: https://perfilpolitico.serenata.ai/
License: GNU General Public License v3.0
I think in README.md
the order of running and initial setup should be swapped.
When $ docker-compose up
is runned first the API is not made available at localhost:8000
, so I had to run $ docker-compose run django ./manage.py migrate
and after that run $ docker-compose up
.
Talking with other people in the chat during the sprint, they had a similar issue.
A possible tool to generate the CSV to be imported here is the Raspador Legislativo.
A documentação do argumento clean-previous-data
do comando base atualmente não corresponde ao funcionamento do argumento (remover todos os objetos existentes).
perfil-politico/perfil/core/management/commands/__init__.py
Lines 196 to 204 in f59132f
The documentation of the base command's clean-previous-data
argument currently isn't related to the argument's actual function (delete all existing objects).
perfil-politico/perfil/core/management/commands/__init__.py
Lines 196 to 204 in f59132f
Problema
O comando load_afilliations
leva muito tempo para completar.
Descrição da tarefa
Explorar formas de otimização do comando e propor uma estratégia para implementar a otimização do comando
Critérios de aceite
load_affiliations
Since 'unique' fields are complicated to gather. A combination of name-birthday
could be considered a "good enough" unique field for our dataset. since this could be a sensitive information, we can transform this slug into a hash.
This would facilitate working with difficult databases and use a lot of information that are not
rightly gathered by some sources.
Endpoint to list candidates that have not run for any previous election
Endpoint to list candidates that have run for any previous election
A spider dos dados do senado no projeto do Raspador Legislativo não está funcionando.
O objetivo dessa task é conversar com @cuducos para aprender sobre o projeto do Raspador Legislativo e a partir daí criar as tasks para corrigir a spider do senado.
Solve these TODO#load_affiliations and TODO#load_assets
perfil-politico/perfil/core/management/commands/load_affiliations.py
Lines 43 to 59 in 2d18841
perfil-politico/perfil/core/management/commands/load_assets.py
Lines 50 to 65 in 88ad9b7
Is it possible to use the ORM in these cases? Will the change turn it more readable?
Foi verificado na issue #185 que o comando load_affiliations
pode ser otimizado usando Subqueries na criação dos políticos
@cuducos for adding codeclimate you just have to add the github app.
like:
O README cita as fontes de dados, porém não está explícito (ou poderia ficar mais claro), onde encontrá-las.
Aqui está a linha que explica como conseguir os .csvs
https://github.com/okfn-brasil/perfil-politico/blame/main/README.md#L52
I think would be nice to add an ERD in the readme.md. This will make easier to see how the data are relationed in the database, also it makes easier to know what data is available in the API.
A spider do senado do Raspador Legislativo não está funciondo. Ela deve ser corrigida para podermos atualizar os dados de bills do Perfil Político.
Critério de aceite
Para atualizar o banco de dados de produção sem perder as referências ao IDs existentes, é necessário implementar e documentar como é feita essa rotina de live-update dos projetos de lei.
Get people that are relatives, to find third-party relationships
This describes the importation of data. Where do the data come from?
When try load new data from affiliation from Brasil.io using docker-compose run django python manage.py load_affiliations /mnt/data/filiacao.csv
get somes errors:
ValueError: invalid literal for int() with base 10: ''
After remove some rows with nulls values on electoral_section
filed , got a second error:
ValueError: invalid literal for int() with base 10: '83.0'
Model from Affiliation expect a Integer Field not null
perfil-politico/perfil/core/models.py
Line 96 in 88ad9b7
As mentioned in #42:
Election
model has ~3 million recordsSo I think this smells like a bug to be investigated when #42 is merged.
When reading a large dataset (>500mb), the kernel of the notebook running on our docker-compose keeps failing. Running the same notebook locally raises no errors.
Update from PR #129
I think a valid discussion we could have is where the data should come from.
Currently some data comes from brasil.io website and they are not updated frequently. So if the idea behind this project is to have something that is updated with certain frequency maybe would be interesting to have a scrip to get the data from TSE website and make it available in the cloud.
PR #142 is a bit awkward to me. The description has no context or purpose for the changes, which break the tests:
Surely I can fix that, but before I would like to know more about the context of these changes.
My point is: as tests weren't updated, code edits were not mentioned or justified, and no one in the PR discussion seemed to worry about the CI being red I am not sure if this new state is intentional. Therefore I don't know the direction the fix should go:
cc people involved in that PR @adorilson @dehatanes @BrunaNayara @julianyraiol @sergiomario
also cc @giuliocc
Requires a qualitative selection of relevant topics they could have voted in (cc @ncortezrj)
It's been two years since the last update on the assets declared by politicians to the TSE in 2018.
Many candidates visible on the platform have their party bonds out of date.
A atualização dos projetos de lei precisa dos dados do Raspador Legislativo. É necessário verificar se ainda está funcionando a integração dos dados do projeto com o Perfil.
A possible roadmap:
Traceback (most recent call last):
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/bin/pytest", line 11, in <module>
sys.exit(main())
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/_pytest/config/__init__.py", line 55, in main
config = _prepareconfig(args, plugins)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/_pytest/config/__init__.py", line 180, in _prepareconfig
pluginmanager=pluginmanager, args=args
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pluggy/__init__.py", line 617, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pluggy/__init__.py", line 222, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pluggy/__init__.py", line 216, in <lambda>
firstresult=hook.spec_opts.get('firstresult'),
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pluggy/callers.py", line 196, in _multicall
gen.send(outcome)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/_pytest/helpconfig.py", line 89, in pytest_cmdline_parse
config = outcome.get_result()
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pluggy/callers.py", line 76, in get_result
raise ex[1].with_traceback(ex[2])
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pluggy/callers.py", line 180, in _multicall
res = hook_impl.function(*args)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/_pytest/config/__init__.py", line 612, in pytest_cmdline_parse
self.parse(args)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/_pytest/config/__init__.py", line 777, in parse
self._preparse(args, addopts=addopts)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/_pytest/config/__init__.py", line 739, in _preparse
early_config=self, args=args, parser=self._parser
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pluggy/__init__.py", line 617, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pluggy/__init__.py", line 222, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pluggy/__init__.py", line 216, in <lambda>
firstresult=hook.spec_opts.get('firstresult'),
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pluggy/callers.py", line 201, in _multicall
return outcome.get_result()
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pluggy/callers.py", line 76, in get_result
raise ex[1].with_traceback(ex[2])
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pluggy/callers.py", line 180, in _multicall
res = hook_impl.function(*args)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/pytest_django/plugin.py", line 246, in pytest_load_initial_conftests
dj_settings.DATABASES
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/django/conf/__init__.py", line 56, in __getattr__
self._setup(name)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/django/conf/__init__.py", line 43, in _setup
self._wrapped = Settings(settings_module)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/django/conf/__init__.py", line 106, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/amadeucavalcantefilho/Developer/perfil/api/api/settings.py", line 20, in <module>
MONGO_URL = config('MONGO_URL')
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/decouple.py", line 197, in __call__
return self.config(*args, **kwargs)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/decouple.py", line 85, in __call__
return self.get(*args, **kwargs)
File "/Users/amadeucavalcantefilho/.local/share/virtualenvs/perfil-hF4nD9Ih/lib/python3.7/site-packages/decouple.py", line 70, in get
raise UndefinedValueError('{} not found. Declare it as envvar or define a default value.'.format(option))
decouple.UndefinedValueError: MONGO_URL not found. Declare it as envvar or define a default value.
I don't know whether I have be running mongo while runing test.
When a new CSV is imported using load_people
the scripts fails because there are duplicated person to be added.
Add a sample data set to be used in dev env and avoid the need to download a big amount of data.
We need too a documentation about CVS format used in load_candidates and other commands.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.