Python com palavras reservadas em Português
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pitao-0.3.0.tar.gz.
File metadata
- Download URL: pitao-0.3.0.tar.gz
- Upload date:
- Size: 783.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f547614f4eee23a340e8b0c92d2bb01882d087ba8d6998a6bbc2363260202af4
|
|
| MD5 |
1080713c7bb533f7567ec660b173585d
|
|
| BLAKE2b-256 |
e0d26451868a11017f373b0b28cfbe2ec2f553ebeec81c22468260cc555b14b6
|
Provenance
The following attestation bundles were made for pitao-0.3.0.tar.gz:
Publisher:
publish.yml on ivancrneto/pitao
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pitao-0.3.0.tar.gz -
Subject digest:
f547614f4eee23a340e8b0c92d2bb01882d087ba8d6998a6bbc2363260202af4 - Sigstore transparency entry: 1940322698
- Sigstore integration time:
-
Permalink:
ivancrneto/pitao@b47d5b2437fa44813235d787cfd5c4947b1df5fd -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/ivancrneto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b47d5b2437fa44813235d787cfd5c4947b1df5fd -
Trigger Event:
release
-
Statement type:
File details
Details for the file pitao-0.3.0-py3-none-any.whl.
File metadata
- Download URL: pitao-0.3.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76e1a0be29ba96dde7ce46a51b5a31c9b590e20c2c79cf7c99b14e6389cce137
|
|
| MD5 |
8747c66b9828d35f21e88668bdfce643
|
|
| BLAKE2b-256 |
23ce09271a092f9c57e9ae28703a05f6c7ae8aaa3c08698868d01ba8f0edd47c
|
Provenance
The following attestation bundles were made for pitao-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on ivancrneto/pitao
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pitao-0.3.0-py3-none-any.whl -
Subject digest:
76e1a0be29ba96dde7ce46a51b5a31c9b590e20c2c79cf7c99b14e6389cce137 - Sigstore transparency entry: 1940322850
- Sigstore integration time:
-
Permalink:
ivancrneto/pitao@b47d5b2437fa44813235d787cfd5c4947b1df5fd -
Branch / Tag:
refs/tags/0.3.0 - Owner: https://github.com/ivancrneto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b47d5b2437fa44813235d787cfd5c4947b1df5fd -
Trigger Event:
release
-
Statement type: