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.1.3.tar.gz (32.0 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.1.3-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for frython-1.1.3.tar.gz
Algorithm Hash digest
SHA256 b1f9a8ca374f992ed436767ec872317a0bd735f9e800b979ee43b8b3e448a2ab
MD5 da9a46b1e3c3672b43e480e8f1a3c38f
BLAKE2b-256 331e2e2afc656a7b2008e2625d3ae5679103802515b40df7cd07d1190eddfa6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for frython-1.1.3.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.1.3-py3-none-any.whl.

File metadata

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

File hashes

Hashes for frython-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5067d3573e85cd8c784e2fa66a697f862ca6cca1bededb6d26fe1981fd44ab3a
MD5 b8862e2a135f44466d903bfcba9534ac
BLAKE2b-256 d193f129a6131423ca4f1126e1d123cc8c980a6cc71e75a20bde43d4c1fb8ec8

See more details on using hashes here.

Provenance

The following attestation bundles were made for frython-1.1.3-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