Skip to main content

# Netvisor: Python API client

Project description

Netvisor: Python API client

PyPI version License Downloads Code style: black Imports: isort


Python client for the Netvisor API.


Installation

You can install netvisor with pip::

$ pip install netvisor-api-client

Usage example

from netvisor_api_client import Netvisor
from datetime import date, timedelta

# Create a client
client = Netvisor(
    host="https://isvapi.netvisor.fi",
    sender="Test client",
    partner_id="x",
    partner_key="x",
    customer_id="x",
    customer_key="x",
    organization_id="1967543-8",
    language="EN"
)

# Get a list of sales invoices for last 14 days
invoices = client.sales_invoices.list(start_date=date.today() - timedelta(days=14), end_date=date.today())

# Get detailed information for the first invoice
invoice_details = client.sales_invoices.get(invoices[0]['netvisor_key'])

Running tests

Run tests locally using pytest or by running docker docker run --rm -it $(docker build -f tests.dockerfile -q .)

Known issues

Language

Using language other than EN can cause failures when parsing responses containing localised boolean like values.

Example: "Yes" and "No" parsed to bool True and False fails when language is FI

from netvisor_api_client.schemas.fields import Boolean

# Current schema
match_partial_payments_by_default = Boolean(true="Yes", false="No")

# i.e. for FI this should be
match_partial_payments_by_default = Boolean(true="Kyllä", false="Ei")

Resources

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

netvisor_api_client-0.9.6.tar.gz (49.2 kB view details)

Uploaded Source

Built Distribution

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

netvisor_api_client-0.9.6-py3-none-any.whl (62.5 kB view details)

Uploaded Python 3

File details

Details for the file netvisor_api_client-0.9.6.tar.gz.

File metadata

  • Download URL: netvisor_api_client-0.9.6.tar.gz
  • Upload date:
  • Size: 49.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for netvisor_api_client-0.9.6.tar.gz
Algorithm Hash digest
SHA256 933f3aa6ef701c6c5ff8c1bccbd3fa3288255d455af5ea6a72f9aaab70582b9f
MD5 accf8858c92454807102c33207234d3f
BLAKE2b-256 640b9ad95b14473977dfd1365f9bf864b3f80f4921129ff05f913b969ae8fa96

See more details on using hashes here.

File details

Details for the file netvisor_api_client-0.9.6-py3-none-any.whl.

File metadata

File hashes

Hashes for netvisor_api_client-0.9.6-py3-none-any.whl
Algorithm Hash digest
SHA256 67020b44aa585e29631791e05389b049a35707d180a43e655de87cd56bf3ec72
MD5 08786dbf65485a306b4b158d21fdf974
BLAKE2b-256 56ed9a60d342dd9288ae3200ec184cd1ad515e83306a5925276c7fec5b5bccbe

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