carto-report
A Python module to export a database metrics as a html file for CARTO organization user.
Installation
You can install carto-report by cloning this repository or by using Pip:
$ pip install carto-report
If you want to use the development version, you can install directly from github:
$ pip install -e git+git://github.com/CartoDB/carto-report.git#egg=carto
If using, the development version, you might want to install dependencies as well:
$ pip install -r requirements.txt
Only tested in Python 3
Usage Example
Command Line application
The package installs a command line application carto_report that has the following usage instructions:
$ carto_report -h
usage: carto_report [-h] [--user-name CARTO_USER] [--api_key CARTO_API_KEY]
[--api_url CARTO_API_URL] [--organization CARTO_ORG]
[--output OUTPUT] [--quota QUOTA]
[--loglevel {DEBUG,INFO,WARNING,ERROR}]
CARTO reporting tool
optional arguments:
-h, --help show this help message and exit
--user-name CARTO_USER, -U CARTO_USER
Account user name (defaults to env variable
CARTO_USER)
--api_key CARTO_API_KEY, -a CARTO_API_KEY
Api key of the account (defaults to env variable
CARTO_API_KEY)
--api_url CARTO_API_URL, -u CARTO_API_URL
Set the base URL. For example:
https://username.carto.com/ (defaults to env variable
CARTO_API_URL)
--organization CARTO_ORG, -o CARTO_ORG
Set the name of the organization account (defaults to
env variable CARTO_ORG)
--output OUTPUT File path for the report, defaults to report.html
--quota QUOTA, -q QUOTA
LDS quota for the user, defaults to 5000
--loglevel {DEBUG,INFO,WARNING,ERROR}, -l {DEBUG,INFO,WARNING,ERROR}
How verbose the output should be, default to the most
silent
As a python module
from carto_report.report import Reporter
reporter = Reporter(CARTO_USER, CARTO_API_URL, CARTO_ORG, API_KEY, USER_QUOTA)
with open('/tmp/report.html','w') as writer:
writer.write(reporter.report())
Where the different parameters are:
CARTO_USER: user name of the account to checkCARTO_API_URL: this is usuallyhttps://{CARTO_USER}.carto.com/but may differ if you are not usingcarto.comaccountsCARTO_API_KEY: your CARTO ENGINE master API keyUSER_QUOTA: your LDS quota
Known Issues
- Improve report layout and style (with Airship).
- Add assertions.
- Use conditionals within the template.
- Add debug loggins to bet feedback, especially when getting all tables and analysis.
- Include logging as a proper library.
Metadata
Release files for carto-report 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| carto-report-0.0.3.tar.gz | 12.7 kB | Without provenance | Details for carto-report-0.0.3.tar.gz |
Release files / carto-report-0.0.3.tar.gz
| Download URL | carto-report-0.0.3.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
860ebd409ec8d1ef7ad94e0bc60b81a9f34ddfba9caa31a38efa9fd71ce6484b
|
|
BLAKE2b-256 checksum How to use checksums |
f4068ff1f1c2e6c5f7cd9a79dea4e318fbfbff573a4ae8869459ddeb91eec4b3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7
|
Security for carto-report 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.