Skip to content

okchaty/alegra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alegra in Python

Wrapper in python for Alegra.

Usage

The library needs to be configured with your user and token which is available in your Alegra Account. 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="[email protected]",
  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)

About

A Python library for Alegra's API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages