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.0.0.tar.gz (44.5 kB view details)

Uploaded Source

Built Distribution

batutils-2.0.0-py3-none-any.whl (59.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: batutils-2.0.0.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for batutils-2.0.0.tar.gz
Algorithm Hash digest
SHA256 4d48fe13be1d71408351ee85ae9490798abf4ce07b7d74ba7f9e24777af7f7f4
MD5 092fb24072ae36098c9ef962d821e952
BLAKE2b-256 b6783ddfbd8f27d395b1be6671b0c85419a01ffb71488045f957528b7846df36

See more details on using hashes here.

File details

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

File metadata

  • Download URL: batutils-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 59.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for batutils-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8862efaecf11a873785263ca891ebde1ce5fe99d38a2f69048235967f39d1b29
MD5 e2d4eb5febc6e1658b42654225b2a195
BLAKE2b-256 9752261435fb779421331775234406e9293d41f1286dbf881d78cf24f7d5b3d9

See more details on using hashes here.

Supported by

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