Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 120
exclude=.venv
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: python
python:
- 3.6
install:
- pip install -q -r requirements-dev.txt
script:
- flake8
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ Nesse curso é ensinado como contribuir com projetos de código aberto

Link para o curso [Python Pro](https://www.python.pro.br/)

[![Build Status](https://travis-ci.org/pythonprobr/libpythonpro.svg?branch=master)](https://travis-ci.org/pythonprobr/libpythonpro)

Suportada versão 3 de Python

Para instalar:

```console
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
```

Para conferir qualidade de código:

```console
flake8

```

Tópicos a serem abordados:
1. Git
2. Virtualenv
Expand Down
Empty file added libpythonpro/__init__.py
Empty file.
17 changes: 17 additions & 0 deletions libpythonpro/github_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import requests


def buscar_avatar(usuario):
"""
Busca o avatar de um usuário no Github

:param usuario: str com o nome de usuário no github
:return: str com o link do avatar
"""
url = f'https://api.github.com/users/{usuario}'
resp = requests.get(url)
return resp.json()['avatar_url']


if __name__ == '__main__':
print(buscar_avatar('renzon'))
5 changes: 5 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
flake8==3.5.0
mccabe==0.6.1
pycodestyle==2.3.1
pyflakes==1.6.0
-r requirements.txt
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
certifi==2018.4.16
chardet==3.0.4
idna==2.6
requests==2.18.3
urllib3==1.22