Skip to main content

Shruby

This library provides one kind of object dubbed "ShrubyFrame". This modified dataframe mimics a GeoDataframe with a few special tweaks. It is designed to work hand in hand with the ArcGIS API for Python. This project is in progress but version 0.1.0 will have the following methods:

  • create_buffers: creates a buffer around a point.
  • create_cones: creates triangle like cones that show a range and direction of a point.

Installation

pip install shruby

Usage

import pandas as pd
from shruby import ShrubyFrame

df = pd.read_csv("data.csv")
sdf = ShrubyFrame(df, lat_field="lat", lon_field="lon", crs="EPSG:4326")
sdf.create_buffers(distance=100, metric="meters")

ShrubyFrame

Constructor
Parameter Type Default Details
sdf Pandas DF, GeoDF, ArcGIS spacially enabled DF The input data in the form of a dataframe.
lat_field string None The latitude or Y field. If None, defaults to SHAPE from ArcGIS.
lon_field string None The longitude or X field. If None, defaults to SHAPE from ArcGIS.
crs string EPSG:4326 The spatial reference/projection in the form of EPSG:XXXX.
using_arcgis_api bool False Whether to return GeoAccessor Objects for use with the ArcGIS API.
args args for a GeoDataframe

create_buffers

Argument Type Default Details
distance numerical/string None The distance of the radius. Can be a plain number or a field in the dataframe that contains the distance for each row.
metric string None The unit of measurement for the distance. Can be any of the following: "meters", "kilometers", "feet", "miles", "nautical_miles".
quad_segs int 8 The number of segments to use to create the buffer. The more segments that are used, the more circular the buffer will be, at the expense of processing time.

Returns a ShrubyFrame with a geometry set to column "buffer_geometry" containing polygons. If using ArcGIS API, returns a GeoAccessor object.

create_cones

Argument Type Default Details
distance numerical/string None The distance of the radius. Can be a plain number or a field in the dataframe that contains the distance for each row.
metric string None The unit of measurement for the distance. Can be any of the following: "meters", "kilometers", "feet", "miles", "nautical_miles".
orientation numerical/string None The orientation of the cone. Can be a plain number or a field in the dataframe that contains the orientation for each row. Must be a number between 0 and 360.
offset numerical 20 The offset of the cone. This offset will decide how wide the cones angle is.
precision int 50 The number of points to use to create the cone. The more points that are used, the more circular the end of the cone will be, at the expense of processing time.

Returns a ShrubyFrame with a geometry set to column "cone_geometry" containing polygons. If using ArcGIS API, returns a GeoAccessor object.

create_rings

Argument Type Default Details
distance numerical/string None The distance of the radius. Can be a plain number or a field in the dataframe that contains the distance for each row.
metric string None The unit of measurement for the distance. Can be any of the following: "meters", "kilometers", "feet", "miles", "nautical_miles".
quad_segs int 8 The number of segments to use to create the buffer. The more segments that are used, the more circular the buffer will be, at the expense of processing time.

Returns a ShrubyFrame with a geometry set to column "ring_geometry" containing polygons. If using ArcGIS API, returns a GeoAccessor object.

Metadata

Release files for shruby 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shruby 0.1.0
File Size Uploaded Provenance
shruby-0.1.0.tar.gz 4.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for shruby 0.1.0
File Interpreter ABI Platform
shruby-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / shruby-0.1.0.tar.gz

Download URL shruby-0.1.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
34a2df7416d6ab165100a1e2f6514a62e52b4a328ef4cb90e0c76ef871988d68
BLAKE2b-256 checksum
How to use checksums
ac19e0a8172919d41edfaf9c6a8343a99436d99a722b70f07bd5f1db31c46add
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.0 CPython/3.8.0 Windows/10

Release files / shruby-0.1.0-py3-none-any.whl

Download URL shruby-0.1.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06d3284e55cc625bf9e5f49743c3f3aeccd874e36595f29957ed47d06f1621a9
BLAKE2b-256 checksum
How to use checksums
f2d000e2a972009d3f84989f3ed89875b9575f97e031b9a170830fdd1135b58c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.0 CPython/3.8.0 Windows/10

Security for shruby 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page