Skip to main content

group of common things we use across different python packages

Reason this release was yanked:

import error

Project description

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

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

spice_rack-0.8.0.tar.gz (58.4 kB view details)

Uploaded Source

Built Distribution

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

spice_rack-0.8.0-py3-none-any.whl (96.4 kB view details)

Uploaded Python 3

File details

Details for the file spice_rack-0.8.0.tar.gz.

File metadata

  • Download URL: spice_rack-0.8.0.tar.gz
  • Upload date:
  • Size: 58.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for spice_rack-0.8.0.tar.gz
Algorithm Hash digest
SHA256 2b55a93c2546a4651fa768d3ba5aac66c75390cbe25714fc9b0d75086094557b
MD5 aa1311d8c139b5c73e4ecf6465fb9936
BLAKE2b-256 ca63ccbd8063d226bb6e1990bd3f7535eb70fb6cafcc4a774ef410ab56b6c645

See more details on using hashes here.

File details

Details for the file spice_rack-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: spice_rack-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 96.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for spice_rack-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 428b0ee59a3559ba84a3909e03504e3e049ec2dde69fc8a31f80a88b126c3f3a
MD5 2f56f0e66b9b52ce3cc47edfe5d13976
BLAKE2b-256 247e69ca2e7b34ca5b14fd1206f7551f397c519ae5df872cf2963fce655aff8a

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