datablob
Client for Updating a Simple Data Warehouse on Blob Storage
design philosophy
- optimize for simplicity and user friendliness
- storage is cheap (compared to compute)
- pre-compute as much as possible
- should work out of the box
- advanced configuration should be opt-in
- explicit is better than implicit
- straightforwardness over magic
install
pip install datablob
supported formats
- csv
- geojson (points and polygons)
- json
- json lines
- parquet, including geoparquet
- shapefile (points and polygons)
- tsv
- xlsx (Microsoft Excel)
basic usage
from datablob import DataBlobClient
client = DataBlobClient(
bucket_name="example-test-bucket-123", bucket_path="prefix/to/dataportal"
)
rows = [
{
"name": "Random Building",
"@lat": 35.XXXXXX,
"@lon": -85.XXXXXX,
"@geom": { "type": "Polygon", "coordinates": [...] } // geojson geometry
}
]
client.update_dataset(
name="parking_lots", # name of the dataset, shouldn't include spaces or special characters
version="2", # version of the dataset. It's a string, so you can version as you like.
data=rows, # list of dictionaries. Each row is a dictionary.
latitude_key="@lat", # name of the latitude column
longitude="@lon", # name of the longitude column
polygon_key="@geom", # name of the column with a polygon geometry in it (if applicable)
xlsx=True # set to True to include an Excel file in output
)
# automatically creates the following files
# s3://example-test-bucket-123/prefix/to/dataportal/buildings/v2/meta.json
# s3://example-test-bucket-123/prefix/to/dataportal/buildings/v2/data.csv
# s3://example-test-bucket-123/prefix/to/dataportal/buildings/v2/data.points.geojson
# s3://example-test-bucket-123/prefix/to/dataportal/buildings/v2/data.polygons.geojson
# s3://example-test-bucket-123/prefix/to/dataportal/buildings/v2/data.json
# s3://example-test-bucket-123/prefix/to/dataportal/buildings/v2/data.jsonl
# s3://example-test-bucket-123/prefix/to/dataportal/buildings/v2/data.parquet
# s3://example-test-bucket-123/prefix/to/dataportal/buildings/v2/data.points.shp.zip
# s3://example-test-bucket-123/prefix/to/dataportal/buildings/v2/data.polygons.shp.zip
# s3://example-test-bucket-123/prefix/to/dataportal/buildings/v2/data.tsv
# s3://example-test-bucket-123/prefix/to/dataportal/buildings/v2/data.xlsx
advanced usage
client.update_dataset(
name="fleet",
version="1",
data=rows,
column_names=["ID", "Make", "Model", "Year"] # specify column names and their order
description="List of Vehicles in Fleet",
xlsx=True,
xlsx_data_types=["Number", "Text", "Text", "Number"] # specify format of cell values in columns
)
examples
Metadata
Release files for datablob 0.9.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 | |
|---|---|---|---|
| datablob-0.9.3.tar.gz | 9.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datablob-0.9.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.1 kB
Release files / datablob-0.9.3.tar.gz
| Download URL | datablob-0.9.3.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd25c887f768d1e514f2fe52abed0c56758ab71654dfceb04882ebbef1082366
|
|
BLAKE2b-256 checksum How to use checksums |
8c230091d7bf5c33af6b90858617b8f79a2cecf91cedd4f0341e12584a847cc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / datablob-0.9.3-py3-none-any.whl
| Download URL | datablob-0.9.3-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33618979096299f56ee00390997f9aa2209632a062d35878c9d2dc53ffcbd4b2
|
|
BLAKE2b-256 checksum How to use checksums |
83f4bd83a021b4f2d9c880a29cf792791dbdf68e364e52a3dbdacb825c08c59c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|