Skip to main content

Team Batcave's utilities for date and/or time objects and values and messing with types and so much more.

Project description

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 *

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

batutils-2.2.0.tar.gz (45.3 kB view details)

Uploaded Source

Built Distribution

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

batutils-2.2.0-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: batutils-2.2.0.tar.gz
  • Upload date:
  • Size: 45.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for batutils-2.2.0.tar.gz
Algorithm Hash digest
SHA256 b0c449586309e78a27912c91977fad6d1b0bd0c8008bc7f61be7735911324e7a
MD5 ab8c54aab99ca8ceff24d4ed18fc3cc4
BLAKE2b-256 f8b2dde37c856497b9edd9e93e34c7d06b2758537209924568989e8e6fa2c8ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: batutils-2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 60.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for batutils-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6dc07fffca402e301535dd5e1376a5cd350cb07b6664f5ee3cb520678c70de21
MD5 4eea5dbe4abc757f0b69e6ff1bbb0bdb
BLAKE2b-256 86394edf17c7fb7a7747eaa03bffd837915aa094546e72004a5beb9137e8758d

See more details on using hashes here.

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