MCPcopy Create free account
hub / github.com/GitsSaikat/PyGen / create_zip

Function create_zip

app.py:435–446  ·  view source on GitHub ↗

Create a zip file from the package structure with a different but relevant name.

(package_structure: Dict[str, str], package_name: str)

Source from the content-addressed store, hash-verified

433 return valid
434
435def create_zip(package_structure: Dict[str, str], package_name: str) -> bytes:
436 """Create a zip file from the package structure with a different but relevant name."""
437 # Generate a different zip file name by appending '_package' and current timestamp
438 timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
439 zip_filename = f"{package_name}_package_{timestamp}.zip"
440
441 zip_buffer = io.BytesIO()
442 with zipfile.ZipFile(zip_buffer, 'w', zipfile.ZIP_DEFLATED) as zipf:
443 for file_path, content in package_structure.items():
444 zipf.writestr(file_path, content)
445 zip_buffer.seek(0)
446 return zip_buffer.getvalue()
447
448def generate_markdown_documentation(client: Groq, model_name: str, package_structure: Dict[str, str], package_name: str, max_retries: int = 5) -> Optional[str]:
449 """

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected