Add Bambu Lab PLA Pure starter catalog

This commit is contained in:
Mikei386 committed 2026-11-14 16:29:21 +01:00
1 parent e2ad117685
commit f354eee799
4 files changed
+63 -3

No files matched your search

+3
View File
@@ -320,6 +320,9 @@ und [PETG Matte](https://eu.store.bambulab.com/products/petg-matte) auch in best
Datenbanken. Die 42 zusätzlichen Varianten umfassen 21 Farben mit Spule und als Refill
inklusive Artikelnummern, Herstellerfarbwerten und Produktbildern.
[PLA Pure](https://eu.store.bambulab.com/products/pla-pure) wird ebenfalls einmalig
ergänzt. Der Datenstand umfasst fünf Farben à 1 kg, jeweils auf Spule und als Refill.
Der [deutsche SUNLU-Shop](https://de.store.sunlu.com/collections/3d-drucker-filament) liefert
einen zweiten Startkatalog mit 67 Produkt-/Gewichtsausführungen und 561 Varianten aus dem
öffentlichen Shopfeed vom 14. November 2026. Er enthält Spulen, Refill und größere
+21
View File
@@ -0,0 +1,21 @@
"""EU product variants and official color values, verified on 14 November 2026.
https://eu.store.bambulab.com/products/pla-pure
https://store.bblcdn.com/s7/default/cb680ec8a366477b9379e2fe1eba98e9/Bambu_PLA_Pure_Hex_Code.pdf
"""
PLA_PURE_COLORS = (
("Pure White", "17100", "#FFFFFF", "43cbb61e5120432e8311a1a05974b4cf/2.jpg"),
("Absolute Black", "17101", "#000000", "b00b40bfed7e4c1ea26ab7c1192128b9/3.jpg"),
("Milky Pink", "17200", "#F7CED7", "ddad17bc01ba4519965ad3d8ada7fa42/PLA_purePLA_pure.jpg"),
("Apricot", "17300", "#FFB673", "e3f9cebb092c4b499cec94c6a0a9b680/5.jpg"),
("Baby Blue", "17600", "#A4DBE8", "7e34180e4a2e4b3c9951e40b459e7838/4.jpg"),
)
BAMBU_PLA_PURE_CATALOG = {
"PLA Pure": tuple(
(color, spool_type, code, 1000, swatch, f"https://store.bblcdn.eu/s8/default/{image}")
for color, code, swatch, image in PLA_PURE_COLORS
for spool_type in ("spool", "refill")
),
}
@@ -7,6 +7,7 @@ from filament.anycubic_catalog import ANYCUBIC_CATALOG
from filament.bambu_catalog import BAMBU_LAB_CATALOG, BAMBU_LAB_VARIANT_COUNT
from filament.bambu_images_0006 import bambu_image_url
from filament.bambu_petg_catalog import BAMBU_PETG_CATALOG
from filament.bambu_pla_pure_catalog import BAMBU_PLA_PURE_CATALOG
from filament.bambu_swatches_0005 import BAMBU_SWATCHES
from filament.esun_catalog import ESUN_CATALOG
from filament.jayo_catalog import JAYO_CATALOG
@@ -15,6 +16,7 @@ from filament.sunlu_catalog import SUNLU_CATALOG, SUNLU_IMAGE_BASE
BAMBU_LAB_BOOTSTRAP_KEY = "bambu-lab-eu-initial-catalog"
BAMBU_PETG_BOOTSTRAP_KEY = "bambu-lab-eu-petg-basic-matte"
BAMBU_PLA_PURE_BOOTSTRAP_KEY = "bambu-lab-eu-pla-pure"
SUNLU_BOOTSTRAP_KEY = "sunlu-de-initial-catalog"
ESUN_BOOTSTRAP_KEY = "esun-eu-initial-catalog"
JAYO_BOOTSTRAP_KEY = "jayo-eu-initial-catalog"
@@ -29,6 +31,9 @@ class Command(BaseCommand):
self.seed_catalog(
options["verbosity"], BAMBU_PETG_BOOTSTRAP_KEY, "Bambu Lab", BAMBU_PETG_CATALOG
)
self.seed_catalog(
options["verbosity"], BAMBU_PLA_PURE_BOOTSTRAP_KEY, "Bambu Lab", BAMBU_PLA_PURE_CATALOG
)
self.seed_catalog(
options["verbosity"], SUNLU_BOOTSTRAP_KEY, "SUNLU", SUNLU_CATALOG, sunlu_image_url
)
+34 -3
View File
@@ -6,6 +6,7 @@ from filament.management.commands.seed_catalog import (
ANYCUBIC_BOOTSTRAP_KEY,
BAMBU_LAB_BOOTSTRAP_KEY,
BAMBU_PETG_BOOTSTRAP_KEY,
BAMBU_PLA_PURE_BOOTSTRAP_KEY,
ESUN_BOOTSTRAP_KEY,
JAYO_BOOTSTRAP_KEY,
SUNLU_BOOTSTRAP_KEY,
@@ -246,10 +247,10 @@ class CatalogTests(CatalogTestCase):
call_command("seed_catalog", verbosity=0)
self.assertEqual(
ProductType.objects.filter(manufacturer__name="Bambu Lab").count(),
BAMBU_LAB_PRODUCT_COUNT + 2,
BAMBU_LAB_PRODUCT_COUNT + 3,
)
bambu_variants = Variant.objects.filter(product_type__manufacturer__name="Bambu Lab")
self.assertEqual(bambu_variants.count(), BAMBU_LAB_VARIANT_COUNT + 42)
self.assertEqual(bambu_variants.count(), BAMBU_LAB_VARIANT_COUNT + 52)
self.assertFalse(
bambu_variants.exclude(pk__in=(self.spool.pk, self.refill.pk, self.black_spool.pk))
.filter(image_url="")
@@ -322,7 +323,7 @@ class CatalogTests(CatalogTestCase):
self.assertEqual(ProductType.objects.filter(manufacturer=sunlu).count(), 67)
self.assertEqual(
Variant.objects.filter(product_type__manufacturer=self.maker)
.exclude(product_type__name__in=("PETG Basic", "PETG Matte"))
.exclude(product_type__name__in=("PETG Basic", "PETG Matte", "PLA Pure"))
.count(),
3,
)
@@ -434,12 +435,42 @@ class CatalogTests(CatalogTestCase):
call_command("seed_catalog", verbosity=0)
self.assertFalse(variants.filter(manufacturer_color_code="30106").exists())
def test_bambu_pla_pure_imports_once_into_an_existing_catalog(self):
CatalogBootstrap.objects.bulk_create(
CatalogBootstrap(key=key)
for key in (
BAMBU_LAB_BOOTSTRAP_KEY,
BAMBU_PETG_BOOTSTRAP_KEY,
SUNLU_BOOTSTRAP_KEY,
ESUN_BOOTSTRAP_KEY,
JAYO_BOOTSTRAP_KEY,
ANYCUBIC_BOOTSTRAP_KEY,
)
)
call_command("seed_catalog", verbosity=0)
variants = Variant.objects.filter(
product_type__manufacturer=self.maker, product_type__name="PLA Pure"
)
self.assertTrue(CatalogBootstrap.objects.filter(key=BAMBU_PLA_PURE_BOOTSTRAP_KEY).exists())
self.assertEqual(variants.count(), 10)
white = variants.filter(manufacturer_color_code="17100", color__name="Pure White")
self.assertEqual(set(white.values_list("spool_type", flat=True)), {"spool", "refill"})
spool = white.get(spool_type="spool")
self.assertEqual(spool.swatch, "#FFFFFF")
self.assertEqual(spool.net_weight_g, 1000)
self.assertTrue(spool.image_url.startswith("https://store.bblcdn.eu/"))
self.assertEqual(spool.product_type.material_and_subtype, ("PLA", "Pure"))
spool.delete()
call_command("seed_catalog", verbosity=0)
self.assertEqual(variants.count(), 9)
def test_jayo_and_anycubic_import_once_for_existing_installations(self):
CatalogBootstrap.objects.bulk_create(
CatalogBootstrap(key=key)
for key in (
BAMBU_LAB_BOOTSTRAP_KEY,
BAMBU_PETG_BOOTSTRAP_KEY,
BAMBU_PLA_PURE_BOOTSTRAP_KEY,
SUNLU_BOOTSTRAP_KEY,
ESUN_BOOTSTRAP_KEY,
)