Pitão 🐍
Pitão é um pré-processador que traduz código Portuguese → Python.
⚠️ Importante: Pitão não é Python. É uma ferramenta de tradução. O código Python "real" é sempre em inglês. Nosso objetivo é ajudar falantes de português a aprender e escrever Python mais facilmente.
O que é Pitão?
Pitão permite escrever código usando palavras reservadas em português, que são automaticamente traduzidas para Python antes da execução.
Pitão é Python - apenas com palavras em português.
Por que existe?
- Aprendizagem: Reduz a barreira linguística para iniciantes
- Prototipagem: Escreva lógica rapidamente em português
- Educação: Ensine programação com material didático em português
O que NÃO é
- ❌ Uma linguagem de programação diferente
- ❌ Um substituto para Python
- ❌ Uma tentativa de "portugalizar" Python
Código Pitão é traduzido para Python real. Você pode converter qualquer arquivo .pt para .py e obter Python padrão.
Instalação
pip install pitao
Ou para instalar localmente com uv:
git clone https://github.com/ivancrneto/pitao.git
cd pitao
uv sync
Galeria
Início Rápido
Crie um arquivo ola_mundo.pt:
# ola_mundo.pt
def ola_mundo():
imprimir("Olá, Mundo!")
se __nome__ == "__principal__":
ola_mundo()
Execute com:
pitao ola_mundo.pt
# Saída: Olá, Mundo!
O código é traduzido para:
# ola_mundo.py (gerado automaticamente)
def ola_mundo():
print("Olá, Mundo!")
if __name__ == "__main__":
ola_mundo()
Características
✨ Tradução Completa
- 53+ palavras-chave traduzidas
- 70+ funções built-in
- 30+ métodos de objetos (string, list, dict)
- 15+ tipos de exceção
- 25+ funções da biblioteca padrão
- Suporte a métodos encadeados
🔄 Bidirecional
pitao→python(pitão para Python)pt2py→ Traduz .pt para .pypy2pt→ Traduz .py para .pt
🛠️ Ferramentas
- CLI completa com modo verbose
- Compilação sem execução (
-c) - Manutenção do arquivo gerado (
-k)
Perguntas Frequentes
Pitão é Python?
Tecnicamente não. É um pré-processador que traduz código português para Python. O resultado final é sempre Python real.
Posso usar bibliotecas Python?
Sim! Bibliotecas são importadas normalmente. O código Python de bibliotecas permanece em inglês.
Pitão é para iniciantes?
Principalmente. É uma ferramenta de aprendizagem. Python "real" sempre usará palavras em inglês.
Devo usar Pitão em produção?
Não recomendamos. Python padrão é a linguagem - Pitão é apenas uma ferramenta de tradução.
Documentação
- README - Visão geral
- ROADMAP.md - Plano de desenvolvimento
- GUIA-MIGRACAO.md - Guia de migração Python ↔ Pitão
- REFERENCIA-API.md - Referência completa da API
- EXEMPLOS.md - Exemplos práticos
- FAQ.md - Perguntas frequentes
Palavras Reservadas
| Português | Python |
|---|---|
Falso |
False |
Verdadeiro |
True |
Nulo |
None |
e |
and |
ou |
or |
nao |
not |
se |
if |
senaose |
elif |
senao |
else |
para |
for |
enquanto |
while |
quebre |
break |
continue |
continue |
def |
def |
classe |
class |
retorne |
return |
produza |
yield |
tente |
try |
exceto |
except |
finalmente |
finally |
levante |
raise |
assincrono |
async |
aguarde |
await |
importe |
import |
de |
from |
como |
as |
em |
in |
eh |
is |
usando |
with |
afirme |
assert |
del |
del |
global |
global |
naolocal |
nonlocal |
lambda |
lambda |
passe |
pass |
Funções Built-in
Pitão também suporta a tradução de algumas funções built-in do Python:
| Português | Python |
|---|---|
imprimir() |
print() |
entrada() |
input() |
abrir() |
open() |
inteiro() |
int() |
flutuante() |
float() |
texto() |
str() |
booleano() |
bool() |
lista() |
list() |
dicionario() |
dict() |
conjunto() |
set() |
tupla() |
tuple() |
tamanho() |
len() |
intervalo() |
range() |
enumerar() |
enumerate() |
juntar() |
zip() |
ordenar() |
sorted() |
inverter() |
reversed() |
somar() |
sum() |
maior_de() |
max() |
menor_de() |
min() |
Comandos
pitao - Executar arquivos Pitão
pitao arquivo.pt [args...] # Executa o arquivo
pitao -c arquivo.pt # Compila para .py sem executar
pitao -k arquivo.pt # Executa e mantém o .py gerado
pitao -v arquivo.pt # Modo verbose
pt2py - Traduzir Pitão para Python
pt2py arquivo.pt # Cria arquivo.py
pt2py -o saida.py arquivo.pt # Especifica nome de saída
py2pt - Traduzir Python para Pitão
py2pt arquivo.py # Cria arquivo.pt
py2pt -o saida.pt arquivo.py # Especifica nome de saída
Licença
MIT
Feito com ❤️ para a comunidade de programação brasileira
Metadata
Release files for pitao 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pitao-0.3.0.tar.gz | 783.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pitao-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 796.2 kB
Release files / pitao-0.3.0.tar.gz
| Download URL | pitao-0.3.0.tar.gz |
|---|---|
| Size | 783.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f547614f4eee23a340e8b0c92d2bb01882d087ba8d6998a6bbc2363260202af4
|
|
BLAKE2b-256 checksum How to use checksums |
e0d26451868a11017f373b0b28cfbe2ec2f553ebeec81c22468260cc555b14b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 24, 2026.
Transparency logRelease files / pitao-0.3.0-py3-none-any.whl
| Download URL | pitao-0.3.0-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
76e1a0be29ba96dde7ce46a51b5a31c9b590e20c2c79cf7c99b14e6389cce137
|
|
BLAKE2b-256 checksum How to use checksums |
23ce09271a092f9c57e9ae28703a05f6c7ae8aaa3c08698868d01ba8f0edd47c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 24, 2026.
Transparency log