Skip to main content

🐓 Python en français, sacré bleu !

Project description

  ______          _   _                 
 |  ____|        | | | |                
 | |__ _ __ _   _| |_| |__   ___  _ __  
 |  __| '__| | | | __| '_ \ / _ \| '_ \ 
 | |  | |  | |_| | |_| | | | (_) | | | |
 |_|  |_|   \__, |\__|_| |_|\___/|_| |_|
             __/ |                      
            |___/                       

🐓 Frython

Python en français, sacré bleu !

Python Licence MIT Version Tests PyPI

Fait avec amour Niveau de sérieux Compatible


🌍 Languages / Langues

🇫🇷 Français🇪🇸 Español🇨🇳 中文🇮🇳 हिन्दी🇸🇦 العربية🇧🇷 Português🇷🇺 Русский🇯🇵 日本語🇩🇪 Deutsch🇰🇷 한국어


🥐 What is it?

Frython is a programming language that transpiles Python code written entirely in French into standard Python. It's a humorous project, but fully functional — you can really program in French!

Frython translates Python keywords (if, while, for, print, etc.) into their French equivalents (si, tantque, pour, afficher, etc.).

"Why program in English when you can do it in French with 3 times more words?" — Victor Hugo, probably


⚡ Installation

pip install frython

From source

git clone https://github.com/Artleboss2/frython.git
cd frython
pip install .

Verify installation

python -m frython --version
# Frython 1.0.2 — Python en français 🐓

Windows (multiple Python versions)

C:\Python314\python.exe -m frython mon_fichier.fy

Or create a permanent PowerShell alias:

function frython { C:\Python314\python.exe -m frython $args }

🚀 Quick Start

Create a file bonjour.fy:

afficher("Bonjour le monde! 🐓")

prenom = "Marie"
age = 25

si age >= 18:
    afficher(f"Bienvenue, {prenom}! Vous êtes majeur(e).")
sinon:
    afficher(f"Bonjour, {prenom}! Vous êtes mineur(e).")

Run it:

python -m frython bonjour.fy
Bonjour le monde! 🐓
Bienvenue, Marie! Vous êtes majeur(e).

Interactive REPL

python -m frython
🐓 Frython v1.0.2 — Python en français, sacré bleu !

🐓 >>> afficher("Ça marche!")
Ça marche!
🐓 >>> quitter()
Au revoir! 👋

📖 Language Reference

Control Flow

Frython Python Description
si if Condition
sinon else Else
sinonsi elif Else if
tantque while While loop
pour for For loop
dans in In operator
casser break Break
continuer continue Continue
passer pass Pass

Definitions

Frython Python Description
déf def Define function
retourner return Return value
classe class Define class
soi self Current instance
lambda lambda Anonymous function

Special Values

Frython Python
Vrai True
Faux False
Rien None

Built-in Functions

Frython Python
afficher() print()
saisir() input()
longueur() len()
intervalle() range()
trier() sorted()
somme() sum()
maximum() max()
minimum() min()

🛠️ CLI Usage

python -m frython fichier.fy          # Run a file
python -m frython                      # Interactive REPL
python -m frython -t fichier.fy        # Show transpiled Python
python -m frython -v fichier.fy        # Verbose mode
python -m frython -c "afficher('Hi')"  # Run direct code
python -m frython --mots-cles          # List all keywords
python -m frython --version            # Show version

💡 Examples

Fibonacci

déf fibonacci(n):
    si n <= 1:
        retourner n
    retourner fibonacci(n-1) + fibonacci(n-2)

pour i dans intervalle(10):
    afficher(f"F({i}) = {fibonacci(i)}")

Classes

classe Animal:
    def __init__(soi, nom):
        soi.nom = nom

    déf parler(soi):
        retourner "..."

classe Chien(Animal):
    déf parler(soi):
        retourner "Ouaf! 🐕"

rex = Chien("Rex")
afficher(rex.parler())

List Comprehensions

carres = [x**2 pour x dans intervalle(1, 11)]
pairs = [x pour x dans intervalle(20) si x % 2 == 0]
afficher(carres)
afficher(pairs)

🗂️ Project Structure

frython/
├── frython/
│   ├── __init__.py
│   ├── lexeur.py
│   ├── transpileur.py
│   └── interpreteur.py
├── examples/
├── tests/
├── assets/
│   ├── readme_fr.md
│   ├── readme_es.md
│   ├── readme_zh.md
│   ├── readme_hi.md
│   ├── readme_ar.md
│   ├── readme_pt.md
│   ├── readme_ru.md
│   ├── readme_ja.md
│   ├── readme_de.md
│   └── readme_ko.md
├── README.md
├── DOCUMENTATION.md
├── UPDATE.md
└── LICENSE

❓ FAQ

Q: Is it actually usable? A: Yes! Frython transpiles to valid Python. Everything Python can do, Frython can do — in French.

Q: Can I use external Python libraries? A: Absolutely. importer numpy comme np works perfectly.

Q: Do f-strings work? A: Yes, and expressions inside {} are also translated.

Q: Why does this exist? A: Pourquoi pas? 🥐

Q: Will my boss accept Frython in production? A: We cannot guarantee the health of your employment.


🤝 Contributing

  1. Fork the repo
  2. Create a branch: git checkout -b feature/my-feature
  3. Run tests: python -m unittest tests/test_frython.py -v
  4. Commit and push
  5. Open a Pull Request

📜 License

MIT — Free to use, modify and distribute. Even for pranking colleagues.


Made with ❤️, coffee ☕ and lots of baguettes 🥖

⭐ If this project made you smile, give it a star! ⭐

GitHub stars GitHub forks

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

frython-1.0.10.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

frython-1.0.10-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

Details for the file frython-1.0.10.tar.gz.

File metadata

  • Download URL: frython-1.0.10.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for frython-1.0.10.tar.gz
Algorithm Hash digest
SHA256 ed282581128479cb7021d801f61b252a92e212841fa8649c3683dfb0ae78c26d
MD5 b9514fb61eed86c9261bee519b2e49d8
BLAKE2b-256 2297d38a16295cb95fd4bcba192431b69aafc7e1ec9663da77bc5b93657bf624

See more details on using hashes here.

Provenance

The following attestation bundles were made for frython-1.0.10.tar.gz:

Publisher: update_docs.yml on Artleboss2/frython

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file frython-1.0.10-py3-none-any.whl.

File metadata

  • Download URL: frython-1.0.10-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for frython-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 69a8eb6e50584a16450017e906ec8b8c73999a251eed57bee15cb842636515b7
MD5 ae5e4b2653835e51bdfab8ffff2dfe9f
BLAKE2b-256 dc805229bbfa2214cce205095393ba46302d72452bff723c611ba3d4bbdfd0e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for frython-1.0.10-py3-none-any.whl:

Publisher: update_docs.yml on Artleboss2/frython

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page