Python wrapper for the Moloni API
Project description
PYTHON-MOLONI
Moloni API
A wrapper to access Moloni's API with an easy-to-use interface.
Documentation
Usage:
Full configuration
from moloni.api.companies_client import CompaniesClient
from moloni.base import AuthConfig, MoloniBaseUrl
import logging
logger = logging.getLogger(__name__)
companies = CompaniesClient(
environment=MoloniBaseUrl.PROD,
auth_config=AuthConfig(
client_id="your_client_id",
client_secret="your_client_secret",
username="your_username", # Optional if refresh_token is set
password="your_password", # Optional if refresh_token is set
refresh_token="your_refresh_token", # Optional if username and password are set
),
log_level="INFO",
version="v1",
validate=True,
)
logger.info(companies.get_all())
Minimal configuration, with credentials set as environment variables
from moloni.api.companies_client import CompaniesClient
from moloni.api.products_client import ProductsClient
import logging
logger = logging.getLogger(__name__)
companies = CompaniesClient()
logger.info(companies.get_all())
products = ProductsClient()
logger.info(products.get_all(dict(company_id=5, category_id=8231525)))
Environment Variables
To setup auth through environment variables, you can set the following variables:
client_id: str = os.getenv("MOLONI_CLIENT_ID")
client_secret: str = os.getenv("MOLONI_CLIENT_SECRET")
refresh_token: str = os.getenv("MOLONI_REFRESH_TOKEN")
username: str = os.getenv("MOLONI_USERNAME")
password: str = os.getenv("MOLONI_PASSWORD")
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for python_moloni-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a928004481de81761b395e3e33d821e633b0193cfbbfbf44370f39715c7b4a9e |
|
MD5 | 641a99edd99992b86b3973d81461cb94 |
|
BLAKE2b-256 | 8095880803a67f6152012adfa6c19f981e321316b3af123d392963e1022fae9c |