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.14 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.2.0.tar.gz (113.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nocaselist-2.2.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nocaselist-2.2.0.tar.gz
  • Upload date:
  • Size: 113.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nocaselist-2.2.0.tar.gz
Algorithm Hash digest
SHA256 b06b3d6fec1abc05c607aa8e813599388727a08e18c223431d7469cf6eb0c06a
MD5 6fe01dbfa1fa2aefbca3030961f2d8ec
BLAKE2b-256 65df3100e2c6e0a68c08db5e2e48ecb09f6c3282e5aaf2499c8b99b84e7a30f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for nocaselist-2.2.0.tar.gz:

Publisher: publish.yml on pywbem/nocaselist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: nocaselist-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nocaselist-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b7533e28ec93fdec2ae22a7b5b1a453e9bd1e53a9d4431321e84ce11e7273ea
MD5 8d9ab68c41a43e674f4b62ee90594ae7
BLAKE2b-256 6f0ed7f6cd20ab43422aa1535df1bdc6da3dd6849dffeb344ba71b4f19678748

See more details on using hashes here.

Provenance

The following attestation bundles were made for nocaselist-2.2.0-py3-none-any.whl:

Publisher: publish.yml on pywbem/nocaselist

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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