Skip to main content

Team Batcave Python Toolkit

The batutils is a fork of the batutils package in order to continue its development and maintenance beyond Team Batcave's lifespan.

It is a smooshup of a few Python packages from the CCP Tools Team of old (Team Batcave).

Our two most commonly used internal packages, called datetimeutils and typeutils were too generically named for Pypi.org and since they were both used in something like 80-90% of our other projects, it made sense to just smoosh them together in one module, and thus, the batutils package was born.

Here's the README of the Date Time Utils submodule.

Here's the README of the Type Utils submodule.

Changes from ccptools

The legacyapi submodule has been removed.

Date-Time Utils

The old datetimeutils package is now included here as the dtu submodule.

from batutils import dtu

Structs

Importing * from the structs submodule will import all of the most commonly used imports in our projects:

from typing import *  # For type annotation

import abc  # For interfaces (Abstract Base Classes)
import dataclasses  # For dataclass structs
import decimal  # Used whenever we're handling money
import enum  # Also used for struct creation
import logging  # Used pretty much everywhere
import re  # Used surprisingly frequently
import time  # Very commonly used

Note that datetime is not included in this. That's because tt'll also import the aliases from the Datetime Utils (batutils.dtu.structs.aliases) package instead:

Date = datetime.date
Time = datetime.time
Datetime = datetime.datetime
TimeDelta = datetime.timedelta
TzInfo = datetime.tzinfo
TimeZone = datetime.timezone

Furthermore, it'll also include a few of the most commonly used utility classes from the Type Utils submodule:

  • The Singleton Meta Class
  • The Empty and EmptyDict classes as well as the if_empty method
  • The EnumEx base class for Enums with the from_any class method

So in most cases we can cover something like 90% of any imports we tend to need in every Python file with a single line:

from batutils.structs import *

Release files for batutils 2.2.0

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

Source distribution (sdist)

Source distribution for batutils 2.2.0
File Size Uploaded
batutils-2.2.0.tar.gz 45.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for batutils 2.2.0
File Interpreter ABI Platform
batutils-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 106.0 kB

Release files / batutils-2.2.0.tar.gz

Download URL batutils-2.2.0.tar.gz
Size 45.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b0c449586309e78a27912c91977fad6d1b0bd0c8008bc7f61be7735911324e7a
BLAKE2b-256 checksum
How to use checksums
f8b2dde37c856497b9edd9e93e34c7d06b2758537209924568989e8e6fa2c8ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / batutils-2.2.0-py3-none-any.whl

Download URL batutils-2.2.0-py3-none-any.whl
Size 60.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6dc07fffca402e301535dd5e1376a5cd350cb07b6664f5ee3cb520678c70de21
BLAKE2b-256 checksum
How to use checksums
86394edf17c7fb7a7747eaa03bffd837915aa094546e72004a5beb9137e8758d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.0

2 release files

2.0.0

2 release files

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