Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

characteristic

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

characteristic

Python attributes without boilerplate.

  • 14.3.0
  • PyPI
  • Socket score

Maintainers
2

characteristic: Python attributes without boilerplate.

.. image:: https://pypip.in/version/characteristic/badge.svg :target: https://pypi.python.org/pypi/characteristic/ :alt: Latest Version

.. image:: https://travis-ci.org/hynek/characteristic.svg :target: https://travis-ci.org/hynek/characteristic :alt: CI status

.. image:: https://coveralls.io/repos/hynek/characteristic/badge.png?branch=master :target: https://coveralls.io/r/hynek/characteristic?branch=master :alt: Current coverage

.. begin

characteristic is an MIT <http://choosealicense.com/licenses/mit/>_-licensed Python package with class decorators that ease the chores of implementing the most common attribute-related object protocols.

You just specify the attributes to work with and characteristic gives you any or all of:

  • a nice human-readable __repr__,
  • a complete set of comparison methods,
  • immutability for attributes,
  • and a kwargs-based initializer (that cooperates with your existing one and optionally even checks the types of the arguments)

without writing dull boilerplate code again and again.

This gives you the power to use actual classes with actual types in your code instead of confusing tuple\ s or confusingly behaving namedtuple\ s.

So put down that type-less data structures and welcome some class into your life!

characteristic\ ’s documentation lives at Read the Docs <https://characteristic.readthedocs.org/>, the code on GitHub <https://github.com/hynek/characteristic>. It’s rigorously tested on Python 2.6, 2.7, 3.3+, and PyPy.

Authors

characteristic is written and maintained by Hynek Schlawack <https://hynek.me/>_.

The development is kindly supported by Variomedia AG <https://www.variomedia.de/>_.

It’s inspired by Twisted’s FancyEqMixin <http://twistedmatrix.com/documents/current/api/twisted.python.util.FancyEqMixin.html>_ but is implemented using class decorators because sub-classing is bad for you <https://www.youtube.com/watch?v=3MNVP9-hglc>_, m’kay?

The following folks helped forming characteristic into what it is now:

  • Adam Dangoor <https://github.com/adamtheturtle>_
  • Glyph <https://github.com/glyph>_
  • Itamar Turner-Trauring <https://github.com/itamarst>_
  • Jean-Paul Calderone <https://github.com/exarkun>_
  • Julian Berman <https://github.com/julian>_
  • Richard Wall <https://github.com/wallrj>_
  • Tom Prince <https://github.com/tomprince>_

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc