Giter VIP home page Giter VIP logo

politicos-go's Introduction

Politicos API

Aqui você vai encontrar os dados, ferramentas e recursos para realizar pesquisas, desenvolver aplicativos, visualizações de dados e muito mais.

Instalação

Instalando as dependências

make setup

Rodando a API

make run

Pegando os CSV dos candidatos

make build-collector
./collector fetch-all-csv

Rodando o coletor

make build-collector
./collector process-all

Rotas da API (local)

http://localhost:8888/swagger/index.html

Como Contribuir

Participe da lista de email e também via IRC no canal #olhoneles na Freenode.

Faça uma cópia do repositório e envie seus pull-requests.

Licença

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

politicos-go's People

Contributors

cristiandean avatar luccamendonca avatar marcelometal avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

cristiandean

politicos-go's Issues

Create API response

The Politicos API v0 has the following response data:

{
    "meta":{
        "limit":20,
        "next":"/api/v0/political-parties/?limit=20&offset=20",
        "offset":0,
        "previous":null,
        "total_count":1
    },
    "objects":[
        {
            "founded_date":null,
            "id":1,
            "logo":null,
            "name":"Heavy Metal",
            "resource_uri":"/api/v0/political-parties/1/",
            "siglum":"HV",
            "tse_number":666,
            "website":null,
            "wikipedia":null
        }
    ]
}

Now we can think about the new response data or keep the current response.

Merge all cand20xx.go files

From what I realized, the Cand20XX structs are almost the same, with only a few increments each year.

We could see if we can merge them into a single generic structure, and the missing fields could be filled in as empty. What do you think?

CLI: Create post-process command

Please, don't repeat yourself!

Today there are these CLI commands:

  • post-process-candidacies-status
  • post-process-education
  • post-process-political-office
  • post-process-political-party

But we could create post-process command and using candidacies-status, education, political-office and political-party as arg value

Only download the zip files if necessary

Using HTTP headers we can avoid to download the same file.

Headers: Last-Modified and Content-Length

$ curl -I http://agencia.tse.jus.br/estatistica/sead/odsele/consulta_cand/consulta_cand_2018.zip

HTTP/1.1 200 OK
Server: Apache/2.2.15 (Red Hat)
Last-Modified: Mon, 16 Nov 2020 01:00:05 GMT
ETag: "10118c-641f67-5b42ee6194614"
Accept-Ranges: bytes
Content-Length: 6561639
Content-Type: application/zip
F5-IpCliente: 189.36.X.X
ClientIP: 189.36.X.X
Server: thttpd/2.26 ??apr2004
Date: Mon, 16 Nov 2020 03:05:31 GMT
Connection: keep-alive
Set-Cookie: BIGipServerPool_Apache=197961920.20480.0000; path=/; Httponly

WIP: API routes

Candidacies

  • GET /api/v0/candidacies/
  • GET /api/v0/candidacies/{id}

Candidacies Status

  • GET /api/v0/candidacies-status/
  • GET /api/v0/candidacies-status/{id}

Cities

  • GET /api/v0/cities/
  • GET /api/v0/cities/{id}
  • GET /api/v0/cities/search

Countries

  • GET /api/v0/countries/
  • GET /api/v0/countries/{id}

Educations

  • GET /api/v0/educations/
  • GET /api/v0/educations/{id}

Election Rounds

  • GET /api/v0/election-rounds/
  • GET /api/v0/election-rounds/{id}

Elections

  • GET /api/v0/elections/
  • GET /api/v0/elections/{id}

Ethnicities

  • GET /api/v0/ethnicities/
  • GET /api/v0/ethnicities/{id}

Institutions

  • GET /api/v0/institutions/
  • GET /api/v0/institutions/{id}

Mandate Event Types

  • GET /api/v0/mandate-event-types/
  • GET /api/v0/mandate-event-types/{id}

Mandate Events

  • GET /api/v0/mandate-events/
  • GET /api/v0/mandate-events/{id}

Mandates

  • GET /api/v0/mandates/
  • GET /api/v0/mandates/{id}

Marital Status

  • GET /api/v0/marital-status/
  • GET /api/v0/marital-status/{id}

Nationalities

  • GET /api/v0/nationalities/
  • GET /api/v0/nationalities/{id}

Occupations

  • GET /api/v0/occupations/
  • GET /api/v0/occupations/{id}
  • GET /api/v0/occupations/search/

Political Offices

  • GET /api/v0/political-offices/
  • GET /api/v0/political-offices/{id}

Political Parties

  • GET /api/v0/political-parties/
  • GET /api/v0/political-parties/{id}

Politician Event Types

  • GET /api/v0/politician-event-types/
  • GET /api/v0/politician-event-types/{id}

Politician Events

  • GET /api/v0/politician-events/
  • GET /api/v0/politician-events/{id}

Politicians

  • GET /api/v0/politicians/
  • GET /api/v0/politicians/{id}
  • GET /api/v0/politicians/search

States

  • GET /api/v0/states/
  • GET /api/v0/states/{id}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.