skillfed

traitlets

Traitlets Python configuration system

traitlets Permissive license BSD 3-Clause License - Copyright (c) 2001-, IPython Development Team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that… (full text in the JSON record) Active 655 v5.16.1 released

Install

traitlets on PyPI

pip

pip install traitlets

uv

uv add traitlets

poetry

poetry add traitlets

Package facts

License BSD 3-Clause License - Copyright (c) 2001-, IPython Development Team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 10 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: traitlets-5.16.1-py3-none-any.whl

Keywords: Interactive, Interpreter, Shell, Web

Framework :: IPythonFramework :: JupyterIntended Audience :: DevelopersIntended Audience :: Science/ResearchIntended Audience :: System AdministratorsLicense :: OSI Approved :: BSD LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Typing :: Typed

About traitlets

from the package's own PyPI description — quoted content, verbatim

Traitlets

Tests (image) Documentation Status (image) Tidelift (image)

home https://github.com/ipython/traitlets
pypi-repo https://pypi.org/project/traitlets/
docs https://traitlets.readthedocs.io/
license Modified BSD License

Traitlets is a pure Python library enabling:

  • the enforcement of strong typing for attributes of Python objects (typed attributes are called "traits");
  • dynamically calculated default values;
  • automatic validation and coercion of trait attributes when attempting a change;
  • registering for receiving notifications when trait values change;
  • reading configuring values from files or from command line...

Read as markdown · JSON record · Source repository · Homepage · Docs

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

Traitlets provides typed attributes for Python objects with automatic validation, coercion, dynamic defaults, and change notifications—a lightweight pure-Python alternative to the Enthought traits library that powers IPython and Jupyter configuration.

Installation is straightforward with no runtime dependencies; the package is actively maintained with a recent release 10 days ago and strong upstream support from the IPython/Jupyter ecosystem.

BSD 3-Clause (permissive) license allows commercial and private use with minimal restrictions; you must retain copyright notices and the license text in distributions.

Usage

pip install traitlets

from traitlets import HasTraits, Unicode, Integer, observe

class Example(HasTraits):
    name = Unicode()
    count = Integer(0)
    
    @observe('count')
    def _count_changed(self, change):
        print(f"{change['name']} changed to {change['new']}")

obj = Example(name='test', count=5)

Requires Python 3.10 or later.

Verdict: Traitlets is a mature, actively maintained library with zero known vulnerabilities, no external dependencies, and permissive licensing. It is well-suited for projects requiring declarative attribute typing and validation, particularly those integrating with IPython or Jupyter ecosystems.

typed attributes pythontrait validation coercionpython object descriptorsconfiguration system ipythondynamic defaults validationattribute type enforcementchange notifications observers

Similar packages