Skip to main content

Reusable Django utilities for PTech projects

Project description

ptech-tools

Pacote reutilizavel de utilitarios Django/Python para os projetos da PTech.

Instalacao

pip install ptech-tools

Requer Django 5.2 ou superior.

Uso no Django

Adicione o app em INSTALLED_APPS:

INSTALLED_APPS = [
    # ...
    "ptech_tools.apps.PtechToolsConfig",
]

Comando inicial

O pacote ja expoe o comando export_db:

python manage.py export_db

Configuracao opcional via settings.py:

from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent.parent

PTECH_TOOLS = {
    "EXPORT_DB": {
        "output_dir": BASE_DIR / "backups",
        "database_alias": "default",
        "compress": True,
        "include_tables": ["users", "orders"],
        "exclude_tables": ["audit_log"],
    }
}

O comando tambem aceita flags diretas:

python manage.py export_db --compress --include-table users --include-table orders

Quando compress=True ou --compress estiver ativo, o arquivo final termina em .gz. Use --no-compress para forcar saida sem compactacao, mesmo se compress=True estiver configurado.

include_tables e exclude_tables aceitam listas no settings.py e valores separados por virgula nas variaveis de ambiente.

Publicacao

O fluxo de publicacao para TestPyPI e PyPI esta documentado em docs/publishing.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ptech_tools-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ptech_tools-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file ptech_tools-0.1.0.tar.gz.

File metadata

  • Download URL: ptech_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ptech_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bcdf2f9c658f0db2b9b8075a5db79e471ddd0952b451d2a8397bd013efa08e42
MD5 85d6f50f5d49ccaaa4b0ea15935b00c5
BLAKE2b-256 c4476bccb94884b9cf68f99d6176bc20516b563c37907043a4dd41583e200971

See more details on using hashes here.

Provenance

The following attestation bundles were made for ptech_tools-0.1.0.tar.gz:

Publisher: publish-pypi.yml on leandrocristovao/ptech-django-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ptech_tools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ptech_tools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ptech_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7fafc3e15b65309fbb5e79869c89ccfe64b4bc21b64432182970b882cae6503
MD5 cc98085c6990241c3ea0dbc65e5b4d13
BLAKE2b-256 17ad39225400246146f75792fdf4b4ab8640e3017895e6ec9a8ab95903689df1

See more details on using hashes here.

Provenance

The following attestation bundles were made for ptech_tools-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on leandrocristovao/ptech-django-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page