> ## Documentation Index
> Fetch the complete documentation index at: https://site.aspect.build/llms.txt
> Use this file to discover all available pages before exploring further.

# Python — Aspect Build Blog

> 3 Python posts from the Aspect Build engineering blog on Bazel and developer productivity.

export const BlogCard = ({title, description, date, authors, tags, image, href, children}) => {
  const tagList = tags ? tags.split(", ").filter(Boolean) : [];
  const tagSlug = t => t.toLowerCase().replace(/&/g, "").replace(/\+/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
  const formattedDate = date ? new Date(date + "T00:00:00").toLocaleDateString("en-US", {
    year: "numeric",
    month: "short",
    day: "numeric"
  }) : "";
  const resolvedImage = typeof image === "string" && image.trim() === "" ? null : image;
  return <div data-tags={tagList.join(",")} className="blog-card flex flex-col rounded-xl border border-zinc-200 dark:border-zinc-700 bg-white dark:bg-zinc-800 overflow-hidden hover:shadow-lg transition group">
      <a href={href} className="block">
        {resolvedImage ? typeof resolvedImage === "string" ? <img noZoom src={resolvedImage} alt={title} className="w-full" style={{
    height: "180px",
    objectFit: "cover"
  }} /> : <div className="blog-card-image">{resolvedImage}</div> : children ? <div className="blog-card-image">{children}</div> : null}
        <div className="px-5 pt-5">
          <h3 className="text-lg font-semibold text-zinc-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition">
            {title}
          </h3>
          {description && <p className="mt-2 text-sm text-zinc-600 dark:text-zinc-400 line-clamp-2">
              {description}
            </p>}
          <div className="flex items-center gap-2 mt-3 text-xs text-zinc-500 dark:text-zinc-400">
            {authors && <span>{authors}</span>}
            {authors && formattedDate && <span>·</span>}
            {formattedDate && <span>{formattedDate}</span>}
          </div>
        </div>
      </a>
      {tagList.length > 0 && <div className="flex flex-wrap gap-1.5 px-5 pb-4 pt-3 mt-auto">
          {tagList.map(tag => <a key={tag} href={"/blog/tags/" + tagSlug(tag)} className="px-2 py-0.5 rounded-full text-xs bg-zinc-100 dark:bg-zinc-800 text-zinc-600 dark:text-zinc-400 hover:bg-blue-100 dark:hover:bg-blue-900/40 hover:text-blue-700 dark:hover:text-blue-300 transition">
              {tag}
            </a>)}
        </div>}
    </div>;
};

export const MarketingPage = () => <div className="marketing-page-marker" style={{
  display: "none"
}} />;

export const Section = ({children, className = "", gray = false, dark = false, id}) => <section id={id} className={`w-full flex justify-center px-4 py-16 md:py-24 ${gray ? "bg-gray-50 dark:bg-zinc-900" : dark ? "bg-zinc-900 dark:bg-zinc-950" : ""} ${className}`}>
    <div className="w-full" style={{
  maxWidth: "1140px"
}}>
      {children}
    </div>
  </section>;

export const Hero = ({title, subtitle, badge, eyebrow, heroImageClassName = "", primaryCta, primaryHref = "#", secondaryCta, secondaryHref = "#", centered = true, children}) => <section className="w-full flex justify-center px-4 pt-16 pb-16 md:pt-24 md:pb-24" style={{
  background: "linear-gradient(180deg, var(--hero-gradient-start, #f8fafc) 0%, var(--hero-gradient-end, #ffffff) 100%)"
}}>
    <div className="w-full" style={{
  maxWidth: "1140px"
}}>
      {centered && !children ? <div className="flex flex-col items-center text-center">
          {badge && <div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-blue-50 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700 text-blue-700 dark:text-blue-300 text-sm font-medium mb-6">
              {badge}
            </div>}
          {eyebrow && <div className="text-xs font-semibold tracking-widest uppercase text-blue-600 dark:text-blue-400 mb-4">
              {eyebrow}
            </div>}
          <h1 className="text-4xl md:text-5xl font-semibold text-zinc-900 dark:text-white leading-tight tracking-tight" style={{
  maxWidth: "820px"
}}>
            {String(title).split(/\\n|\n/).map((line, i) => i ? [<br key={i} />, line] : line)}
          </h1>
          {subtitle && <div className="subtitle-gap text-lg md:text-xl text-zinc-500 dark:text-zinc-300 leading-relaxed" style={{
  marginTop: "1rem",
  maxWidth: "600px"
}}>
              {subtitle}
            </div>}
          <div className="flex flex-wrap gap-3 mt-10 justify-center">
            {primaryCta && <a href={primaryHref} className="inline-flex items-center px-6 py-3 rounded-lg bg-blue-600 text-white font-semibold hover:bg-blue-700 transition shadow-sm">
                {primaryCta}
              </a>}
            {secondaryCta && <a href={secondaryHref} className={`inline-flex items-center px-6 py-3 rounded-lg border border-zinc-300 dark:border-zinc-600 text-zinc-700 dark:text-zinc-200 font-semibold hover:bg-zinc-50 dark:hover:bg-zinc-800 transition ${secondaryHref === "/request-demo" ? "demo-gradient-btn" : ""}`}>
                {secondaryCta}
              </a>}
          </div>
        </div> : <div className="flex flex-col md:flex-row items-center gap-10 md:gap-16">
          <div className="flex-1 min-w-0">
            {badge && <div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-blue-50 dark:bg-blue-900/30 border border-blue-200 dark:border-blue-700 text-blue-700 dark:text-blue-300 text-sm font-medium mb-6">
                {badge}
              </div>}
            {eyebrow && <div className="text-xs font-semibold tracking-widest uppercase text-blue-600 dark:text-blue-400 mb-4">
                {eyebrow}
              </div>}
            <h1 className="text-4xl md:text-5xl font-semibold text-zinc-900 dark:text-white leading-tight tracking-tight">
            {String(title).split(/\\n|\n/).map((line, i) => i ? [<br key={i} />, line] : line)}
          </h1>
            {subtitle && <div className="subtitle-gap text-lg md:text-xl text-zinc-500 dark:text-zinc-300 leading-relaxed" style={{
  marginTop: "1rem"
}}>
                {subtitle}
              </div>}
            <div className="flex flex-wrap gap-3 mt-8">
              {primaryCta && <a href={primaryHref} className="inline-flex items-center px-6 py-3 rounded-lg bg-blue-600 text-white font-semibold hover:bg-blue-700 transition shadow-sm">
                  {primaryCta}
                </a>}
              {secondaryCta && <a href={secondaryHref} className={`inline-flex items-center px-6 py-3 rounded-lg border border-zinc-300 dark:border-zinc-600 text-zinc-700 dark:text-zinc-200 font-semibold hover:bg-zinc-50 dark:hover:bg-zinc-800 transition ${secondaryHref === "/request-demo" ? "demo-gradient-btn" : ""}`}>
                  {secondaryCta}
                </a>}
            </div>
          </div>
          {children && <div className={`flex-1 min-w-0 hero-image ${heroImageClassName}`}>
              {children}
            </div>}
        </div>}
    </div>
  </section>;

<MarketingPage />

<Hero title="Posts tagged Python" subtitle="Engineering writing from the Aspect team on Python." centered={true} />

<Section>
  <div className="mb-8">
    <a href="/blog" className="text-blue-600 dark:text-blue-400 font-semibold hover:underline">← All posts</a>
    <span className="mx-2 text-zinc-400">·</span>
    <a href="/blog/tags" className="text-blue-600 dark:text-blue-400 font-semibold hover:underline">Browse all tags</a>
  </div>

  <div className="marketing-grid-3">
    <BlogCard title="Fetching ML models under Bazel" description="Learn how to use Bazel to fetch and cache NLTK data hermetically, ensuring reproducible builds and reliable Python tests without network dependencies." date="2024-03-03" authors="Alex Eagle" href="/blog/fetching-ml-models-under-bazel" tags="Python, Bazel">
      <img noZoom src="https://mintcdn.com/aspectbuild/x1L7Iep716jCyJVo/images/blog/hashnode/hn-237621392e.jpeg?fit=max&auto=format&n=x1L7Iep716jCyJVo&q=85&s=905a79fb89e35750383eb1d02e2e5520" alt="" width="1254" height="836" data-path="images/blog/hashnode/hn-237621392e.jpeg" />
    </BlogCard>

    <BlogCard title="Python toolchains in rules_python" description="Bazel is supposed to be repeatable, right? Your teammate runs the tests on her computer and should get the same result as you did. A build from a commit last mo" date="2022-03-11" authors="Thulio Ferraz Assis" href="/blog/python-toolchains" tags="Python, Bazel">
      <img noZoom src="https://mintcdn.com/aspectbuild/x1L7Iep716jCyJVo/images/blog/hashnode/hn-2e33cf2afe.jpeg?fit=max&auto=format&n=x1L7Iep716jCyJVo&q=85&s=0562ad9f4fe4470a06be27feb022fbc0" alt="" width="1600" height="1200" data-path="images/blog/hashnode/hn-2e33cf2afe.jpeg" />
    </BlogCard>

    <BlogCard title="Many Python versions, one Bazel build" description="Manage multiple Python versions efficiently in a Bazel build for seamless migration and execution. Achieve this with custom scripts and toolchains" date="2022-01-31" authors="Matt Mackay" href="/blog/many-python-versions-one-bazel-build" tags="Python, Bazel">
      <img noZoom src="https://mintcdn.com/aspectbuild/x1L7Iep716jCyJVo/images/blog/hashnode/hn-ec381367a0.jpeg?fit=max&auto=format&n=x1L7Iep716jCyJVo&q=85&s=fb6af4acf0dd5f51c0952bfb9384228f" alt="" width="1600" height="900" data-path="images/blog/hashnode/hn-ec381367a0.jpeg" />
    </BlogCard>
  </div>
</Section>
