alegra is a python package for connect to the Alegra's API.
Project description
A Python library for Alegra’s API.
Setup
You can install this package by using the pip tool and installing:
$ pip install alegra
Usage
The library needs to be configured with your user and token which is available in your Alegra Account: https://app.alegra.com/configuration/api
Set alegra.user and alegra.token to their values:
import alegra
alegra.user = "...@..."
alegra.token = "..."
# List contacts.
alegra.Contact.list()
# Create contact.
alegra.Contact.create(
name="Chaty",
identification={
"type": "RUC", "number": "20000000000",
},
email="developer@okchaty.com",
type=["client"],
address={
"address": "Jr. Neptuno 777",
"city": "Lima, Peru",
},
)
# Retrieve contact.
alegra.Contact.retrieve(123)
# Modify contact.
alegra.Contact.modify(
resource_id=contact_id,
identification={
"type": "RUC",
"number": "20000000001",
},
)
# Delete contact.
alegra.Contact.delete(123)
Using the Alegra API
Documentation can be found here:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alegra-0.1.1.tar.gz.
File metadata
- Download URL: alegra-0.1.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37d24fdd04f1a7fdf78b75427caaaa9bcd5092d3fd6f0ab781fe8d61f38fcb37
|
|
| MD5 |
3733a872fd4bb59b15684ae8caa5e43a
|
|
| BLAKE2b-256 |
9fb3653f60fdbf79a130b0360ae3d328f6619ce24ae05cbd8671640b6ebfd3a6
|
File details
Details for the file alegra-0.1.1-py3-none-any.whl.
File metadata
- Download URL: alegra-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b3baa55bb902d885042851c961fdacd1c8b3d62b8b34dc3aad7e9add6374fec
|
|
| MD5 |
c6e338a8e4efe4d622a713d3ba567ecc
|
|
| BLAKE2b-256 |
605b86429748fc55094811ec80b1f2fdf7f967223f0e61ff9b963eafdb378a98
|