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

Uploaded Python 3

File details

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

File metadata

  • Download URL: internal_lib_48e662a6-0.1.0a5.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.0a5.tar.gz
Algorithm Hash digest
SHA256 e87052f90851af6d1401cda3b3e9f2bdc843a7a1584c3a80c48cc90939e495e9
MD5 a94a49719b92874a0544fc88fa1df427
BLAKE2b-256 a7ca0e51305a72076d3d4fad502cf04ae490b3296a07b1bb59a022857ac4a046

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for internal_lib_48e662a6-0.1.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 5e65f2c7aca24cd03410a25126415ca26add29fbd2b5205411a1b97556dd366b
MD5 73d0af4bc546ce7cb61f4a2093a8c77b
BLAKE2b-256 f320f03f9070f0a417f4ebb71d21bf307a8820415a0c214412558d8bea85f269

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