Skip to main content

Common Python methods for OGIA

Project description

OGIA Python Libraries

Some commonly used python libraries.


Installation

Use the url of this repository for directly installing via pip

pip install git+https://github.com/Office-of-Groundwater-Impact-Assessment/ogialibs

Installing a specific version of OgiaLibs

Please make note of the commit hash or branch name you would like to install.

Replace the BRANCH_NAME below. Branch or commit string should come after the "@" sign.

pip install git+https://github.com/Office-of-Groundwater-Impact-Assessment/ogialibs@BRANCH_NAME

Usage

cached_parquet

Creates a Parquet cache in local data directory after the first generation of an output. Decorated function must have a single DataFrame (or GeoDataFrame. See below for example) return value. Below example will create a tmp_XXXXX.parquet file under the data folder of your project.

from ogialibs.data import cached_parquet

@cached_parquet
def get_df():
    ...
    return df

Custom prefixes can be set at the decorator or during the function call;

@cached_parquet(tmp_prefix='foo')
def get_foo_df():
    ...
    return df

# Creates a foo_XXXXX.parquet file instead

@cached_parquet
def get_bar_df():
    ...
    return df

bar = get_bar_df(tmp_prefix='bar')

# Creates a bar_XXXXX.parquet file instead

When using with GeoPandas, the library must be set via the dflib argument

import geopandas as gpd

@cached_parquet(dflib=gpd)
def get_gdf():
    ...
    return gdf

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ogialibs-0.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

ogialibs-0.0.1-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file ogialibs-0.0.1.tar.gz.

File metadata

  • Download URL: ogialibs-0.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.18

File hashes

Hashes for ogialibs-0.0.1.tar.gz
Algorithm Hash digest
SHA256 dd4d01e35e5c6d36e98b96973d06817fe4cdd3be564f2f98878c62adcf8acb94
MD5 3920104e281bbfacd26bbb1419f957de
BLAKE2b-256 9b6850da920e632671af96984b654b8de3c9862583c530c8803dcc8601e3755d

See more details on using hashes here.

File details

Details for the file ogialibs-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: ogialibs-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.18

File hashes

Hashes for ogialibs-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4bbcffb124bbf4272371aa4f0062101f2240979123438664aefbf79be0e2c34f
MD5 9e5c29c9223b8731386a45c8fda4a0da
BLAKE2b-256 8471dd485878e77641e288646c7c3c368bc15133b5d84208d49a43aaa5e8789f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page