Skip to main content

Internal utility package

Project description

Sage X3 Requests Wrapper (ALPHA)

⚠️ AVISO: BIBLIOTECA EM DESENVOLVIMENTO (ALPHA) ⚠️

Esta biblioteca foi publicada para uso pessoal e testes. Não é recomendada para produção. A API pode mudar drasticamente a qualquer momento sem aviso prévio. Use por sua conta e risco.

Instalação

pip install internal-lib-48e662a6

Exemplos de Uso

Configuração

from sage_x3_requests import SageX3Config, SageX3Requester

config = SageX3Config(
    base_url="https://seu-erp.com",
    username="admin",
    password="password",
    folder="SEED"
)

Pedir 5 Registos (Limit)

Pode passar o limite diretamente no método .get_resources(limit=5).

with SageX3Requester(config) as client:
    # Opção 1: Passar limit no get_resources (Maneira mais simples!)
    registos = client.request("CLIENTES", "BPC") \
                     .get_resources(limit=5)
    
    # Opção 2: Usar .count(5) antes
    registos = client.request("CLIENTES", "BPC") \
                     .count(5) \
                     .get_resources()

Pedir TODOS os Registos (Paginação Automática)

Use .get_resources(fetch_all=True) para buscar todos os dados, percorrendo todas as páginas automaticamente.

with SageX3Requester(config) as client:
    # Busca todos os clientes (cuidado com grandes volumes de dados!)
    todos_clientes = client.request("CLIENTES", "BPC") \
                           .get_resources(fetch_all=True)
                           
    print(f"Total encontrado: {len(todos_clientes)}")

Contagem Total

Para saber quantos registos existem sem trazer os dados:

with SageX3Requester(config) as client:
    query = client.request("CLIENTES", "BPC").count(True).execute()
    total = query.get("count") # ou verificar estrutura de retorno

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

internal_lib_48e662a6-0.1.0a6.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

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

internal_lib_48e662a6-0.1.0a6-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file internal_lib_48e662a6-0.1.0a6.tar.gz.

File metadata

  • Download URL: internal_lib_48e662a6-0.1.0a6.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for internal_lib_48e662a6-0.1.0a6.tar.gz
Algorithm Hash digest
SHA256 0c67481a5d1be4df1f6d23cc2a45cd7a5aeb2cb5757378b2b1eed88b2bdf758f
MD5 105733a578a3709113d1e6eb4baea22a
BLAKE2b-256 22bf61201e53e9ffb732b7e45b74ab0f874f5471ed70496b82a27d1422ab9fc3

See more details on using hashes here.

File details

Details for the file internal_lib_48e662a6-0.1.0a6-py3-none-any.whl.

File metadata

File hashes

Hashes for internal_lib_48e662a6-0.1.0a6-py3-none-any.whl
Algorithm Hash digest
SHA256 b0aaa0ec1a717d6a723bdb14efb31b3f62b0d3ed43bbaf84d373dd6e4302afde
MD5 6c698db11230402e621398393dc9d183
BLAKE2b-256 20a955032add67e9f34a6924979de543a41d85a3a88abddf222f95fee943f8b6

See more details on using hashes here.

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