Skip to main content

Polars-business

polars-business

PyPI version Read the docs!

Business day utilities for Polars.

  • ✅ blazingly fast, written in Rust!
  • ✅ seamless Polars integration!
  • ✅ define your own custom holidays and weekends!

Installation

First, you need to install Polars.

Then, you'll need to install polars-business:

pip install polars-business

Then, if you can run

from datetime import date
import polars_business as plb

print(plb.date_range(date(2023, 1, 1), date(2023, 1, 10), eager=True))

it means installation all worked correctly!

Read the documentation for a little tutorial and API reference.

Basic Example

Say we start with

from datetime import date

import polars as pl
import polars_business as plb


df = pl.DataFrame(
    {"date": [date(2023, 4, 3), date(2023, 9, 1), date(2024, 1, 4)]}
)

Let's shift Date forwards by 5 days, excluding Saturday and Sunday:

result = df.with_columns(
    date_shifted=plb.col("date").bdt.offset_by(
      '5bd',
      weekend=('Sat', 'Sun'),
    )
)
print(result)
shape: (3, 2)
┌────────────┬──────────────┐
│ date       ┆ date_shifted │
│ ---        ┆ ---          │
│ date       ┆ date         │
╞════════════╪══════════════╡
│ 2023-04-03 ┆ 2023-04-10   │
│ 2023-09-01 ┆ 2023-09-08   │
│ 2024-01-04 ┆ 2024-01-11   │
└────────────┴──────────────┘

You can also count the number of business days between two given dates, specify a custom calendar holiday, and create a date range excluding workdays.

Read the documentation for more examples!

Performance

Single-threaded performance is:

  • about on par with NumPy (it's essentially a Rust reimplementation)
  • about an order of magnitude faster than pandas.

but note that Polars will take care of parallelisation for you, and that this plugin will fit in with Polars lazy execution and not require any data conversion.

Release files for polars-business 0.3.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for polars-business 0.3.22
File
polars_business-0.3.22-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
polars_business-0.3.22-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ IBM System/390x Details
polars_business-0.3.22-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-32 Details
polars_business-0.3.22-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARMv7l Details
polars_business-0.3.22-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARM64 Details
polars_business-0.3.22-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
polars_business-0.3.22-cp311-cp311-macosx_10_12_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.12+ x86-64 Details
polars_business-0.3.22-cp310-none-win_amd64.whl CPython 3.10 none Windows x86-64 Details
polars_business-0.3.22-cp310-none-win32.whl CPython 3.10 none Windows x86-32 Details
polars_business-0.3.22-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
polars_business-0.3.22-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ IBM System/390x Details
polars_business-0.3.22-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-32 Details
polars_business-0.3.22-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ ARMv7l Details
polars_business-0.3.22-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ ARM64 Details
polars_business-0.3.22-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
polars_business-0.3.22-cp310-cp310-macosx_10_12_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.12+ x86-64 Details

Total release size: 83.8 MB

Release files / polars_business-0.3.22-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL polars_business-0.3.22-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.7 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
4d4f1260a25966e9fa3d35ca4ccd1d4988aa2dc40bb7e8f30b7218405186a23a
BLAKE2b-256 checksum
How to use checksums
c0bcf2af0612df26d76f0dbf82be21e117a2185586ca9eb6563571e00ac2a54a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL polars_business-0.3.22-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 7.2 MB
Tags CPython 3.11 Linux glibc 2.17+ IBM System/390x
SHA-256 checksum
How to use checksums
3277e04dc79cd4c69d16d5895c4f5f779354de9f83d545903609590e1778c04f
BLAKE2b-256 checksum
How to use checksums
aafa234a222fac5a81777eb2016114c8b5f1903b0e2314e714606fabfe8e3ca7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL polars_business-0.3.22-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Size 6.8 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-32
SHA-256 checksum
How to use checksums
eb9c6aad4635748a135dbf43976ec37f79cdfd4785287c13f2e67f926a7e38c6
BLAKE2b-256 checksum
How to use checksums
8199936e4762c552ca082b1636e17d7776397c9b9ad7bc667aa4d3d830e262ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL polars_business-0.3.22-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 6.0 MB
Tags CPython 3.11 Linux glibc 2.17+ ARMv7l
SHA-256 checksum
How to use checksums
792e4527d9176f744b44b36e5d64aaa0132ed49aace7e3419ee53ecec3c5dd6a
BLAKE2b-256 checksum
How to use checksums
205c02d193acabdb5deafba452d4a659b0499775fc6db5cb34b33640a31066d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL polars_business-0.3.22-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.1 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
251385788c3d8f076a3328217e3beb303b60d111a55bc2ba1d2c9041b5ad4f98
BLAKE2b-256 checksum
How to use checksums
a7a39678854f6127809e7f8785abd60a2e469d51089224cac7f0cbfcbed87d1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp311-cp311-macosx_11_0_arm64.whl

Download URL polars_business-0.3.22-cp311-cp311-macosx_11_0_arm64.whl
Size 3.0 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3102c755f674132e23a29152bd1d4d24a25c358374dfd2f247c30f2d0fe35dd9
BLAKE2b-256 checksum
How to use checksums
fd1349deb82398a217254ccd33c12ace92178a6faddca4a0cdb9107cb3b1a878
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp311-cp311-macosx_10_12_x86_64.whl

Download URL polars_business-0.3.22-cp311-cp311-macosx_10_12_x86_64.whl
Size 3.2 MB
Tags CPython 3.11 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
edd98ddf0d659a3d2b1ccbe167c80407b484e5ed3e6c0636d488d832ba437b29
BLAKE2b-256 checksum
How to use checksums
de45ce9943629b586ddefe8249fe9787b36994ca5d13917cdc5a8b1e960f7a1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp310-none-win_amd64.whl

Download URL polars_business-0.3.22-cp310-none-win_amd64.whl
Size 3.0 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
87cef05d7d97db7cedb908e8ce66eeaf3451ebf8374ae82a25f367e0232640bc
BLAKE2b-256 checksum
How to use checksums
f997807e41dcc6bb0e8946c9504b0ea8de9f669d1be398ce0a66e908c9200a86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp310-none-win32.whl

Download URL polars_business-0.3.22-cp310-none-win32.whl
Size 2.6 MB
Tags CPython 3.10 Windows x86-32
SHA-256 checksum
How to use checksums
b7e1ac7dcf2cdf83d20869994f38a6395b10b6105e619bdff7174d1b17e2245a
BLAKE2b-256 checksum
How to use checksums
38d1c7684e7282a40d05ea9baca4f77c8f158ecde76c11986515a1a9547855bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL polars_business-0.3.22-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.7 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
694ba380e192b4e52caa3748c7f8bedaa05171e5cddddb79ecf309ae2928726e
BLAKE2b-256 checksum
How to use checksums
93dd73ed3584de26eda62bcbb65121feabf6a40640d3eac88693cd5bf745a290
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL polars_business-0.3.22-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 7.2 MB
Tags CPython 3.10 Linux glibc 2.17+ IBM System/390x
SHA-256 checksum
How to use checksums
82eadec88f10ced3ca10ee7d22fdd3ed024cf1790ba68ffb1b68d09454f3066d
BLAKE2b-256 checksum
How to use checksums
09a11aa6f3ba14bc7c2da286f0fff9b6ca169ab69ac615af91ed13b4a7ae5b33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL polars_business-0.3.22-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Size 6.8 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-32
SHA-256 checksum
How to use checksums
a7800313f75509b102e39f7a4b179dfc89af4caf766f7967a237314416410bc5
BLAKE2b-256 checksum
How to use checksums
d7f4f97f70cf97e62f936c35ae60281c2573c46befb47583fa3f0bd90c42c95f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL polars_business-0.3.22-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 6.0 MB
Tags CPython 3.10 Linux glibc 2.17+ ARMv7l
SHA-256 checksum
How to use checksums
c770f4ed8beb0aa7a2a89f3547906d2e256edf32dd8ebf0d7c1cb111c023a9d4
BLAKE2b-256 checksum
How to use checksums
9d5c8ba272d6113e1e59d313baa19ad4a254298462c5fccac1f91456354c4098
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL polars_business-0.3.22-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.1 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
2768fe26405378c2983ee825f4cb0bc6dd6851a9b58368a59d861af24ca1d814
BLAKE2b-256 checksum
How to use checksums
708162bf1761e045d09192a6084192c6b6f87e70e24dea24157ebdc7e780bf80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp310-cp310-macosx_11_0_arm64.whl

Download URL polars_business-0.3.22-cp310-cp310-macosx_11_0_arm64.whl
Size 3.0 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
840970cec20bf2bb492a4850dd2c191e298837f3806c0c379b2ec03d785fed06
BLAKE2b-256 checksum
How to use checksums
214341395796119ec4a4730a95fb9e39e58192fd68833206eaaa9aa1ebab6817
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0

Release files / polars_business-0.3.22-cp310-cp310-macosx_10_12_x86_64.whl

Download URL polars_business-0.3.22-cp310-cp310-macosx_10_12_x86_64.whl
Size 3.2 MB
Tags CPython 3.10 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
570865b467cb2cb00f7bcf563bb5b176d87c895024ad3151b8824e7b748fcfac
BLAKE2b-256 checksum
How to use checksums
8df95e2d6cdde08ebdc3ab9a949f83cbce5378609276032777d0c0db7c4bd623
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.4.0
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page