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.0a4.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.0a4-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: internal_lib_48e662a6-0.1.0a4.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.0a4.tar.gz
Algorithm Hash digest
SHA256 f20f952f856e497bfdb99931a1944c135070fb34bdf4c6dcb78a6f9017adfc5a
MD5 6a9304d2ec6986fe88f38a4bcf5ad7af
BLAKE2b-256 5585241117e80cc5892ca0fea7af76e857c11b1667e1aecd2d7277bd3e306588

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for internal_lib_48e662a6-0.1.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 6c5850a90365d498d9371bda951311668bf13ae4238cb2bdbd7ef68abe70c7dc
MD5 9bb3d71b67333cfedfece784cbd70fcd
BLAKE2b-256 c98b37a5061546dbeb0df1c4f69524a60bcbe9fa2afa0c54661cc36c97b17116

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