Coder Social home page Coder Social logo

cpc-api's Introduction

Build Status

CPC-API

A python api for http://nosdeputes.fr and http://nossenateurs.fr

CPC is for Controle Parlementaire Citoyens.

See full API documentation here: https://github.com/regardscitoyens/nosdeputes.fr/blob/master/doc/api.md

Examples

  • Députes
from cpc_api import CPCApi
api = CPCApi(legislature='2012-2017')
# synthese of legislature
synthese = api.synthese()
# search for a depute
cope = api.search_parlementaires('Cope')[0][0]
# get all info of cope
all_info = api.parlementaire(cope['slug'])
  • Sénateurs & députés legislature 2007-2012...
from cpc_api import CPCApi
# do the same with senateurs
api = CPCApi(ptype='senateur')
larcher = api.search_parlementaires('larcher')[0][0]
# 'or with legislature 2007-2012'
api = CPCApi(ptype='depute', legislature='2007-2012')
morano = api.search_parlementaires('morano')[0][0]
# ...

cpc-api's People

Contributors

fmassot avatar ribodou avatar rouxrc avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

lucgiffon

cpc-api's Issues

pip installation fails ('str' object has no attribute 'decode' in setup.py)

$ python3 --version
Python 3.5.2
$ pip3 --version
pip 10.0.1 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)
$ sudo pip3 install cpc-api
Collecting cpc-api
  Downloading https://files.pythonhosted.org/packages/ef/39/9e9ef9ef3381a95cc00ee7de97f092b7d49c6ce5ec4d991c2e58f7db8ac6/cpc_api-0.1.6.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-fgd9dzbw/cpc-api/setup.py", line 15, in <module>
        LONG_DESC = readme.read().decode('utf-8')
    AttributeError: 'str' object has no attribute 'decode'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-fgd9dzbw/cpc-api/

python setup.py egg_info did not run successfully - AttributeError: 'str' object has no attribute 'decode'

Hello,

On me demande d'utiliser CPC-api dans le cadre de ma formation.
Je n'arrive pas à l'installer ?
Pouvez-vous m'aider svp ?

Merci!

~/Gouv$ pip install cpc-api
Collecting cpc-api
  Using cached cpc_api-0.1.6.tar.gz (2.8 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-6sq2ofzo/cpc-api_b782c2a51c014ff09113e6d99908b565/setup.py", line 15, in <module>
          LONG_DESC = readme.read().decode('utf-8')
      AttributeError: 'str' object has no attribute 'decode'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

https://replit.com/join/rcgtlyphqk-acherrered

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.