Skip to main content

spice_rack

A collection of building blocks for doing standard things that I use in other projects. A lot of this is just personal preference, and serves merely to prevent me from rewriting common pieces of functionality.

Fully typed and heavily reliant on pydantic v2.

Some of the subpackages

See their individual docs for more info.

bases

Extensions on pydantic's BaseModel for common use-cases such as an immutable class, or a class that is meant to be dispatched, so we can easily build polymorphic families of classes and hook into pydantic's validation framework.

Also contains a base class extending the stdlib str class that hooks into pydantic's validation framework. Helpful or improving type annotations and ensuring things like keys have standardized formatting.

fs_ops

File and directory objects that aim to abstract away the underlying file-system, which means you can do the same stuff with a FilePath instance regardless of if the path is on s3, gcs or local. Some other stuff there too regarding deferred file paths which means you can set a path as relative to an environment variable and evaluate it to a real FilePath or DirPath at some point in your control flow. Right now we only support local, gcs, and sftp, but s3 soon.

logging

Wrapper around loguru with some opinionated formatting. There are pydantic models for configuring the sinks, and custom logger class that does some formatting for you and helps with structured data.

polars service

Polars DataFrame and LazyFrame type annotations meant to integrate with pydantic's validation system, meaning I can set them as attributes on pydantic models without pydantic seeing them as 'arbitrary types'

ts service

Simplifies date-related functionality. The primary class is a subclass of int that represents epoch milliseconds. Main concept is to help with common gotchas and annoyances with dates, but this is a tough area. Likely not that useful at the moment.

gcp_auth

Helps with indicating the credentials for different gcp services. There's a lot of different ways to authenticate to GCP, and they are very helpful in getting creds from the environment, but this can make it even more confusing. I use to be declarative in how I'm authenticating and which creds I am using, without losing the convenience of Google's helpers.

Installation

pip install spice_rack[all] there are no optional/extra dependencies, so pip install spice_rack[all] is the same pip install spice_rack at the moment

Links

Docs

PyPI

GitHub

Metadata

Release files for spice-rack 0.15.5

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

Source distribution (sdist)

Source distribution for spice-rack 0.15.5
File Size Uploaded
spice_rack-0.15.5.tar.gz 64.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spice-rack 0.15.5
File Interpreter ABI Platform
spice_rack-0.15.5-py3-none-any.whl Python 3 none any Details

Total release size: 170.4 kB

Release files / spice_rack-0.15.5.tar.gz

Download URL spice_rack-0.15.5.tar.gz
Size 64.0 kB
Tags Source
SHA-256 checksum
How to use checksums
db9b6151aedf22deeac21f609d44394c6d0c22cac5f8c8d1b879160bd0d73057
BLAKE2b-256 checksum
How to use checksums
0178aec1613db3ac924868244bf4927385c235ce93720f641e3d08b32d995996
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / spice_rack-0.15.5-py3-none-any.whl

Download URL spice_rack-0.15.5-py3-none-any.whl
Size 106.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74c22b9f6ccbc02ca366596ec6bf2dd9c1af7e370dab1a99a2b9ebf3dbfc8605
BLAKE2b-256 checksum
How to use checksums
bf42582632764984075e7288301b20c6b2e43afa2dc920fae4898cccf050ae27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.15.5 This release

2 release files

0.15.4

2 release files

0.15.3

2 release files

0.15.2

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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