MCPcopy
hub / github.com/qazbnm456/awesome-web-security / entry_id

Function entry_id

scripts/migrate.py:454–462  ·  view source on GitHub ↗
(category: str, title: str, used: set[str])

Source from the content-addressed store, hash-verified

452
453
454def entry_id(category: str, title: str, used: set[str]) -> str:
455 base = f"{category}-{slugify(title, max_len=50)}"
456 candidate = base
457 n = 1
458 while candidate in used:
459 n += 1
460 candidate = f"{base}-{n}"
461 used.add(candidate)
462 return candidate
463
464
465def write_categories(sections: list[Section]) -> None:

Callers 1

write_entriesFunction · 0.85

Calls 1

slugifyFunction · 0.70

Tested by

no test coverage detected