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.0.3.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

nocaselist-2.0.3-py2.py3-none-any.whl (12.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: nocaselist-2.0.3.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for nocaselist-2.0.3.tar.gz
Algorithm Hash digest
SHA256 55714da8433fb4843ce797404977e4385d5e3df9e4aa00f7dde983fd87410fef
MD5 5a9c2506abcff05500c3bb8b2abfc4ef
BLAKE2b-256 cf2e4e7381b5552f530fa60f604a47bec08fe285bd3a4ee800cccdccfd978fa4

See more details on using hashes here.

File details

Details for the file nocaselist-2.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: nocaselist-2.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for nocaselist-2.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 31cd7c40f256d5295ea76823492787c60d1b2cdc7affe757b173cc92a6c3c2ff
MD5 e9ea70473b95676f95993966d41d441a
BLAKE2b-256 3ee43073ba656dc27da760ee4f55d4e9e57ea3ebe269e56d0488d1da659e8b98

See more details on using hashes here.

Supported by

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