Skip to main content

A case-insensitive list for Python

Project description

nocaselist - A case-insensitive list for Python

Version on Pypi Test status (master) Docs status (master) Test coverage (master)

Overview

Class NocaseList is a case-insensitive list that preserves the lexical case of its items.

Example:

$ python
>>> from nocaselist import NocaseList

>>> list1 = NocaseList(['Alpha', 'Beta'])

>>> print(list1)  # Any access is case-preserving
['Alpha', 'Beta']

>>> 'ALPHA' in list1  # Any lookup or comparison is case-insensitive
True

The NocaseList class supports the functionality of the built-in list class of Python 3.8 on all Python versions it supports (except for being case-insensitive, of course).

The case-insensitivity is achieved by matching any key values as their casefolded values. By default, the casefolding is performed with str.casefold() for unicode string keys and with bytes.lower() for byte string keys. The default casefolding can be overridden with a user-defined casefold method.

Installation

To install the latest released version of the nocaselist package into your active Python environment:

$ pip install nocaselist

The nocaselist package has no prerequisite Python packages.

For more details and alternative ways to install, see Installation.

Documentation

Change History

Contributing

For information on how to contribute to the nocaselist project, see Contributing.

License

The nocaselist project is provided under the Apache Software License 2.0.

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

nocaselist-2.1.0.tar.gz (108.1 kB view details)

Uploaded Source

Built Distribution

nocaselist-2.1.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file nocaselist-2.1.0.tar.gz.

File metadata

  • Download URL: nocaselist-2.1.0.tar.gz
  • Upload date:
  • Size: 108.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for nocaselist-2.1.0.tar.gz
Algorithm Hash digest
SHA256 fb7306f5a3e045534e737ab7ecbeee039ba5e9bafbc5b5f231f616d7e9211b65
MD5 30a83f342cdb5a5a6ae20785daa7de94
BLAKE2b-256 889071c260c7cfb4fa316045f07e25336471d9c18958e808a987c757414909c5

See more details on using hashes here.

File details

Details for the file nocaselist-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: nocaselist-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for nocaselist-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1594267186c6d37d447b6649a80af8ac2fe1065d3ef99a9ee5390a3ac1563e4
MD5 ed206dd69637e7030e18f5dc7f4d5466
BLAKE2b-256 2bf88997bb4b274409eb7fdde3e004f7b5861185d9f9b9ec2239c8b0b7f64680

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page