Python library to authenticate with CARTO
Project description
carto-auth
Python library to authenticate with CARTO.
Install
pip install carto-auth
To install the CARTO DW extension:
pip install carto-auth[carto-dw]
Installing from source
git clone https://github.com/cartodb/carto-auth
cd carto-auth
pip install .
Usage
from carto_auth import CartoAuth
# Authentication
carto_auth = CartoAuth.from_oauth()
# carto_auth = CartoAuth.from_m2m("./carto_credentials.json")
# Get api base url
api_base_url = carto_auth.get_api_base_url()
# Get access token
access_token = carto_auth.get_access_token()
# CARTO Data Warehouse
carto_dw_project, carto_dw_token = carto_auth.get_carto_dw_credentials()
carto_dw_client = carto_auth.get_carto_dw_client()
For more information, check the examples section.
Development
Make commands:
- init: create the environment and install dependencies
- lint: run linter (black + flake8)
- test: run tests (pytest)
- docs: build the documentation
- publish-pypi: publish package in pypi.org
- publish-test-pypi: publish package in test.pypi.org
- clean: remove the environment
Check the development documentation section.
Contributors
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
carto-auth-0.1.0.tar.gz
(8.5 kB
view hashes)
Built Distribution
Close
Hashes for carto_auth-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7f365a50b6ff9d0e47edfae505b7f3342d58b5354d027183c834da0e4e96ad8 |
|
MD5 | dfc914c09d80efdac7b73e895ad4c70a |
|
BLAKE2b-256 | 77f44a0377f5b006d929759e576e1fa2d5a5370a4dc06350c6b9291d847c5fec |