Skip to main content

[![Build Status](https://travis-ci.org/lejar/traitlite.svg?branch=master)](https://travis-ci.org/lejar/traitlite)

# traitlite

Traitlite is a light-weight (MIT-licensed) package which provides certain [descriptors](https://docs.python.org/3/howto/descriptor.html) to help control the attributes in a class, such as making them read-only<sup>*</sup> or providing type-checking whenever the value is set. The documentation has examples for every trait, so check it out!

<sup>*</sup> well, as read-only as you can get in python

## Installation

The easiest way to install traitlite is through pip:

`bash pip install traitlite `

## Running the tests

Traitlite uses the builtin python unit testing framework, along with [hypothesis](https://hypothesis.works/). Additionally, [cosmic-ray](https://github.com/sixty-north/cosmic-ray) is used for mutation testing.

To install the dependencies required to run the tests, run: `bash pip install -r unittest_requirements.txt ` This will install both hypothesis and cosmic-ray.

To run the tests, simply execute the following from the package directory:

`bash python setup.py test `

To run mutation testing, execute: `bash python setup.py crtest `

If you want to get the [coverage](https://github.com/nedbat/coveragepy) of the tests, execute:

`bash python setup.py coverage `

## Documentation

The docs can be found [here](https://traitlite.readthedocs.io/en/latest/). Alternatively, if you want to build them yourself simply run

`bash make <target> ` in the docs folder of the project. To see a list of all the different targets, simply run make without any arguments.

Metadata

Release files for traitlite 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for traitlite 0.0.2
File Size Uploaded Provenance Actions
traitlite-0.0.2.tar.gz 6.6 kB Without provenance Details for traitlite-0.0.2.tar.gz

Release files / traitlite-0.0.2.tar.gz

Download URL traitlite-0.0.2.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fe0a5690582645b179fe9b295068fec308eae10799bf88fd55e3764d2c102519
BLAKE2b-256 checksum
How to use checksums
77ff8fbab8081532b12dd2df2003e5bd8a31d12fb2d2cabf411861a8cab39331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Security for traitlite 0.0.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

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