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.0.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.1.0-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: frython-1.1.0.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.1.0.tar.gz
Algorithm Hash digest
SHA256 b9a4d532f9cb4b31d23519e13543f529185fde589a18e716efe37e4f04ca63c2
MD5 9d3b6227f5922c1107b8766c09b494fc
BLAKE2b-256 8625fc8716f6f4f21b359182aeb30b1ce84116f852f1aba431cc8f67936dbc40

See more details on using hashes here.

Provenance

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

Publisher: publish.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.0-py3-none-any.whl.

File metadata

  • Download URL: frython-1.1.0-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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d4be9d8928d6941963713c63eddb83ac58ceadf8d43e0104772a99ea9756cc2
MD5 89330e931cc485055ca91c2c0b1b5e73
BLAKE2b-256 387943a3831071d5bd12355f3fb55ac2a28c057dc2d955463dc46907b1843914

See more details on using hashes here.

Provenance

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

Publisher: publish.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