bps-kit 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/.agents/agents/backend-specialist.md +263 -0
- package/templates/.agents/agents/code-archaeologist.md +106 -0
- package/templates/.agents/agents/database-architect.md +226 -0
- package/templates/.agents/agents/debugger.md +225 -0
- package/templates/.agents/agents/devops-engineer.md +242 -0
- package/templates/.agents/agents/documentation-writer.md +104 -0
- package/templates/.agents/agents/explorer-agent.md +73 -0
- package/templates/.agents/agents/frontend-specialist.md +593 -0
- package/templates/.agents/agents/game-developer.md +162 -0
- package/templates/.agents/agents/mobile-developer.md +377 -0
- package/templates/.agents/agents/orchestrator.md +416 -0
- package/templates/.agents/agents/penetration-tester.md +188 -0
- package/templates/.agents/agents/performance-optimizer.md +187 -0
- package/templates/.agents/agents/product-manager.md +112 -0
- package/templates/.agents/agents/product-owner.md +95 -0
- package/templates/.agents/agents/project-planner.md +406 -0
- package/templates/.agents/agents/qa-automation-engineer.md +103 -0
- package/templates/.agents/agents/security-auditor.md +170 -0
- package/templates/.agents/agents/seo-specialist.md +111 -0
- package/templates/.agents/agents/test-engineer.md +158 -0
- package/templates/.agents/rules/GEMINI.md +219 -0
- package/templates/.agents/scripts/auto_preview.py +148 -0
- package/templates/.agents/scripts/checklist.py +217 -0
- package/templates/.agents/scripts/session_manager.py +120 -0
- package/templates/.agents/scripts/verify_all.py +327 -0
- package/templates/.agents/workflows/brainstorm.md +113 -0
- package/templates/.agents/workflows/create.md +59 -0
- package/templates/.agents/workflows/debug.md +103 -0
- package/templates/.agents/workflows/deploy.md +176 -0
- package/templates/.agents/workflows/enhance.md +63 -0
- package/templates/.agents/workflows/orchestrate.md +237 -0
- package/templates/.agents/workflows/plan.md +89 -0
- package/templates/.agents/workflows/preview.md +81 -0
- package/templates/.agents/workflows/setup-brain.md +39 -0
- package/templates/.agents/workflows/status.md +86 -0
- package/templates/.agents/workflows/test.md +144 -0
- package/templates/.agents/workflows/ui-ux-pro-max.md +296 -0
- package/templates/skills_normal/api-patterns/scripts/api_validator.py +211 -0
- package/templates/skills_normal/database-design/scripts/schema_validator.py +172 -0
- package/templates/skills_normal/frontend-design/scripts/accessibility_checker.py +183 -0
- package/templates/skills_normal/frontend-design/scripts/ux_audit.py +722 -0
- package/templates/skills_normal/git-pushing/scripts/smart_commit.sh +19 -0
- package/templates/skills_normal/lint-and-validate/scripts/lint_runner.py +184 -0
- package/templates/skills_normal/lint-and-validate/scripts/type_coverage.py +173 -0
- package/templates/skills_normal/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/templates/skills_normal/senior-fullstack/scripts/code_quality_analyzer.py +114 -0
- package/templates/skills_normal/senior-fullstack/scripts/fullstack_scaffolder.py +114 -0
- package/templates/skills_normal/senior-fullstack/scripts/project_scaffolder.py +114 -0
- package/templates/skills_normal/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/templates/skills_normal/testing-patterns/scripts/test_runner.py +219 -0
- package/templates/skills_normal/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/templates/vault/007/scripts/config.py +472 -0
- package/templates/vault/007/scripts/full_audit.py +1306 -0
- package/templates/vault/007/scripts/quick_scan.py +481 -0
- package/templates/vault/007/scripts/requirements.txt +26 -0
- package/templates/vault/007/scripts/scanners/__init__.py +0 -0
- package/templates/vault/007/scripts/scanners/dependency_scanner.py +1305 -0
- package/templates/vault/007/scripts/scanners/injection_scanner.py +1104 -0
- package/templates/vault/007/scripts/scanners/secrets_scanner.py +1008 -0
- package/templates/vault/007/scripts/score_calculator.py +693 -0
- package/templates/vault/agent-orchestrator/scripts/match_skills.py +329 -0
- package/templates/vault/agent-orchestrator/scripts/orchestrate.py +304 -0
- package/templates/vault/agent-orchestrator/scripts/requirements.txt +1 -0
- package/templates/vault/agent-orchestrator/scripts/scan_registry.py +508 -0
- package/templates/vault/ai-studio-image/scripts/config.py +613 -0
- package/templates/vault/ai-studio-image/scripts/generate.py +630 -0
- package/templates/vault/ai-studio-image/scripts/prompt_engine.py +424 -0
- package/templates/vault/ai-studio-image/scripts/requirements.txt +4 -0
- package/templates/vault/ai-studio-image/scripts/templates.py +349 -0
- package/templates/vault/android_ui_verification/scripts/verify_ui.sh +32 -0
- package/templates/vault/apify-audience-analysis/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-brand-reputation-monitoring/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-competitor-intelligence/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-content-analytics/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-ecommerce/reference/scripts/package.json +3 -0
- package/templates/vault/apify-ecommerce/reference/scripts/run_actor.js +369 -0
- package/templates/vault/apify-influencer-discovery/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-lead-generation/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-market-research/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-trend-analysis/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-ultimate-scraper/reference/scripts/run_actor.js +363 -0
- package/templates/vault/audio-transcriber/scripts/install-requirements.sh +190 -0
- package/templates/vault/audio-transcriber/scripts/transcribe.py +486 -0
- package/templates/vault/claude-monitor/scripts/api_bench.py +240 -0
- package/templates/vault/claude-monitor/scripts/config.py +69 -0
- package/templates/vault/claude-monitor/scripts/health_check.py +362 -0
- package/templates/vault/claude-monitor/scripts/monitor.py +296 -0
- package/templates/vault/content-creator/scripts/brand_voice_analyzer.py +185 -0
- package/templates/vault/content-creator/scripts/seo_optimizer.py +419 -0
- package/templates/vault/context-agent/scripts/active_context.py +227 -0
- package/templates/vault/context-agent/scripts/compressor.py +149 -0
- package/templates/vault/context-agent/scripts/config.py +69 -0
- package/templates/vault/context-agent/scripts/context_loader.py +155 -0
- package/templates/vault/context-agent/scripts/context_manager.py +302 -0
- package/templates/vault/context-agent/scripts/models.py +103 -0
- package/templates/vault/context-agent/scripts/project_registry.py +132 -0
- package/templates/vault/context-agent/scripts/requirements.txt +6 -0
- package/templates/vault/context-agent/scripts/search.py +115 -0
- package/templates/vault/context-agent/scripts/session_parser.py +206 -0
- package/templates/vault/context-agent/scripts/session_summary.py +319 -0
- package/templates/vault/context-guardian/scripts/context_snapshot.py +229 -0
- package/templates/vault/docx/ooxml/scripts/pack.py +159 -0
- package/templates/vault/docx/ooxml/scripts/unpack.py +29 -0
- package/templates/vault/docx/ooxml/scripts/validate.py +69 -0
- package/templates/vault/docx/ooxml/scripts/validation/__init__.py +15 -0
- package/templates/vault/docx/ooxml/scripts/validation/base.py +951 -0
- package/templates/vault/docx/ooxml/scripts/validation/docx.py +274 -0
- package/templates/vault/docx/ooxml/scripts/validation/pptx.py +315 -0
- package/templates/vault/docx/ooxml/scripts/validation/redlining.py +279 -0
- package/templates/vault/docx/scripts/__init__.py +1 -0
- package/templates/vault/docx/scripts/document.py +1276 -0
- package/templates/vault/docx/scripts/templates/comments.xml +3 -0
- package/templates/vault/docx/scripts/templates/commentsExtended.xml +3 -0
- package/templates/vault/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/templates/vault/docx/scripts/templates/commentsIds.xml +3 -0
- package/templates/vault/docx/scripts/templates/people.xml +3 -0
- package/templates/vault/docx/scripts/utilities.py +374 -0
- package/templates/vault/docx-official/ooxml/scripts/pack.py +159 -0
- package/templates/vault/docx-official/ooxml/scripts/unpack.py +29 -0
- package/templates/vault/docx-official/ooxml/scripts/validate.py +69 -0
- package/templates/vault/docx-official/ooxml/scripts/validation/__init__.py +15 -0
- package/templates/vault/docx-official/ooxml/scripts/validation/base.py +951 -0
- package/templates/vault/docx-official/ooxml/scripts/validation/docx.py +274 -0
- package/templates/vault/docx-official/ooxml/scripts/validation/pptx.py +315 -0
- package/templates/vault/docx-official/ooxml/scripts/validation/redlining.py +279 -0
- package/templates/vault/docx-official/scripts/__init__.py +1 -0
- package/templates/vault/docx-official/scripts/document.py +1276 -0
- package/templates/vault/docx-official/scripts/templates/comments.xml +3 -0
- package/templates/vault/docx-official/scripts/templates/commentsExtended.xml +3 -0
- package/templates/vault/docx-official/scripts/templates/commentsExtensible.xml +3 -0
- package/templates/vault/docx-official/scripts/templates/commentsIds.xml +3 -0
- package/templates/vault/docx-official/scripts/templates/people.xml +3 -0
- package/templates/vault/docx-official/scripts/utilities.py +374 -0
- package/templates/vault/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/templates/vault/helm-chart-scaffolding/scripts/validate-chart.sh +244 -0
- package/templates/vault/i18n-localization/scripts/i18n_checker.py +241 -0
- package/templates/vault/instagram/scripts/account_setup.py +233 -0
- package/templates/vault/instagram/scripts/analyze.py +221 -0
- package/templates/vault/instagram/scripts/api_client.py +444 -0
- package/templates/vault/instagram/scripts/auth.py +411 -0
- package/templates/vault/instagram/scripts/comments.py +160 -0
- package/templates/vault/instagram/scripts/config.py +111 -0
- package/templates/vault/instagram/scripts/db.py +467 -0
- package/templates/vault/instagram/scripts/export.py +138 -0
- package/templates/vault/instagram/scripts/governance.py +233 -0
- package/templates/vault/instagram/scripts/hashtags.py +114 -0
- package/templates/vault/instagram/scripts/insights.py +170 -0
- package/templates/vault/instagram/scripts/media.py +65 -0
- package/templates/vault/instagram/scripts/messages.py +103 -0
- package/templates/vault/instagram/scripts/profile.py +58 -0
- package/templates/vault/instagram/scripts/publish.py +449 -0
- package/templates/vault/instagram/scripts/requirements.txt +5 -0
- package/templates/vault/instagram/scripts/run_all.py +189 -0
- package/templates/vault/instagram/scripts/schedule.py +189 -0
- package/templates/vault/instagram/scripts/serve_api.py +234 -0
- package/templates/vault/instagram/scripts/templates.py +155 -0
- package/templates/vault/junta-leiloeiros/scripts/db.py +216 -0
- package/templates/vault/junta-leiloeiros/scripts/export.py +137 -0
- package/templates/vault/junta-leiloeiros/scripts/requirements.txt +15 -0
- package/templates/vault/junta-leiloeiros/scripts/run_all.py +190 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/__init__.py +4 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/base_scraper.py +209 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/generic_scraper.py +110 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucap.py +110 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/juceac.py +72 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/juceal.py +72 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/juceb.py +68 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucec.py +63 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucema.py +211 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucemg.py +218 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucep.py +70 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucepa.py +74 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucepar.py +80 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucepe.py +78 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucepi.py +69 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucer.py +256 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucerja.py +170 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucern.py +71 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucesc.py +89 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucesp.py +233 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucetins.py +134 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucis_df.py +63 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucisrs.py +299 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/states.py +99 -0
- package/templates/vault/junta-leiloeiros/scripts/serve_api.py +164 -0
- package/templates/vault/junta-leiloeiros/scripts/web_scraper_fallback.py +233 -0
- package/templates/vault/last30days/scripts/last30days.py +521 -0
- package/templates/vault/last30days/scripts/lib/__init__.py +1 -0
- package/templates/vault/last30days/scripts/lib/cache.py +152 -0
- package/templates/vault/last30days/scripts/lib/dates.py +124 -0
- package/templates/vault/last30days/scripts/lib/dedupe.py +120 -0
- package/templates/vault/last30days/scripts/lib/env.py +149 -0
- package/templates/vault/last30days/scripts/lib/http.py +152 -0
- package/templates/vault/last30days/scripts/lib/models.py +175 -0
- package/templates/vault/last30days/scripts/lib/normalize.py +160 -0
- package/templates/vault/last30days/scripts/lib/openai_reddit.py +230 -0
- package/templates/vault/last30days/scripts/lib/reddit_enrich.py +232 -0
- package/templates/vault/last30days/scripts/lib/render.py +383 -0
- package/templates/vault/last30days/scripts/lib/schema.py +336 -0
- package/templates/vault/last30days/scripts/lib/score.py +311 -0
- package/templates/vault/last30days/scripts/lib/ui.py +324 -0
- package/templates/vault/last30days/scripts/lib/websearch.py +401 -0
- package/templates/vault/last30days/scripts/lib/xai_x.py +217 -0
- package/templates/vault/leiloeiro-avaliacao/scripts/governance.py +106 -0
- package/templates/vault/leiloeiro-avaliacao/scripts/requirements.txt +1 -0
- package/templates/vault/leiloeiro-edital/scripts/governance.py +106 -0
- package/templates/vault/leiloeiro-edital/scripts/requirements.txt +1 -0
- package/templates/vault/leiloeiro-ia/scripts/governance.py +106 -0
- package/templates/vault/leiloeiro-ia/scripts/requirements.txt +1 -0
- package/templates/vault/leiloeiro-juridico/scripts/governance.py +106 -0
- package/templates/vault/leiloeiro-juridico/scripts/requirements.txt +1 -0
- package/templates/vault/leiloeiro-mercado/scripts/governance.py +106 -0
- package/templates/vault/leiloeiro-mercado/scripts/requirements.txt +1 -0
- package/templates/vault/leiloeiro-risco/scripts/governance.py +106 -0
- package/templates/vault/leiloeiro-risco/scripts/requirements.txt +1 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/db/database.ts +24 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/db/db.ts +35 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/db/index.ts +2 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/db/migrations.ts +31 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/db/schema.sql +8 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/index.ts +44 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/routes/todos.ts +155 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/types/index.ts +35 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/App.css +384 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/App.tsx +81 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/api/todos.ts +57 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/components/ConfirmDialog.tsx +26 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/components/EmptyState.tsx +8 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/components/TodoForm.tsx +43 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/components/TodoItem.tsx +36 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/components/TodoList.tsx +27 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/hooks/useTodos.ts +81 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/index.css +48 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/main.tsx +10 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/vite-env.d.ts +1 -0
- package/templates/vault/loki-mode/scripts/export-to-vibe-kanban.sh +178 -0
- package/templates/vault/loki-mode/scripts/loki-wrapper.sh +281 -0
- package/templates/vault/loki-mode/scripts/take-screenshots.js +55 -0
- package/templates/vault/matematico-tao/scripts/complexity_analyzer.py +544 -0
- package/templates/vault/matematico-tao/scripts/dependency_graph.py +538 -0
- package/templates/vault/mcp-builder/scripts/connections.py +151 -0
- package/templates/vault/mcp-builder/scripts/evaluation.py +373 -0
- package/templates/vault/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/templates/vault/mcp-builder/scripts/requirements.txt +2 -0
- package/templates/vault/mobile-design/scripts/mobile_audit.py +670 -0
- package/templates/vault/notebooklm/scripts/__init__.py +81 -0
- package/templates/vault/notebooklm/scripts/ask_question.py +256 -0
- package/templates/vault/notebooklm/scripts/auth_manager.py +358 -0
- package/templates/vault/notebooklm/scripts/browser_session.py +255 -0
- package/templates/vault/notebooklm/scripts/browser_utils.py +107 -0
- package/templates/vault/notebooklm/scripts/cleanup_manager.py +302 -0
- package/templates/vault/notebooklm/scripts/config.py +44 -0
- package/templates/vault/notebooklm/scripts/notebook_manager.py +410 -0
- package/templates/vault/notebooklm/scripts/run.py +102 -0
- package/templates/vault/notebooklm/scripts/setup_environment.py +204 -0
- package/templates/vault/pdf/scripts/check_bounding_boxes.py +70 -0
- package/templates/vault/pdf/scripts/check_bounding_boxes_test.py +226 -0
- package/templates/vault/pdf/scripts/check_fillable_fields.py +12 -0
- package/templates/vault/pdf/scripts/convert_pdf_to_images.py +35 -0
- package/templates/vault/pdf/scripts/create_validation_image.py +41 -0
- package/templates/vault/pdf/scripts/extract_form_field_info.py +152 -0
- package/templates/vault/pdf/scripts/fill_fillable_fields.py +114 -0
- package/templates/vault/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/templates/vault/pdf-official/scripts/check_bounding_boxes.py +70 -0
- package/templates/vault/pdf-official/scripts/check_bounding_boxes_test.py +226 -0
- package/templates/vault/pdf-official/scripts/check_fillable_fields.py +12 -0
- package/templates/vault/pdf-official/scripts/convert_pdf_to_images.py +35 -0
- package/templates/vault/pdf-official/scripts/create_validation_image.py +41 -0
- package/templates/vault/pdf-official/scripts/extract_form_field_info.py +152 -0
- package/templates/vault/pdf-official/scripts/fill_fillable_fields.py +114 -0
- package/templates/vault/pdf-official/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/templates/vault/planning-with-files/scripts/check-complete.sh +44 -0
- package/templates/vault/planning-with-files/scripts/init-session.sh +120 -0
- package/templates/vault/pptx/ooxml/scripts/pack.py +159 -0
- package/templates/vault/pptx/ooxml/scripts/unpack.py +29 -0
- package/templates/vault/pptx/ooxml/scripts/validate.py +69 -0
- package/templates/vault/pptx/ooxml/scripts/validation/__init__.py +15 -0
- package/templates/vault/pptx/ooxml/scripts/validation/base.py +951 -0
- package/templates/vault/pptx/ooxml/scripts/validation/docx.py +274 -0
- package/templates/vault/pptx/ooxml/scripts/validation/pptx.py +315 -0
- package/templates/vault/pptx/ooxml/scripts/validation/redlining.py +279 -0
- package/templates/vault/pptx/scripts/html2pptx.js +979 -0
- package/templates/vault/pptx/scripts/inventory.py +1020 -0
- package/templates/vault/pptx/scripts/rearrange.py +231 -0
- package/templates/vault/pptx/scripts/replace.py +385 -0
- package/templates/vault/pptx/scripts/thumbnail.py +450 -0
- package/templates/vault/pptx-official/ooxml/scripts/pack.py +159 -0
- package/templates/vault/pptx-official/ooxml/scripts/unpack.py +29 -0
- package/templates/vault/pptx-official/ooxml/scripts/validate.py +69 -0
- package/templates/vault/pptx-official/ooxml/scripts/validation/__init__.py +15 -0
- package/templates/vault/pptx-official/ooxml/scripts/validation/base.py +951 -0
- package/templates/vault/pptx-official/ooxml/scripts/validation/docx.py +274 -0
- package/templates/vault/pptx-official/ooxml/scripts/validation/pptx.py +315 -0
- package/templates/vault/pptx-official/ooxml/scripts/validation/redlining.py +279 -0
- package/templates/vault/pptx-official/scripts/html2pptx.js +979 -0
- package/templates/vault/pptx-official/scripts/inventory.py +1020 -0
- package/templates/vault/pptx-official/scripts/rearrange.py +231 -0
- package/templates/vault/pptx-official/scripts/replace.py +385 -0
- package/templates/vault/pptx-official/scripts/thumbnail.py +450 -0
- package/templates/vault/product-manager-toolkit/scripts/customer_interview_analyzer.py +441 -0
- package/templates/vault/product-manager-toolkit/scripts/rice_prioritizer.py +296 -0
- package/templates/vault/prompt-engineering-patterns/scripts/optimize-prompt.py +279 -0
- package/templates/vault/scripts/.skill_cache.json +7538 -0
- package/templates/vault/scripts/skill_search.py +228 -0
- package/templates/vault/senior-architect/scripts/architecture_diagram_generator.py +114 -0
- package/templates/vault/senior-architect/scripts/dependency_analyzer.py +114 -0
- package/templates/vault/senior-architect/scripts/project_architect.py +114 -0
- package/templates/vault/shopify-development/scripts/requirements.txt +19 -0
- package/templates/vault/shopify-development/scripts/shopify_graphql.py +428 -0
- package/templates/vault/shopify-development/scripts/shopify_init.py +441 -0
- package/templates/vault/shopify-development/scripts/tests/test_shopify_init.py +379 -0
- package/templates/vault/skill-creator/scripts/init_skill.py +303 -0
- package/templates/vault/skill-creator/scripts/package_skill.py +110 -0
- package/templates/vault/skill-creator/scripts/quick_validate.py +95 -0
- package/templates/vault/skill-installer/scripts/detect_skills.py +318 -0
- package/templates/vault/skill-installer/scripts/install_skill.py +1708 -0
- package/templates/vault/skill-installer/scripts/package_skill.py +417 -0
- package/templates/vault/skill-installer/scripts/requirements.txt +1 -0
- package/templates/vault/skill-installer/scripts/validate_skill.py +430 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/__init__.py +13 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/code_quality.py +247 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/cross_skill.py +134 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/dependencies.py +121 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/documentation.py +189 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/governance_audit.py +153 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/performance.py +164 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/security.py +189 -0
- package/templates/vault/skill-sentinel/scripts/config.py +158 -0
- package/templates/vault/skill-sentinel/scripts/cost_optimizer.py +146 -0
- package/templates/vault/skill-sentinel/scripts/db.py +354 -0
- package/templates/vault/skill-sentinel/scripts/governance.py +58 -0
- package/templates/vault/skill-sentinel/scripts/recommender.py +228 -0
- package/templates/vault/skill-sentinel/scripts/report_generator.py +224 -0
- package/templates/vault/skill-sentinel/scripts/requirements.txt +1 -0
- package/templates/vault/skill-sentinel/scripts/run_audit.py +290 -0
- package/templates/vault/skill-sentinel/scripts/scanner.py +271 -0
- package/templates/vault/stability-ai/scripts/config.py +266 -0
- package/templates/vault/stability-ai/scripts/generate.py +687 -0
- package/templates/vault/stability-ai/scripts/requirements.txt +4 -0
- package/templates/vault/stability-ai/scripts/styles.py +174 -0
- package/templates/vault/telegram/assets/boilerplate/nodejs/src/bot-client.ts +86 -0
- package/templates/vault/telegram/assets/boilerplate/nodejs/src/handlers.ts +79 -0
- package/templates/vault/telegram/assets/boilerplate/nodejs/src/index.ts +32 -0
- package/templates/vault/telegram/scripts/send_message.py +143 -0
- package/templates/vault/telegram/scripts/setup_project.py +103 -0
- package/templates/vault/telegram/scripts/test_bot.py +144 -0
- package/templates/vault/typescript-expert/scripts/ts_diagnostic.py +203 -0
- package/templates/vault/ui-ux-pro-max/scripts/__pycache__/core.cpython-314.pyc +0 -0
- package/templates/vault/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-314.pyc +0 -0
- package/templates/vault/ui-ux-pro-max/scripts/core.py +257 -0
- package/templates/vault/ui-ux-pro-max/scripts/design_system.py +487 -0
- package/templates/vault/ui-ux-pro-max/scripts/search.py +76 -0
- package/templates/vault/videodb/scripts/ws_listener.py +204 -0
- package/templates/vault/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/templates/vault/web-artifacts-builder/scripts/init-artifact.sh +322 -0
- package/templates/vault/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/templates/vault/webapp-testing/scripts/with_server.py +106 -0
- package/templates/vault/whatsapp-cloud-api/assets/boilerplate/nodejs/src/index.ts +125 -0
- package/templates/vault/whatsapp-cloud-api/assets/boilerplate/nodejs/src/template-manager.ts +67 -0
- package/templates/vault/whatsapp-cloud-api/assets/boilerplate/nodejs/src/types.ts +216 -0
- package/templates/vault/whatsapp-cloud-api/assets/boilerplate/nodejs/src/webhook-handler.ts +173 -0
- package/templates/vault/whatsapp-cloud-api/assets/boilerplate/nodejs/src/whatsapp-client.ts +193 -0
- package/templates/vault/whatsapp-cloud-api/scripts/send_test_message.py +137 -0
- package/templates/vault/whatsapp-cloud-api/scripts/setup_project.py +118 -0
- package/templates/vault/whatsapp-cloud-api/scripts/validate_config.py +190 -0
- package/templates/vault/youtube-summarizer/scripts/extract-transcript.py +65 -0
- package/templates/vault/youtube-summarizer/scripts/install-dependencies.sh +28 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Templates reutilizáveis de conteúdo para Instagram.
|
|
3
|
+
|
|
4
|
+
Uso:
|
|
5
|
+
python scripts/templates.py --create --name "promo" --caption "Oferta: {produto}! {desconto}% OFF" --hashtags "#oferta,#promo"
|
|
6
|
+
python scripts/templates.py --list
|
|
7
|
+
python scripts/templates.py --show --name promo
|
|
8
|
+
python scripts/templates.py --delete --name promo
|
|
9
|
+
python scripts/templates.py --preview --name promo --vars produto=Tênis desconto=30
|
|
10
|
+
"""
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
import argparse
|
|
14
|
+
import json
|
|
15
|
+
import sys
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
|
|
18
|
+
sys.path.insert(0, str(Path(__file__).parent))
|
|
19
|
+
|
|
20
|
+
from db import Database
|
|
21
|
+
|
|
22
|
+
db = Database()
|
|
23
|
+
db.init()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def create_template(name: str, caption: str, hashtags: str = None, schedule_time: str = None) -> None:
|
|
27
|
+
"""Cria ou atualiza um template."""
|
|
28
|
+
hashtag_list = None
|
|
29
|
+
if hashtags:
|
|
30
|
+
hashtag_list = json.dumps([h.strip() for h in hashtags.split(",")])
|
|
31
|
+
|
|
32
|
+
template_id = db.upsert_template({
|
|
33
|
+
"name": name,
|
|
34
|
+
"caption_template": caption,
|
|
35
|
+
"hashtag_set": hashtag_list,
|
|
36
|
+
"default_schedule_time": schedule_time,
|
|
37
|
+
})
|
|
38
|
+
print(json.dumps({
|
|
39
|
+
"status": "created",
|
|
40
|
+
"id": template_id,
|
|
41
|
+
"name": name,
|
|
42
|
+
"caption_template": caption,
|
|
43
|
+
"hashtags": json.loads(hashtag_list) if hashtag_list else [],
|
|
44
|
+
}, indent=2, ensure_ascii=False))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def list_templates() -> None:
|
|
48
|
+
"""Lista todos os templates."""
|
|
49
|
+
templates = db.get_templates()
|
|
50
|
+
for t in templates:
|
|
51
|
+
if t.get("hashtag_set") and isinstance(t["hashtag_set"], str):
|
|
52
|
+
try:
|
|
53
|
+
t["hashtag_set"] = json.loads(t["hashtag_set"])
|
|
54
|
+
except json.JSONDecodeError:
|
|
55
|
+
pass
|
|
56
|
+
print(json.dumps({"total": len(templates), "templates": templates}, indent=2, ensure_ascii=False))
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def show_template(name: str) -> None:
|
|
60
|
+
"""Mostra detalhes de um template."""
|
|
61
|
+
t = db.get_template_by_name(name)
|
|
62
|
+
if not t:
|
|
63
|
+
print(json.dumps({"error": f"Template '{name}' não encontrado"}, indent=2))
|
|
64
|
+
return
|
|
65
|
+
if t.get("hashtag_set") and isinstance(t["hashtag_set"], str):
|
|
66
|
+
try:
|
|
67
|
+
t["hashtag_set"] = json.loads(t["hashtag_set"])
|
|
68
|
+
except json.JSONDecodeError:
|
|
69
|
+
pass
|
|
70
|
+
print(json.dumps(t, indent=2, ensure_ascii=False))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def delete_template(name: str) -> None:
|
|
74
|
+
"""Deleta um template."""
|
|
75
|
+
if db.delete_template(name):
|
|
76
|
+
print(json.dumps({"status": "deleted", "name": name}, indent=2))
|
|
77
|
+
else:
|
|
78
|
+
print(json.dumps({"error": f"Template '{name}' não encontrado"}, indent=2))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def preview_template(name: str, variables: list) -> None:
|
|
82
|
+
"""Preview de um template com variáveis aplicadas."""
|
|
83
|
+
t = db.get_template_by_name(name)
|
|
84
|
+
if not t:
|
|
85
|
+
print(json.dumps({"error": f"Template '{name}' não encontrado"}, indent=2))
|
|
86
|
+
return
|
|
87
|
+
|
|
88
|
+
caption = t["caption_template"] or ""
|
|
89
|
+
var_dict = {}
|
|
90
|
+
for v in variables:
|
|
91
|
+
if "=" in v:
|
|
92
|
+
key, val = v.split("=", 1)
|
|
93
|
+
var_dict[key.strip()] = val.strip()
|
|
94
|
+
|
|
95
|
+
try:
|
|
96
|
+
rendered = caption.format(**var_dict)
|
|
97
|
+
except KeyError as e:
|
|
98
|
+
print(json.dumps({"error": f"Variável faltando: {e}"}, indent=2))
|
|
99
|
+
return
|
|
100
|
+
|
|
101
|
+
hashtags = []
|
|
102
|
+
if t.get("hashtag_set"):
|
|
103
|
+
try:
|
|
104
|
+
hashtags = json.loads(t["hashtag_set"]) if isinstance(t["hashtag_set"], str) else t["hashtag_set"]
|
|
105
|
+
except json.JSONDecodeError:
|
|
106
|
+
pass
|
|
107
|
+
|
|
108
|
+
full_caption = rendered
|
|
109
|
+
if hashtags:
|
|
110
|
+
full_caption = f"{rendered}\n\n{' '.join(hashtags)}"
|
|
111
|
+
|
|
112
|
+
print(json.dumps({
|
|
113
|
+
"template": name,
|
|
114
|
+
"variables": var_dict,
|
|
115
|
+
"rendered_caption": full_caption,
|
|
116
|
+
}, indent=2, ensure_ascii=False))
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def main():
|
|
120
|
+
parser = argparse.ArgumentParser(description="Templates de conteúdo Instagram")
|
|
121
|
+
group = parser.add_mutually_exclusive_group(required=True)
|
|
122
|
+
group.add_argument("--create", action="store_true", help="Criar template")
|
|
123
|
+
group.add_argument("--list", action="store_true", help="Listar templates")
|
|
124
|
+
group.add_argument("--show", action="store_true", help="Ver template")
|
|
125
|
+
group.add_argument("--delete", action="store_true", help="Deletar template")
|
|
126
|
+
group.add_argument("--preview", action="store_true", help="Preview com variáveis")
|
|
127
|
+
parser.add_argument("--name", help="Nome do template")
|
|
128
|
+
parser.add_argument("--caption", help="Template de caption (use {var} para variáveis)")
|
|
129
|
+
parser.add_argument("--hashtags", help="Hashtags separadas por vírgula")
|
|
130
|
+
parser.add_argument("--schedule-time", help="Horário padrão (HH:MM)")
|
|
131
|
+
parser.add_argument("--vars", nargs="+", help="Variáveis (key=value)")
|
|
132
|
+
args = parser.parse_args()
|
|
133
|
+
|
|
134
|
+
if args.create:
|
|
135
|
+
if not args.name or not args.caption:
|
|
136
|
+
parser.error("--name e --caption são obrigatórios com --create")
|
|
137
|
+
create_template(args.name, args.caption, args.hashtags, args.schedule_time)
|
|
138
|
+
elif args.list:
|
|
139
|
+
list_templates()
|
|
140
|
+
elif args.show:
|
|
141
|
+
if not args.name:
|
|
142
|
+
parser.error("--name é obrigatório com --show")
|
|
143
|
+
show_template(args.name)
|
|
144
|
+
elif args.delete:
|
|
145
|
+
if not args.name:
|
|
146
|
+
parser.error("--name é obrigatório com --delete")
|
|
147
|
+
delete_template(args.name)
|
|
148
|
+
elif args.preview:
|
|
149
|
+
if not args.name:
|
|
150
|
+
parser.error("--name é obrigatório com --preview")
|
|
151
|
+
preview_template(args.name, args.vars or [])
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
if __name__ == "__main__":
|
|
155
|
+
main()
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Camada de persistência SQLite para dados de leiloeiros das Juntas Comerciais.
|
|
3
|
+
|
|
4
|
+
Uso:
|
|
5
|
+
from db import Database
|
|
6
|
+
db = Database() # abre/cria o banco em data/leiloeiros.db
|
|
7
|
+
db.init() # cria tabelas se não existirem
|
|
8
|
+
db.upsert_many(records) # insere/atualiza lista de Leiloeiro
|
|
9
|
+
rows = db.get_all() # retorna todos os registros
|
|
10
|
+
rows = db.get_by_estado("SP")
|
|
11
|
+
stats = db.get_stats()
|
|
12
|
+
"""
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import json
|
|
16
|
+
import sqlite3
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
from typing import Any, Dict, List, Optional
|
|
19
|
+
|
|
20
|
+
# Caminho padrão do banco — relativo ao diretório pai de scripts/
|
|
21
|
+
_DEFAULT_DB = Path(__file__).parent.parent / "data" / "leiloeiros.db"
|
|
22
|
+
|
|
23
|
+
DDL = """
|
|
24
|
+
CREATE TABLE IF NOT EXISTS leiloeiros (
|
|
25
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
26
|
+
estado TEXT NOT NULL,
|
|
27
|
+
junta TEXT NOT NULL,
|
|
28
|
+
matricula TEXT,
|
|
29
|
+
nome TEXT NOT NULL,
|
|
30
|
+
cpf_cnpj TEXT,
|
|
31
|
+
situacao TEXT,
|
|
32
|
+
endereco TEXT,
|
|
33
|
+
municipio TEXT,
|
|
34
|
+
telefone TEXT,
|
|
35
|
+
email TEXT,
|
|
36
|
+
data_registro TEXT,
|
|
37
|
+
data_atualizacao TEXT,
|
|
38
|
+
url_fonte TEXT,
|
|
39
|
+
scraped_at TEXT NOT NULL,
|
|
40
|
+
UNIQUE (estado, matricula) ON CONFLICT REPLACE
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
CREATE INDEX IF NOT EXISTS idx_estado ON leiloeiros (estado);
|
|
44
|
+
CREATE INDEX IF NOT EXISTS idx_nome ON leiloeiros (nome);
|
|
45
|
+
CREATE INDEX IF NOT EXISTS idx_situacao ON leiloeiros (situacao);
|
|
46
|
+
CREATE INDEX IF NOT EXISTS idx_scraped ON leiloeiros (scraped_at);
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
UPSERT_SQL = """
|
|
50
|
+
INSERT INTO leiloeiros
|
|
51
|
+
(estado, junta, matricula, nome, cpf_cnpj, situacao,
|
|
52
|
+
endereco, municipio, telefone, email,
|
|
53
|
+
data_registro, data_atualizacao, url_fonte, scraped_at)
|
|
54
|
+
VALUES
|
|
55
|
+
(:estado, :junta, :matricula, :nome, :cpf_cnpj, :situacao,
|
|
56
|
+
:endereco, :municipio, :telefone, :email,
|
|
57
|
+
:data_registro, :data_atualizacao, :url_fonte, :scraped_at)
|
|
58
|
+
ON CONFLICT(estado, matricula) DO UPDATE SET
|
|
59
|
+
junta = excluded.junta,
|
|
60
|
+
nome = excluded.nome,
|
|
61
|
+
cpf_cnpj = excluded.cpf_cnpj,
|
|
62
|
+
situacao = excluded.situacao,
|
|
63
|
+
endereco = excluded.endereco,
|
|
64
|
+
municipio = excluded.municipio,
|
|
65
|
+
telefone = excluded.telefone,
|
|
66
|
+
email = excluded.email,
|
|
67
|
+
data_registro = excluded.data_registro,
|
|
68
|
+
data_atualizacao = excluded.data_atualizacao,
|
|
69
|
+
url_fonte = excluded.url_fonte,
|
|
70
|
+
scraped_at = excluded.scraped_at
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
# Para registros sem matrícula, usa INSERT simples (não upsert)
|
|
74
|
+
INSERT_SQL = """
|
|
75
|
+
INSERT INTO leiloeiros
|
|
76
|
+
(estado, junta, matricula, nome, cpf_cnpj, situacao,
|
|
77
|
+
endereco, municipio, telefone, email,
|
|
78
|
+
data_registro, data_atualizacao, url_fonte, scraped_at)
|
|
79
|
+
VALUES
|
|
80
|
+
(:estado, :junta, :matricula, :nome, :cpf_cnpj, :situacao,
|
|
81
|
+
:endereco, :municipio, :telefone, :email,
|
|
82
|
+
:data_registro, :data_atualizacao, :url_fonte, :scraped_at)
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class Database:
|
|
87
|
+
def __init__(self, db_path: Path = _DEFAULT_DB):
|
|
88
|
+
self.db_path = Path(db_path)
|
|
89
|
+
self.db_path.parent.mkdir(parents=True, exist_ok=True)
|
|
90
|
+
|
|
91
|
+
def _connect(self) -> sqlite3.Connection:
|
|
92
|
+
conn = sqlite3.connect(self.db_path)
|
|
93
|
+
conn.row_factory = sqlite3.Row
|
|
94
|
+
conn.execute("PRAGMA journal_mode=WAL")
|
|
95
|
+
conn.execute("PRAGMA synchronous=NORMAL")
|
|
96
|
+
return conn
|
|
97
|
+
|
|
98
|
+
def init(self) -> None:
|
|
99
|
+
"""Cria tabelas e índices se não existirem."""
|
|
100
|
+
with self._connect() as conn:
|
|
101
|
+
conn.executescript(DDL)
|
|
102
|
+
|
|
103
|
+
def upsert_many(self, records: List[Dict[str, Any]]) -> int:
|
|
104
|
+
"""
|
|
105
|
+
Insere ou atualiza registros.
|
|
106
|
+
Registros sem matrícula são inseridos sempre (para não perder dados).
|
|
107
|
+
Retorna o número de registros processados.
|
|
108
|
+
"""
|
|
109
|
+
with_matricula = [r for r in records if r.get("matricula")]
|
|
110
|
+
without_matricula = [r for r in records if not r.get("matricula")]
|
|
111
|
+
|
|
112
|
+
count = 0
|
|
113
|
+
with self._connect() as conn:
|
|
114
|
+
if with_matricula:
|
|
115
|
+
conn.executemany(UPSERT_SQL, with_matricula)
|
|
116
|
+
count += len(with_matricula)
|
|
117
|
+
if without_matricula:
|
|
118
|
+
# Evitar duplicatas exatas por (estado + nome + scraped_at)
|
|
119
|
+
conn.executemany(INSERT_SQL, without_matricula)
|
|
120
|
+
count += len(without_matricula)
|
|
121
|
+
return count
|
|
122
|
+
|
|
123
|
+
def get_all(
|
|
124
|
+
self,
|
|
125
|
+
estado: Optional[str] = None,
|
|
126
|
+
situacao: Optional[str] = None,
|
|
127
|
+
nome_like: Optional[str] = None,
|
|
128
|
+
limit: int = 0,
|
|
129
|
+
offset: int = 0,
|
|
130
|
+
) -> List[Dict[str, Any]]:
|
|
131
|
+
"""Retorna registros com filtros opcionais."""
|
|
132
|
+
conditions = []
|
|
133
|
+
params: List[Any] = []
|
|
134
|
+
|
|
135
|
+
if estado:
|
|
136
|
+
conditions.append("estado = ?")
|
|
137
|
+
params.append(estado.upper())
|
|
138
|
+
if situacao:
|
|
139
|
+
conditions.append("situacao = ?")
|
|
140
|
+
params.append(situacao.upper())
|
|
141
|
+
if nome_like:
|
|
142
|
+
conditions.append("nome LIKE ?")
|
|
143
|
+
params.append(f"%{nome_like}%")
|
|
144
|
+
|
|
145
|
+
where = f"WHERE {' AND '.join(conditions)}" if conditions else ""
|
|
146
|
+
|
|
147
|
+
if limit > 0:
|
|
148
|
+
sql = f"SELECT * FROM leiloeiros {where} ORDER BY estado, nome LIMIT ? OFFSET ?"
|
|
149
|
+
params.extend([limit, offset])
|
|
150
|
+
else:
|
|
151
|
+
sql = f"SELECT * FROM leiloeiros {where} ORDER BY estado, nome"
|
|
152
|
+
|
|
153
|
+
with self._connect() as conn:
|
|
154
|
+
rows = conn.execute(sql, params).fetchall()
|
|
155
|
+
return [dict(r) for r in rows]
|
|
156
|
+
|
|
157
|
+
def get_by_estado(self, estado: str) -> List[Dict[str, Any]]:
|
|
158
|
+
return self.get_all(estado=estado)
|
|
159
|
+
|
|
160
|
+
def get_stats(self) -> List[Dict[str, Any]]:
|
|
161
|
+
"""Retorna contagem de leiloeiros por estado."""
|
|
162
|
+
sql = """
|
|
163
|
+
SELECT
|
|
164
|
+
estado,
|
|
165
|
+
junta,
|
|
166
|
+
COUNT(*) as total,
|
|
167
|
+
SUM(CASE WHEN situacao = 'ATIVO' THEN 1 ELSE 0 END) as ativos,
|
|
168
|
+
MAX(scraped_at) as ultima_coleta
|
|
169
|
+
FROM leiloeiros
|
|
170
|
+
GROUP BY estado, junta
|
|
171
|
+
ORDER BY total DESC
|
|
172
|
+
"""
|
|
173
|
+
with self._connect() as conn:
|
|
174
|
+
rows = conn.execute(sql).fetchall()
|
|
175
|
+
return [dict(r) for r in rows]
|
|
176
|
+
|
|
177
|
+
def get_total(self) -> int:
|
|
178
|
+
with self._connect() as conn:
|
|
179
|
+
return conn.execute("SELECT COUNT(*) FROM leiloeiros").fetchone()[0]
|
|
180
|
+
|
|
181
|
+
def search(self, query: str, limit: int = 50) -> List[Dict[str, Any]]:
|
|
182
|
+
"""Busca full-text por nome, matrícula ou município."""
|
|
183
|
+
sql = """
|
|
184
|
+
SELECT * FROM leiloeiros
|
|
185
|
+
WHERE nome LIKE ? OR matricula LIKE ? OR municipio LIKE ? OR email LIKE ?
|
|
186
|
+
ORDER BY estado, nome
|
|
187
|
+
LIMIT ?
|
|
188
|
+
"""
|
|
189
|
+
q = f"%{query}%"
|
|
190
|
+
with self._connect() as conn:
|
|
191
|
+
rows = conn.execute(sql, [q, q, q, q, limit]).fetchall()
|
|
192
|
+
return [dict(r) for r in rows]
|
|
193
|
+
|
|
194
|
+
def dump_all_json(self) -> str:
|
|
195
|
+
"""Retorna todos os dados como string JSON."""
|
|
196
|
+
return json.dumps(self.get_all(), ensure_ascii=False, indent=2)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
# ── CLI rápido para verificação ──────────────────────────────────────────────
|
|
200
|
+
if __name__ == "__main__":
|
|
201
|
+
import sys
|
|
202
|
+
db = Database()
|
|
203
|
+
db.init()
|
|
204
|
+
stats = db.get_stats()
|
|
205
|
+
if not stats:
|
|
206
|
+
print("Banco vazio. Execute run_all.py primeiro.")
|
|
207
|
+
sys.exit(0)
|
|
208
|
+
total = db.get_total()
|
|
209
|
+
print(f"\nTotal de leiloeiros: {total}\n")
|
|
210
|
+
print(f"{'Estado':<8} {'Junta':<12} {'Total':>6} {'Ativos':>6} {'Última Coleta'}")
|
|
211
|
+
print("-" * 60)
|
|
212
|
+
for r in stats:
|
|
213
|
+
print(
|
|
214
|
+
f"{r['estado']:<8} {r['junta']:<12} "
|
|
215
|
+
f"{r['total']:>6} {r['ativos']:>6} {r['ultima_coleta'][:10]}"
|
|
216
|
+
)
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Exportação de dados de leiloeiros para diferentes formatos.
|
|
3
|
+
|
|
4
|
+
Uso:
|
|
5
|
+
python scripts/export.py --format json
|
|
6
|
+
python scripts/export.py --format csv
|
|
7
|
+
python scripts/export.py --format jsonl
|
|
8
|
+
python scripts/export.py --format parquet # requer pandas + pyarrow
|
|
9
|
+
python scripts/export.py --format all # exporta todos os formatos
|
|
10
|
+
python scripts/export.py --format csv --estado SP
|
|
11
|
+
python scripts/export.py --output /caminho/personalizado/
|
|
12
|
+
"""
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import argparse
|
|
16
|
+
import csv
|
|
17
|
+
import json
|
|
18
|
+
import sys
|
|
19
|
+
from datetime import datetime, timezone
|
|
20
|
+
from pathlib import Path
|
|
21
|
+
from typing import List, Optional
|
|
22
|
+
|
|
23
|
+
sys.path.insert(0, str(Path(__file__).parent))
|
|
24
|
+
|
|
25
|
+
from db import Database
|
|
26
|
+
|
|
27
|
+
OUTPUT_DIR = Path(__file__).parent.parent / "data" / "exports"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def export_json(records: list, output_dir: Path, suffix: str = "") -> Path:
|
|
31
|
+
output_dir.mkdir(parents=True, exist_ok=True)
|
|
32
|
+
ts = datetime.now(timezone.utc).strftime("%Y%m%d_%H%M%S")
|
|
33
|
+
path = output_dir / f"leiloeiros{suffix}_{ts}.json"
|
|
34
|
+
with open(path, "w", encoding="utf-8") as f:
|
|
35
|
+
json.dump(
|
|
36
|
+
{"exported_at": datetime.now(timezone.utc).isoformat(), "total": len(records), "data": records},
|
|
37
|
+
f,
|
|
38
|
+
ensure_ascii=False,
|
|
39
|
+
indent=2,
|
|
40
|
+
)
|
|
41
|
+
print(f"[JSON] {len(records)} registros → {path}")
|
|
42
|
+
return path
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def export_jsonl(records: list, output_dir: Path, suffix: str = "") -> Path:
|
|
46
|
+
output_dir.mkdir(parents=True, exist_ok=True)
|
|
47
|
+
ts = datetime.now(timezone.utc).strftime("%Y%m%d_%H%M%S")
|
|
48
|
+
path = output_dir / f"leiloeiros{suffix}_{ts}.jsonl"
|
|
49
|
+
with open(path, "w", encoding="utf-8") as f:
|
|
50
|
+
for rec in records:
|
|
51
|
+
f.write(json.dumps(rec, ensure_ascii=False) + "\n")
|
|
52
|
+
print(f"[JSONL] {len(records)} registros → {path}")
|
|
53
|
+
return path
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def export_csv(records: list, output_dir: Path, suffix: str = "") -> Path:
|
|
57
|
+
if not records:
|
|
58
|
+
print("[CSV] Nenhum registro para exportar.")
|
|
59
|
+
return None
|
|
60
|
+
|
|
61
|
+
output_dir.mkdir(parents=True, exist_ok=True)
|
|
62
|
+
ts = datetime.now(timezone.utc).strftime("%Y%m%d_%H%M%S")
|
|
63
|
+
path = output_dir / f"leiloeiros{suffix}_{ts}.csv"
|
|
64
|
+
|
|
65
|
+
with open(path, "w", newline="", encoding="utf-8-sig") as f:
|
|
66
|
+
writer = csv.DictWriter(f, fieldnames=list(records[0].keys()), extrasaction="ignore")
|
|
67
|
+
writer.writeheader()
|
|
68
|
+
writer.writerows(records)
|
|
69
|
+
print(f"[CSV] {len(records)} registros → {path}")
|
|
70
|
+
return path
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def export_parquet(records: list, output_dir: Path, suffix: str = "") -> Optional[Path]:
|
|
74
|
+
try:
|
|
75
|
+
import pandas as pd
|
|
76
|
+
except ImportError:
|
|
77
|
+
print("[PARQUET] pandas não instalado. Execute: pip install pandas pyarrow")
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
output_dir.mkdir(parents=True, exist_ok=True)
|
|
81
|
+
ts = datetime.now(timezone.utc).strftime("%Y%m%d_%H%M%S")
|
|
82
|
+
path = output_dir / f"leiloeiros{suffix}_{ts}.parquet"
|
|
83
|
+
|
|
84
|
+
df = pd.DataFrame(records)
|
|
85
|
+
df.to_parquet(path, index=False, engine="pyarrow")
|
|
86
|
+
print(f"[PARQUET] {len(records)} registros → {path}")
|
|
87
|
+
return path
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def main():
|
|
91
|
+
parser = argparse.ArgumentParser(description="Exporta dados de leiloeiros")
|
|
92
|
+
parser.add_argument(
|
|
93
|
+
"--format", choices=["json", "jsonl", "csv", "parquet", "all"],
|
|
94
|
+
default="csv", help="Formato de exportação (default: csv)"
|
|
95
|
+
)
|
|
96
|
+
parser.add_argument(
|
|
97
|
+
"--estado", nargs="*", metavar="UF",
|
|
98
|
+
help="Filtrar por estado(s) (ex: SP RJ)"
|
|
99
|
+
)
|
|
100
|
+
parser.add_argument(
|
|
101
|
+
"--output", default=str(OUTPUT_DIR),
|
|
102
|
+
help=f"Diretório de saída (default: {OUTPUT_DIR})"
|
|
103
|
+
)
|
|
104
|
+
args = parser.parse_args()
|
|
105
|
+
|
|
106
|
+
db = Database()
|
|
107
|
+
db.init()
|
|
108
|
+
|
|
109
|
+
output_dir = Path(args.output)
|
|
110
|
+
estados = [e.upper() for e in args.estado] if args.estado else None
|
|
111
|
+
|
|
112
|
+
if estados:
|
|
113
|
+
all_records = []
|
|
114
|
+
for uf in estados:
|
|
115
|
+
all_records.extend(db.get_by_estado(uf))
|
|
116
|
+
suffix = "_" + "_".join(estados)
|
|
117
|
+
else:
|
|
118
|
+
all_records = db.get_all()
|
|
119
|
+
suffix = ""
|
|
120
|
+
|
|
121
|
+
if not all_records:
|
|
122
|
+
print("Banco vazio. Execute run_all.py primeiro.")
|
|
123
|
+
sys.exit(0)
|
|
124
|
+
|
|
125
|
+
fmt = args.format
|
|
126
|
+
if fmt in ("json", "all"):
|
|
127
|
+
export_json(all_records, output_dir, suffix)
|
|
128
|
+
if fmt in ("jsonl", "all"):
|
|
129
|
+
export_jsonl(all_records, output_dir, suffix)
|
|
130
|
+
if fmt in ("csv", "all"):
|
|
131
|
+
export_csv(all_records, output_dir, suffix)
|
|
132
|
+
if fmt in ("parquet", "all"):
|
|
133
|
+
export_parquet(all_records, output_dir, suffix)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
if __name__ == "__main__":
|
|
137
|
+
main()
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Dependências principais
|
|
2
|
+
httpx>=0.27.0
|
|
3
|
+
beautifulsoup4>=4.12.0
|
|
4
|
+
lxml>=5.0.0
|
|
5
|
+
|
|
6
|
+
# API
|
|
7
|
+
fastapi>=0.111.0
|
|
8
|
+
uvicorn[standard]>=0.30.0
|
|
9
|
+
|
|
10
|
+
# Scraping JS (instalar browser: playwright install chromium)
|
|
11
|
+
playwright>=1.44.0
|
|
12
|
+
|
|
13
|
+
# Exportação avançada (opcional)
|
|
14
|
+
pandas>=2.0.0
|
|
15
|
+
pyarrow>=15.0.0
|