Skip to main content

python-pt-br

PyPI version Python 3.8+ License: MIT Code Coverage

Write Python code in Brazilian Portuguese (pt-BR)!

A Python package that enables developers to write Python code using pt-BR keywords and built-in function names, making Python more accessible for Portuguese-speaking learners.

Quick Start

Create a file hello.py:

import pt_br

imprimir("Olá, Mundo!")

para i em intervalo(5):
    imprimir(i)

Run it:

python -m pt_br hello.py

Or with a specific Python version:

python3.13 -m pt_br hello.py

Installation

pip install python-pt-br

Features

  • ✅ Write .py files in Portuguese Brazilian—execute them normally
  • ✅ Translate pt-BR keywords: para → for, se → if, enquanto → while
  • ✅ Translate pt-BR built-in functions: imprimir() → print(), intervalo() → range()
  • ✅ Zero friction: just add import pt_br at the top of your script
  • ✅ Near-native performance (translates to Python, then executes)
  • ✅ Educational focus—designed for learners

Example

Write in Portuguese Brazilian:

import pt_br

para i em intervalo(5):
    se i % 2 == 0:
        imprimir(f"Número par: {i}")
    senao:
        imprimir(f"Número ímpar: {i}")

Runs as Standard Python:

$ python -m pt_br seu_script.py
Número par: 0
Número ímpar: 1
Número par: 2
Número ímpar: 3
Número par: 4

Supported Keywords & Functions

See documentation for full list of supported keywords and functions.

Keywords (16)

para, em, se, senao, enquanto, e, ou, nao, verdadeiro, falso, nulo, quebra, continua, retorna, funcao, classe

Functions (20+)

imprimir(), entrada(), intervalo(), comprimento(), lista(), tupla(), conjunto(), dicionario(), inteiro(), flutuante(), texto(), soma(), minimo(), maximo(), classifica(), and more

How It Works

  1. You write Python code using pt-BR keywords
  2. You add import pt_br at the top
  3. Import hook intercepts your module
  4. Translator converts pt-BR → Python
  5. Python executes normally

No build steps, no CLI tools—just pure Python!

Documentation

Examples

Check the examples/ directory for working example scripts:

  • hello_world.py — Basic output
  • loops.py — For and while loops
  • conditionals.py — If/else statements
  • functions.py — Function definitions
  • data_structures.py — Lists, dicts, tuples

Project Status

  • ✅ Planning phase complete
  • 🚀 MVP development in progress
  • 📦 Initial release: v0.1.0

Contributing

We welcome contributions! Please see CONTRIBUTING.md (coming soon).

License

MIT License - See LICENSE file for details.

Changelog

v0.1.0 (In Development)

  • Initial MVP release
  • 16 keywords support
  • 10 core built-in functions
  • Comprehensive test suite

FAQ

Q: Will my code run on other people's machines?
A: Yes! Once they install python-pt-br, they can run your code normally.

Q: Does this work with IDEs?
A: Yes, but IDEs won't recognize pt-BR keywords (limitation of current approach). This is acceptable for educational use.

Q: Can I use other Python libraries?
A: Yes! You can import and use any Python library normally.

Q: Will this support other languages?
A: Yes! After the MVP, we plan to add support for other languages.

Support

  • 📖 Read the documentation
  • 🐛 Report issues on GitHub
  • 💬 Ask questions in discussions

Made with ❤️ for Portuguese-speaking Python learners

Metadata

Release files for python-pt-br 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-pt-br 0.1.0
File Size Uploaded Provenance Actions
python_pt_br-0.1.0.tar.gz 23.6 kB Without provenance Details for python_pt_br-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-pt-br 0.1.0
File Interpreter ABI Platform Actions
python_pt_br-0.1.0-py3-none-any.whl Python 3 none any Details for python_pt_br-0.1.0-py3-none-any.whl

Total release size: 36.5 kB

Release files / python_pt_br-0.1.0.tar.gz

Download URL python_pt_br-0.1.0.tar.gz
Size 23.6 kB
Tags Source
SHA-256 checksum
How to use checksums
20b8ac144bf191aa727c1c17689085c516078d6637b50f60884e0e3456862ac0
BLAKE2b-256 checksum
How to use checksums
028c684bcd451860ebdf9fad595d93d27b31e6438560531346f6de15231c5d8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / python_pt_br-0.1.0-py3-none-any.whl

Download URL python_pt_br-0.1.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40c9049f1fe3a21ce8372c7e6824cff852d727e64a1bc7285b7ff7ea8fd148cb
BLAKE2b-256 checksum
How to use checksums
628df0699f537a6cada347d69fe68fabbe972931cbf6384ce2299acf348bcce0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for python-pt-br 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page