Skip to main content

Python bindings for the Depoc API

Project description

Depoc API Python Library

This library simplifies interaction with the Depoc API. It enables convenient HTTP requests - retrieving, creating, updating, and deleting resources.

It also ships with a CLI, exposed via the depoc command, which is documented in a later section.

Note: This library is under active development and may contain breaking changes or unresolved issues.

Installation

Install via pip

$ pip install depoc

Getting Started

The library requires your account's access token for authentication.

Currently, the only supported method to get your token is to instantiate the Connection class with your username and password.

from depoc import Connection

user = Connection(username="foo", password="bar")

# returns the account's access token
user.token

Usage

You're now ready to start using the library. Instatiate the DepocClient class with the access token you just got.

from depoc import DepocClient

client = DepocClient(user.token)

# Retrieve all customers
customers = client.customer.all()

# Retrieve an specific customer
customer = client.customer.get('ID-KLSJDF331')

Handling Exceptions

Requirements

  • Python 3.12+

Third Party Libraries and Dependencies

The following libraries will be installed when you install the Depoc API library:

  • requests
  • appdirs
  • click
  • rich

CLI

Installing the Depoic API Python library provides access to the depoc command. Before using the Depoc CLI, you must configure your credentials by running the depoc login command.

$ depoc login
Username: foo
Password: bar

CLI Usage

depoc [command]

# Run `--help` for detailed information about the CLI commands
depoc [command] --help

Commands

The Depoc CLI supports a broad number of commands. Bellow are some of the most used ones:

  • me
  • login
  • logout
  • account
  • customer
  • transaction
  • bank
  • payable
  • receivable

Command Output

The default output is a box layout rendered with Rich for improved readability.

$ depoc bank 
╭─ ANY BANK ──────────────────────────────────────────────────╮
│                                                $10,374.12   │
│                                                             │
│ 01JN7MFR675GASDKFLJW31N22V                                  │
╰─────────────────────────────────────────────────────────────╯   
╭─ THE SECOND BANK ───────────────────────────────────────────╮
│                                                    $744.89  │
│                                                             │
│ 02JNLSKFJALSDKJFSALVKR962V                                  │
╰─────────────────────────────────────────────────────────────╯   
╭─ BANK ONE ──────────────────────────────────────────────────╮
│                                                      $2.53  │
│                                                             │
│ 03JN7MFR675G1SJLKDFJ20923J                                  │
╰─────────────────────────────────────────────────────────────╯

Total Balance: $11,121.54                 

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

depoc-0.1.6a1.tar.gz (28.7 kB view details)

Uploaded Source

Built Distribution

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

depoc-0.1.6a1-py3-none-any.whl (50.0 kB view details)

Uploaded Python 3

File details

Details for the file depoc-0.1.6a1.tar.gz.

File metadata

  • Download URL: depoc-0.1.6a1.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for depoc-0.1.6a1.tar.gz
Algorithm Hash digest
SHA256 877436de3c5873010660be68360bfac2943bc9ab4bf699f2e65834ab5fef77d9
MD5 92d60950f8d915b5c5e58e4e40e3d22d
BLAKE2b-256 dd9da3b2f77dcf5d9d27140e9d31dd2524d889d207de6ed14200e4c48548ff79

See more details on using hashes here.

Provenance

The following attestation bundles were made for depoc-0.1.6a1.tar.gz:

Publisher: pypi.yml on depoc/depopy

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

File details

Details for the file depoc-0.1.6a1-py3-none-any.whl.

File metadata

  • Download URL: depoc-0.1.6a1-py3-none-any.whl
  • Upload date:
  • Size: 50.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for depoc-0.1.6a1-py3-none-any.whl
Algorithm Hash digest
SHA256 48b77e852db5706edc621bf67a6df193d1e9892d818e8d7b188c1e42e3a6afa1
MD5 35b6f9dfe70d4c27875e366c6d91b091
BLAKE2b-256 337b912d6e39fb813e0b948fa213e5a4808461198e47bc3fa1bf573a956186b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for depoc-0.1.6a1-py3-none-any.whl:

Publisher: pypi.yml on depoc/depopy

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