Skip to main content

General-purpose library

Project description

🧚‍♀️Pyxidust

Unleash the magic of Python with the Pyxidust general-purpose library!

Pyxidust contains many tools for working with ESRI ArcGIS Pro software,

and basic utilities that improve your quality of life!


⚗️Dependencies

Python 3.7+, Pandas, Microsoft Windows, ESRI ArcGIS Pro license


🌍️ Arc Module

Create Index Function

Joins file metadata (name/path/modified) with layers/layouts/maps via a

global ID for each .aprx file in the specified directory.

# create_index(directory)
from pyxidust.arc import create_index
create_index(directory=r'\\folder')

CSV To GDB Function

Converts a .csv file to a geodatabase table.

# csv_to_gdb(csv, gdb, table)
from pyxidust.arc import csv_to_gdb
csv_to_gdb(csv=r'\\.csv', gdb=r'\\.gdb', table='Output')

Cubic Volume Function

Calculates volume in cubic yards using a cut/fill operation on two input

rasters with the same cell size and coordinate system.

# cubic_volume(original, current, gdb, polygons)
from pyxidust.arc import cubic_volume
cubic_volume(original=r'\\', current=r'\\', gdb=r'\\.gdb', polygons='poly')

Excel To GDB Function

Converts a Microsoft Excel workbook sheet to an ArcGIS geodatabase table.

# excel_to_gdb(workbook, gdb, table, sheet=None)
from pyxidust.arc import excel_to_gdb
excel_to_gdb(workbook=r'\\.xlsx', gdb=r'\\.gdb', table='Output', sheet='Sheet 1')

Place Anno Function

Sets reference scale from a layer in an ArcGIS PRO project and creates

annotation feature classes for all layers with visible labels.

# place_anno(pro_obj, map_name, lay_name, fra_name, lyr_idx, adjust, gdb, suffix)
import arcpy
from pyxidust.arc import place_anno
project = arcpy.mp.ArcGISProject(r'\\.aprx')

# returns extent, scale; unpack or call without variables
extent, scale = place_anno(pro_obj=project, map_name='Map', lay_name='Layout',
    fra_name='Map Frame', lyr_idx=0, adjust=1.1, gdb=r'\\.gdb', suffix='A')

Plot CSV Function

Converts X/Y/Z coordinates in a .csv file to a shapefile and adds it to

a map in an ArcGIS PRO project.

# plot_csv(pro_obj, map_name, csv, crs, output, x_name, y_name, z_name=None)
import arcpy
from pyxidust.arc import plot_csv
project_ = arcpy.mp.ArcGISProject(r'\\.aprx')
# z-values are optional
plot_csv(pro_obj=project_, map_name='Map', csv=r'\\.csv', crs=r'\\.prj',
    output=r'\\.shp', x_name='X', y_name='Y', z_name=None='Z')

Plot Excel Function

Converts X/Y/Z coordinates in a spreadsheet workbook to a shapefile and

adds it to a map in an ArcGIS PRO project.

# plot_excel(workbook, pro_obj, map_name, crs, output, x_name, y_name, z_name=None, sheet=None)
import arcpy
from pyxidust.arc import plot_excel
project_ = arcpy.mp.ArcGISProject(r'\\.aprx')
# z-values and sheet name are optional
plot_excel(workbook=r'\\.xlsx', pro_obj=project_, map_name='Map', crs=r'\\.prj',
    output=r'\\.shp', x_name='X', y_name='Y', z_name='Z', sheet='Sheet1')

Print Info Function

Prints map/layout/layer names and data sources in an ArcGIS PRO project.

Useful for troublesome projects that will not open due to memory issues.

# print_info(pro_obj)
import arcpy
from pyxidust.arc import print_info
project = arcpy.mp.ArcGISProject(r'\\.aprx')
print_info(pro_obj=project)

Print Layers Function

Prints the properties of all layers in a map in an ArcGIS PRO project.

# print_layers(pro_obj, map_name)
import arcpy
from pyxidust.arc import print_layers
project = arcpy.mp.ArcGISProject(r'\\.aprx')
print_layers(pro_obj=project, map_name='Map')

Set Default Function

Updates home folder/default geodatabase/toolbox in an ArcGIS PRO project.

# set_default(pro_obj, home, gdb, toolbox)
import arcpy
from pyxidust.arc import set_default
project = arcpy.mp.ArcGISProject(r'\\.aprx')
set_default(pro_obj=project, home=r'\\folder', gdb=r'\\.gdb',
    toolbox=r'\\.tbx')

Turn Off Function

Turns off layers in a map in an ArcGIS PRO project if the layer index

position is found in the input list.

# turn_off(pro_obj, map_name, lyr_idx)
import arcpy
from pyxidust.arc import turn_off
project = arcpy.mp.ArcGISProject(r'\\.aprx')
turn_off(pro_obj=project, map_name='Map', lyr_idx=[0,1,2])

Zoom To Function

Sets reference scale from a layer in an ArcGIS PRO project and zooms the

layout to the layer extent.

# zoom_to(pro_obj, map_name, lay_name, fra_name, lyr_idx, adjust)
import arcpy
from pyxidust.arc import zoom_to
project = arcpy.mp.ArcGISProject(r'\\.aprx')
zoom_to(pro_obj=project, map_name='Map', lay_name='Layout', fra_name='Map Frame',
    lyr_idx=0, adjust=1.1)

🛸 Utils Module

Change Name Function

Renames files in a folder via incremental serial numbers per a certain

file extension.

# change_name(extension, directory, serials)
from pyxidust.utils import change_name
change_name(extension='.jpg', directory=r'\\folder', serials=r'\\Serials.txt')

Get Metadata Function

Crawls a directory and returns metadata per a certain file extension.

# get_metadata(extension, directory)
from pyxidust.utils import get_metadata
get_metadata(extension='.jpg', directory=r'\\folder')

🧪Change Log

0.1.0 (1/23/2023):

  • Added the 'Arc' module with the following functions: create_index, csv_to_gdb, cubic_volume, excel_to_gdb, place_anno, plot_csv, plot_excel, print_info, print_layers, set_default, turn_off, zoom_to

  • Added the get_metadata function to the 'Utils' module

  • The file_rename function in the 'Utils' module has become the change_name function with the same arguments

0.0.1 (11/10/2022):

  • Initial release and birth of Pyxidust!

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

pyxidust-0.1.2.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyxidust-0.1.2-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file pyxidust-0.1.2.tar.gz.

File metadata

  • Download URL: pyxidust-0.1.2.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for pyxidust-0.1.2.tar.gz
Algorithm Hash digest
SHA256 818760955f90540451d6822bb63ce9b0f6c5a2a851d18b3d2b03487b888c66f7
MD5 fde586a03e02239a8ad6fd3527863b81
BLAKE2b-256 bdce88dd74606521fa8579903d25fb8609b559d6e288236cf9b1ffc22bb482a4

See more details on using hashes here.

File details

Details for the file pyxidust-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pyxidust-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for pyxidust-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fb67a7918971c267023c9b59ffd2f549d85e8205e38f0f1c5e7e1d74a8d7f968
MD5 7b5f1629aae422264eaf849c8087e295
BLAKE2b-256 62eb83a9a0bc1997588b0405029a8aeca5b4147c2b104df7ad861bfc390f0731

See more details on using hashes here.

Supported by

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