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

Building

Prerequisites;

  • build
  • twine
  • Api keys from PyPi
  • Local configuration file (.pypirc)
python -m build

And

twine upload --repository pypi dist/* --config-file .pypirc

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.3.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

ogialibs-0.3.2-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ogialibs-0.3.2.tar.gz
Algorithm Hash digest
SHA256 edcfefca9a5543d24161c52efcfc2d9286ab6dfc6b5e0faeb1515c0235ee9e4b
MD5 ab1f13cf39b3f4c18f98cecfc6e8a6e9
BLAKE2b-256 12e1251e2d9351ded65d152628303caa306ced93482646296d03b8bb1bfa32d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ogialibs-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 3.0 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.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f2d43f75bc47dcc1c5b21fcbf1802e9aac724848e0ec392e6d042eb37c956532
MD5 51808753130532243f5580806d428ad7
BLAKE2b-256 80bcb971dde3ba5641be714e034533618fe4a8e66b70dae4cc1a092afae5a0d7

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