Skip to content

Replace requests with niquests or httpx? #457

@tobixen

Description

@tobixen

Updates as of 2026-01:

  • I decided to use niquests in version 2.0.
  • After relelasing 2.0 I was requested to revert as the dependency was considered unacceptable by a package maintainer
  • I maintained a "dual release"-scheme with 2.x, for every release I would make one version that worked with requests and one version that worked with niquests.
  • After some consideration, I've decided to stick with niquests in 3.0. However the library also supports request and httpx. If someone has strong preferences (i.e. for usage of caldav in a project that already uses httpx for all other communication, or for a distro release on a platform where python-httpx is readily packaged while python-niquests isn't), then it's "just" to edit the pyproject.toml file and replace niquests with requests and/or httpx.
  • I will revisit this before releasing 4.0

My reasoning is found further below in this thread.


@ArtemIsmagilov suggested to replace the requests library with niquests in #455, and raised my awareness that the requests library is likely at a dead end. I'm a bit wary of changes here, for two reasons:

  • The authorization part is very fragile due to weird server setups - several time I've been doing minor changes here, and long time after it has been released as part of HomeAssistant, and people start complaining.
  • Due to recent supply-chain attacks I'm wary of adding new dependencies. So far the niquests package is maintained by one maintainer and has gotten relatively few eyeballs.

So I've decided that this change will be merged into the master branch, but only be released officially in version 2.0 of the library. I assume there will be at least a 1.5-release before that still based on requests.

Then @sim0nx suggested using httpx rather than niquests, as this package has been around for a while, has more maintainers and basically has the same feature set.

I raise this issue to allow people to drop thoughts on this.

(as for the requests library, the 2.x-version line has been in a feature freeze for ages, 3.0-version is long overdue. I also found that the project owner has received a significant amount of fundraised money to get 3.0 done. It may seem like the money has been spent without significant visible progress on getting 3.0 released. Among the things needed is a possibility for doing things async, support for HTTP/2 and various other things. I also think the authentication code belongs to the requests-library and not in the CalDAV library)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions