Skip to main content

Une bibliothèque Python pour accéder aux dictionnaires avec la notation par points.

Project description

Dottify

Dottify est une bibliothèque Python simple qui permet de convertir des dictionnaires en objets accessibles par attributs. Au lieu d'utiliser la syntaxe classique dict["key"], vous pouvez accéder aux valeurs d'un dictionnaire en utilisant la notation par points dict.key après avoir appliqué la transformation.

Installation

Vous pouvez installer Dottify via pip :

pip install dottify

Utilisation

Voici un exemple d'utilisation de Dottify :

from dottify import Dottify
           
persons = {
    "Alice": {
        "age": 30,
        "city": "Paris",
        "profession": "Engineer"
    },
    "Charlie": {
        "age": 35,
        "city": "Marseille",
        "profession": "Doctor"
    }
}

persons = Dottify(persons)

print(persons.Alice.age)             # 30
print(persons.Charlie.city)          # Marseille
print(persons.Charlie.age)           # 35
print(persons.Alice.profession)      # Engineer

Fonctionnalités

  • Conversion facile de dictionnaires en objets accessibles par attributs.
  • Prise en charge des dictionnaires imbriqués.

Contribuer

Les contributions sont les bienvenues ! N'hésitez pas à soumettre des demandes de tirage (pull requests) ou à ouvrir des problèmes (issues) sur le dépôt GitHub.

License

Distribué sous la licence MIT. Voir LICENSE pour plus d'informations.

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

dottify-1.0.3.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

dottify-1.0.3-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file dottify-1.0.3.tar.gz.

File metadata

  • Download URL: dottify-1.0.3.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for dottify-1.0.3.tar.gz
Algorithm Hash digest
SHA256 757d026d3423dc5130b7a760e474e0bb7a65131eac043ce1ccccdcc5ee88e7e8
MD5 f46b2eb845fb791d5efd68386b969d50
BLAKE2b-256 19fdd190bca2067195a433f9e06499d1173f2a58c6370e6cf1bc3529ec5017e6

See more details on using hashes here.

File details

Details for the file dottify-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: dottify-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for dottify-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6ee80aadd79a8856380fb32ca2f8d475e3961f8a196548c6d3021253cc2ab243
MD5 cf428f3a9bb77fcb31c89ee039c80832
BLAKE2b-256 7f8b385a780f9f2d164732672ee8d9cd7aafcae6c8ed9783a0e66f9cc11200c2

See more details on using hashes here.

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