Skip to main content

Atomion

CI PyPI GitHub issues Download Licence Version python Version micropython


Prochaine version • Installation • Contribuer • Licence


Bibliothèque Python pure permettant de manipuler des atomes, ions, molécules et réactions chimiques de manière intuitive, aussi bien sur ordinateur que sur calculatrice.

  • Syntaxe naturelle : instanciez un atome, un ion ou une équation en une seule ligne (H + Cl -> HCl), presque comme sur papier.
  • Légèreté : 100 % Python pur, sans dépendance lourde (numpy, scipy ou pandas).
  • Compatibilité : fonctionne sur ordinateur, dans le navigateur (Pyodide / JupyterLite), sur Raspberry Pi et sur calculatrice via MicroPython 1.9.4.
  • Rendu scientifique riche : affichage clair en console (configuration électronique, formules avec indices/exposants) (et futur intégration Jupyter via _repr_html_()).
  • Approche pédagogique : équilibrage automatique (équations, oxydo-réduction, acido-basique) et messages d'erreur explicites en français.
from atomion import *

eau = Molecule('H2O')
equation = Equation('H2 + O2 -> H2O')
equation.equilibrer()
print(equation)  # 2 H₂ + O₂ -> 2 H₂O
Afficher l'aperçu détaillé des fonctionnalités
from atomion import *

oxygene = Atome('O') # Avec symbole
hydrogene = Atome(1) # Avec nombre proton

chlorure = Ion('Cl')
# Ou
chlorure = IonMonoAtomique('Cl')

carbonate = Ion('CO3')
# Ou
carbonate = Ion('{CO3 2-}')
# Ou
carbonate = IonPolyAtomique('CO3')

eau = hydrogene * 2 + oxygene
# Ou
eau = Molecule('H2O')

from atomion.raccourcis import *

eau = H * 2 + O
# Ou
eau = H2O

# Quark
proton = QUp('R') + QDown('B') + QUp('V')
neutron = QUp('R') + QDown('B') + QDown('V')

# Fusion
noyauH = Noyau(Proton(1), Neutron(1))
noyauHe, *particules = noyauH << noyauH
atomeHe = noyauHe + Electron(2)

equation = DemiEquation('Cl2', '{Cl -}')
equation.equilibrer()
equation == 'Cl₂ + 2 e⁻ -> 2 Cl⁻'

equation = Equation('H2 + O2 -> H2O')
equation.equilibrer()
equation == '2 H₂ + O₂ -> 2 H₂O'

reaction = Reaction(
    equation = equation,
    quantites_reactifs = {H2: 1.6, O2: 1.3}
)
reaction.final() == {H2: 0, O2: 0.5, H2O: 1.6}

oxydoR = OxydoReduction(
    Ion('{Cr2O7 2-}'),
    Atome('Fe')
)
oxydoR.don == 'Fe -> Fe²⁺ + 2 e⁻'
oxydoR.gain == 'Cr₂O₇²⁻ + 14 H⁺ + 6 e⁻ -> 2 Cr³⁺ + 7 H₂O'

reaction = AcidoBasique('{C3H5O2 -}', '{H3O +}')
reaction.gain == 'C₃H₅O₂⁻ + H⁺ -> C₃H₆O₂'
reaction.don ==  'H₃O⁺ -> H₂O + H⁺'
reaction.equation == 'H₃O⁺ + C₃H₅O₂⁻ -> H₂O + C₃H₆O₂'

Vous trouverez un dossier exemples avec les diverses fonctionnalités.

Affichage

Le rendu des notations suit l'environnement : ¹²₆C, H₂O, Cl⁻ sur ordinateur, C, H2O, {Cl 1-} sur calculatrice. Il peut être forcé à tout moment :

from atomion import *
from atomion.utile import params

params.config(affichage = 'ascii')    # notation calculatrice
params.config(affichage = 'unicode')  # notation scientifique

Prochaine version : v1.9

  • Tableau d'avancement : génération complète (état initial, intermédiaire, final avec $x_{\max}$ et réactif limitant) adaptée à l'affichage console et calculatrice.
  • Calculs de grandeurs physiques : masse molaire ($M$), quantité de matière ($n$), concentration massique, pH (acides/bases forts et faibles, solutions tampons) et énergie nucléaire ($\Delta m \cdot c^2$).
  • Physique nucléaire :
    • Fusion (<<) : calcul d'énergie libérée et vérification de stabilité du noyau produit.
    • Fission (>>) : implémentation complète avec lois de Soddy et bilan énergétique.
    • Radioactivité ($\alpha$, $\beta^+$, $\beta^-$, $\gamma$) : désintégrations et énergie associée.
  • Mode pédagogique & pas-à-pas : paramètre etapes=True pour détailler l'équilibrage des équations et réactions d'oxydo-réduction, accompagné de messages d'erreur explicites en français.
  • Acido-basique : détection automatique du couple acide/base conjugué lorsqu'il n'est pas renseigné.
  • Chimie organique : nomenclature IUPAC des molécules linéaires simples et affichage des formules semi-développées en ASCII (ex. : CH3-CH2-CH2-OH $\rightarrow$ propan-1-ol).
  • Assistant interactif calculatrice : menu guidé (atomion.menu / assistant()) pour utiliser la bibliothèque sans connaître la syntaxe par cœur.

Installation

Prérequis

  1. Ouvrez un terminal (invite de commande).

    Comment faire selon votre système ?
    • Windows : appuyez sur Windows + R, tapez cmd (ou powershell), puis validez avec Entrée.
    • macOS : appuyez sur Cmd + Espace pour ouvrir Spotlight, tapez Terminal, puis validez avec Entrée.
    • Linux : appuyez sur Ctrl + Alt + T ou ouvrez l'application Terminal depuis le menu de vos applications.
  2. Vérifiez que Python >= 3.9 est installé.

    Comment vérifier ?

    Exécutez python --version (ou python3 --version sur macOS et Linux). La version affichée doit être supérieure ou égale à 3.9.
    Si ce n'est pas le cas, téléchargez et installez Python (version 3.9 ou plus récente).

  3. Vérifiez que pip est à jour.

    Comment vérifier ?

    Exécutez pip --version (ou python -m pip --version). La version affichée doit être supérieure ou égale à 20.0.0.
    Pour mettre pip à jour, exécutez :

    python -m pip install --upgrade pip
    

Sur ordinateur

  1. Installez le paquet :
    pip install atomion
    
  2. Pour mettre à jour le module lors d'une nouvelle version :
    pip install --upgrade atomion
    
  3. Ensuite créez un nouveau fichier, importez le module, et amusez vous !
    from atomion import *
    
    print(Atome('C') + Molecule('O2'))
    

Sur calculatrice

Atomion est compatible avec MicroPython 1.9.4, utilisé sur de nombreuses calculatrices graphiques (NumWorks, TI, Casio, etc.).

  1. Installez les dépendances nécessaires à la génération du fichier unique :
    pip install "atomion[calc]"
    
  2. Générez le fichier autonome atomion.py dans la langue souhaitée :
    python3 -m mk_file_calculatrice --lang fr
    # Ou en anglais :
    python3 -m mk_file_calculatrice --lang en
    
  3. Branchez votre calculatrice à votre ordinateur et copiez-y le fichier atomion.py généré.
  4. Débranchez votre calculatrice en toute sécurité, importez atomion et amusez-vous !

Besoin d'aide ? Si vous rencontrez un problème, consultez les issues existantes ou ouvrez-en une nouvelle.

Contribuer

# Cloner
git clone https://github.com/4surix/atomion.git
cd atomion

# Installer en mode dev
pip install -e ".[dev]"

# Lancer les tests
python -m unittest discover -s tests

# Lint
ruff check .

Licence

Ce projet est distribué sous GNU Affero General Public License v3.0 ou ultérieure (AGPL-3.0-or-later).

  • Texte complet : LICENSE - gnu.org
  • Vous pouvez utiliser, étudier, modifier et redistribuer atomion, y compris à des fins commerciales.
  • En contrepartie : tout dérivé distribué ou exposé via un réseau (site web, API, SaaS) doit rester sous AGPL et fournir son code source à ses utilisateurs.
  • La mention de copyright et la licence doivent être conservées (pas de réappropriation).

Copyright (C) 2026 Asurix.

Metadata

Release files for atomion 1.8.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 atomion 1.8.0
File Size Uploaded Provenance Actions
atomion-1.8.0.tar.gz 78.5 kB With provenance Details for atomion-1.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for atomion 1.8.0
File Interpreter ABI Platform Actions
atomion-1.8.0-py3-none-any.whl Python 3 none any Details for atomion-1.8.0-py3-none-any.whl

Total release size: 153.4 kB

Release files / atomion-1.8.0.tar.gz

Download URL atomion-1.8.0.tar.gz
Size 78.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b8b7a59626b963f9a24baf919e80cb7ea2ab0e2f9d345d30a57ae8f8e334eb43
BLAKE2b-256 checksum
How to use checksums
9c360e4af9d839f8a54d7f356f0e787e9ff2acae6946d6e499df1324d2a66062
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / atomion-1.8.0-py3-none-any.whl

Download URL atomion-1.8.0-py3-none-any.whl
Size 74.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80eb60a3e399b56a575cba4918e78fca010866952233689e261c9f198005cd89
BLAKE2b-256 checksum
How to use checksums
efd4d9dbfdbc18f0528bfbfcc31bab69a1136695cc8dbe2b1b11a53ece04104a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for atomion 1.8.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for atomion-1.8.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

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.

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