Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Advanced types: UniqList and ImmutableDict

Project description

# nicetypes

Advanced types for Python3: ImmutableDict and UniqList.

## Examples

### ImmutableDict

#### Usage

from nicetypes import ImmutableDict
frozen_dict = ImmutableDict({"foo": 1, "bar": 2})
# ImmutableDict({'foo': 1, 'bar': 2})
frozen_dict["foo"] = 3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'ImmutableDict' object does not support item assignment

### UniqList

#### Usage

from nicetypes import UniqList
unql = UniqList([1, 2, 2, 2, 3, 2])
# UniqList([1, 2, 3])
# UniqList([1, 2, 3, 4])

## Usinge nicetypes

### Prerequisites

This module is developped on a Fedora 25 machine with Python 3.5.3, but it should theoretically run on **any system with a Python3 interpreter**. Don't hesitate to report any issues if it doesn't work on your platform. However, this module is not intented to work on Python2.

### Installation

#### Pip + Virtualenv (recommended)

First, make sure Pip is installed. Linux users should use their package manager. Alternatively, you can follow the [official site documentation]( Then, make sure virtualenv is installed. Most linux distribution provide a virtualenvwrapper package that make virtualenvs easy-to-use. Otherwise, you might read [this documentation](

mkvirtualenv -p python3 foobar
workon foobar # Should be automatically done by the previous command
pip install nicetypes
# Later, check for upgrades with
pip install -U nicetypes

#### Pip + admin rights

This method is similar to the previous one. First, get pip. Then, install nicetypes directly on your system with admin rights instead of installing it in a isolated virtualenv.

sudo pip3 install nicetypes
# Later, check for upgrades with
sudo pip3 install -U nicetypes

#### Sources download (avoid)

If you can't use Pip, then you could download the sources directly from Github. However, you should understand that you will need to handle updates and system integration all by yourself if you choose this method.

## Contributing

### Prerequisites

1. Make sure you have the following packages installed:
- Python3,
- Git,
- Virtualenv.
2. Clone this Github repository and enter the repository.
3. Create a Python3 virtualenv and activate it.
4. Install the development dependencies with `pip install -r dev-requirements.txt`

### Style guide

Keep [PEP20]( in mind, and use pylint to follow the coding style guide:

pylint --rcfile=.pylintrc src/nicetypes

### Unit tests

Make sure that all the code is covered by unit tests. Use a [Given-When-Then]( structure to increase the tests readability. Avoid importing external libraries for the assertions, use the unittest methods instead. Run the tests and check the coverage with:

py.test --verbose --cov=src --cov-fail-under=100

### Continuous integration

This module use a [Travis pipeline]( for continuous integration. It performs the following actions when a Git branch is pushed on Github:
1. check the style guide,
2. run the unit tests and checking the coverage,
3. in case of tagged release, deploy to PyPI.

## Authors

- [Thibaut Vuillemin](

### Special thanks

- [Balthazar Rouberol](
- [Guillaume Bouchard](

## License

This module is licensed under the MIT License - see the LICENSE file for details.

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
nicetypes-0.4.0-py2.py3-none-any.whl (8.3 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Sep 21, 2017
nicetypes-0.4.0.tar.gz (13.6 kB) Copy SHA256 hash SHA256 Source None Sep 21, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page