Skip to main content

Your package description here

Project description

ccfx

ccfx is a comprehensive Python package designed to streamline file and data management, geospatial analysis, and NetCDF file processing for quick prototyping. The library provides versatile tools for file handling, raster and vector manipulation, database connectivity, and data export for geospatial and scientific computing projects.

Features

  1. File Management:

    • List, delete, move, and count files within directories.
    • Monitor file count over time in a specific directory.
    • Save, load, and manage Python variables via pickle serialization.
  2. Geospatial Data Processing:

    • Read, write, and manage raster and vector geospatial data.
    • Clip rasters by bounding boxes and extract raster values at specified coordinates.
    • Create grids of polygons based on shapefile boundaries with user-defined resolutions.
    • Convert coordinates between coordinate reference systems (CRS).
    • Write NumPy arrays to GeoTIFF files with projection and geotransform settings.
  3. NetCDF File Handling:

    • List available variables and dimensions in NetCDF files.
    • Export NetCDF variables to GeoTIFF format.
    • Calculate sum and average maps from NetCDF data across multiple files.
  4. Database Connectivity:

    • Access and interact with databases using ODBC and SQLAlchemy for flexible database management.
    • Connect to both SQL Server and SQLite databases.
  5. Progress Tracking and System Info:

    • Display dynamic progress bars for long-running operations.
    • Check the system’s platform information.
    • Enable or disable warnings programmatically.
  6. Excel and Word File Handling:

    • Create and modify Excel files using xlsxwriter.
    • Generate Word documents with advanced formatting options using python-docx.

Installation

Install ccfx via pip:

pip install ccfx

Dependencies

ccfx relies on the following libraries:

  • netCDF4: For working with NetCDF files.
  • gdal: Required for geospatial raster data manipulation.
  • numpy: For array processing and numerical operations.
  • pandas: For data manipulation and analysis.
  • shapely: Provides geometric operations for spatial data.
  • geopandas: Extends pandas to handle geospatial data.
  • xlsxwriter: For creating and writing Excel files.
  • pyodbc: Enables connectivity to databases through ODBC.
  • sqlalchemy: Provides SQL toolkit and ORM features for database access.
  • python-docx: Enables creation and manipulation of Word documents.

These dependencies will be installed automatically when ccfx is installed.

API Reference

listFiles(path: str, ext: str = None) -> list

Lists all files in a directory with a specified extension.

  • Parameters:

    • path (str): The directory to search.
    • ext (str, optional): File extension to filter by, e.g., 'txt', '.txt', '*txt', or '*.txt'.
  • Returns:

    • list: A list of file paths matching the criteria.

deleteFile(filePath: str, v: bool = False) -> bool

Deletes a specified file with optional verbose output.

  • Parameters:

    • filePath (str): Path to the file to be deleted.
    • v (bool, optional): If True, prints a confirmation message. Defaults to False.
  • Returns:

    • bool: True if deletion was successful; False otherwise.

createGrid(shapefile_path: str, resolution: float, useDegree: bool = True) -> tuple

Generates a grid of polygons from a shapefile at a given resolution.

  • Parameters:

    • shapefile_path (str): Path to the shapefile.
    • resolution (float): Resolution of the grid.
    • useDegree (bool, optional): If True, coordinates are in degrees. Defaults to True.
  • Returns:

    • tuple: Contains grid coordinates and metadata.

clipRasterByExtent(inFile: str, outFile: str, bounds: tuple) -> str

Clips a raster to specified bounding box coordinates.

  • Parameters:

    • inFile (str): Path to the input raster file.
    • outFile (str): Path to the output clipped raster file.
    • bounds (tuple): Bounding box as (minx, miny, maxx, maxy).
  • Returns:

    • str: Path to the clipped raster file.

netcdfVariablesList(ncFile: str) -> list

Lists all variables in a NetCDF file.

  • Parameters:

    • ncFile (str): Path to the NetCDF file.
  • Returns:

    • list: A list of variable names in the file.

... And More ...

Contributing

Contributions are welcome! Please fork the repository, make your changes, and submit a pull request.

License

This project is licensed under the MIT License.

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

ccfx-0.3.0.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

ccfx-0.3.0-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file ccfx-0.3.0.tar.gz.

File metadata

  • Download URL: ccfx-0.3.0.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for ccfx-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1f9d6e64b24cb683d2eb0278205ab8e2eba7a849ed3a77a4e8b37e01da5aace6
MD5 791663a1422f93344f228fff5a266622
BLAKE2b-256 cbf5fcb00fa8b5c0f3b712b6f1bca32f1ce1933d6a6065c8689ae41da585b2ee

See more details on using hashes here.

File details

Details for the file ccfx-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ccfx-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for ccfx-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6720c2538f0d21c5cdeb602a8622b4b6c85cfac40add2b75d464e05b58925b0c
MD5 8f15accc43d70f39205b373596807e9e
BLAKE2b-256 cc2c8690bf3968b4a11c9326a11ff68d2b158946e3b078a1404c1540edb117e1

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