GeoLibs-CARTOasync
Asynchronous Python client for CARTO.
Features
- SQL API
- Batch API
- COPY queries
- Import API
- Read and write Panda's DataFrames
- Maps API?
- Tests
Installation
pip install cartoasync
Usage
SQL API example
from cartoasync import Auth, SQLClient
auth = Auth(username='username', api_key='api_key')
sql_client = SQLClient(auth)
result = await sql_client.send('SELECT 1 AS one;')
print(result)
>>> {
>>> "rows": [
>>> {
>>> "one": 1
>>> }
>>> ],
>>> "time": 0.002,
>>> "fields": {
>>> "one": {
>>> "type": "number"
>>> }
>>> },
>>> "total_rows": 1
>>> }
SQL API example, step by step
1. Instantiate an Auth object:
1.1. CARTO cloud:
auth = Auth(username='username', api_key='api_key')
1.2. CARTO OnPremises or cloud organization with an implict user:
auth = Auth(base_url='https://myapp.com/user/username/', api_key='api_key')
1.3. CARTO OnPremises or cloud organization without an implicit user:
auth = Auth(base_url='https://myapp.com/', username='username', api_key='api_key')
1.4. SSL:
The Auth constructor has and ssl attribute. You can use it for handle to the library a Python's SSL context, or set it to False for relaxing certification checks. More info on AIOHTTP doc.
2. Instantiate the SQLClient and send queries:
2.1. SQLClient's own AIOHTTP session:
sql_client = SQLClient(auth)
result = await sql_client.send('SELECT 1 AS one;')
2.2. External AIOHTTP session you need to care until the end of its days:
import aiohttp
sql_client = SQLClient(auth)
result = await sql_client.send('SELECT 1 AS one;', aiohttp.ClientSession())
Metadata
Release files for geolibs-cartoasync 0.0.4
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 |
|---|---|---|---|---|
| geolibs-cartoasync-0.0.4.tar.gz | 4.0 kB | Without provenance | Details for geolibs-cartoasync-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| geolibs_cartoasync-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for geolibs_cartoasync-0.0.4-py3-none-any.whl |
Total release size: 8.6 kB
Release files / geolibs-cartoasync-0.0.4.tar.gz
| Download URL | geolibs-cartoasync-0.0.4.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1637b056582c135468551ca674ab67154664d87af98808e338c91df127db5145
|
|
BLAKE2b-256 checksum How to use checksums |
a6dd0ca70a7127c5ed627e8c9ceb09af1fa0a0853d459636428c2c72d6fa0485
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.12 CPython/3.7.3 Linux/4.14.91+
|
Release files / geolibs_cartoasync-0.0.4-py3-none-any.whl
| Download URL | geolibs_cartoasync-0.0.4-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cc6d09f21a9d104ca3cf51e5e77839a31f414f16999566c951fbaa816960933e
|
|
BLAKE2b-256 checksum How to use checksums |
fa11b9f14625e1b825c8c2b32465b90ba7fc2270e8b898e5f855815eb61df624
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.12 CPython/3.7.3 Linux/4.14.91+
|
Security for geolibs-cartoasync 0.0.4
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.