Skip to main content

Creating, quering, and searching in data structures holding geo-datasets.

Project description

https://github.com/TUW-GEO/geopathfinder/workflows/ubuntu/badge.svg https://github.com/TUW-GEO/geopathfinder/workflows/windows/badge.svg https://badge.fury.io/py/geopathfinder.svg https://readthedocs.org/projects/geopathfinder/badge/?version=latest https://img.shields.io/badge/License-MIT-yellow.svg

A package for creating, querying, and searching in data structures holding geo data sets.

Description

This packages aims to provide a rich toolbox for efficient, quick, and precise handling of filenames and folder structures for geo-data, most conviniently when combined with grid objects as e.g. the https://github.com/TUW-GEO/Equi7Grid.

With pre-defined sets comprising string-definitions, folder path logics, and filename en-/decoders, a variety of file/folder naming conventions can be implemented.

The base classes SmartPath() and SmartTree() comprise also functions for file search and folder(-tree) volume determination.

Adding a new filenaming convention

In general, please follow the code and test guidelines of existing naming conventions. The following description aims to show how to implement a new naming convention:

  • Create a new .py file in the folder “geopathfinder/naming_conventions/”. The filename should be an abbreviation of the new naming convention separated from “naming” with an underscore, e.g., “sgrt_naming.py” ot “eodr_naming.py”.

  • Inside this file, write a new class, which inherits from SmartFilename. In this class you can define how the filename structure should look like. For each field you can define the length of the field (‘len’, integer), the start index of a field (‘start’, integer), if a delimiter should be in between the current and the previous part of the filename (‘delim’, boolean) and finally, if desired, a decoding and encoding function (‘decoder’, ‘encoder’). The latter parameters should point via a lambda function to a decoding or encoding method defined in the same class.

  • Finally, the parent class SmartFilename can be initiated with the given fields, fields definitions, a padding, a delimiter and a boolean value if en-/decoding should be applied or not.

  • If you want to read a filename with your created class, you can overwrite the class method from_filename and use your field definitions for the parent class method call from_filename.

  • Sometimes one needs information from a part of a filename, which can be directly derived/decoded from one or multiple filename entries. An example would be a mean date derived from the start and end date specified in the filename. To allow this, one can define methods tagged with property in the current class. SmartFilename then handles the properties of the inherited class equally to a common filename entry given in the field definition.

  • Add tests to “tests” and name the test file “test_[]_naming.py”, where “[]” should be replaced by the abbreviation of the new naming convention.

Note

This project has been set up using PyScaffold 4.6. For details and usage information on PyScaffold see https://pyscaffold.org/.

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

geopathfinder-0.2.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

geopathfinder-0.2.0-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file geopathfinder-0.2.0.tar.gz.

File metadata

  • Download URL: geopathfinder-0.2.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for geopathfinder-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f49e50b1b65b8c8dd2759b60faae05eddd7e0384e74e2e77832a100473e21a17
MD5 fe6df4ff3834c00cb9f7e5fddbce67b9
BLAKE2b-256 2a826a7a5ff3946401418ffff9ac7f607f6b036b303f27476dbabdc473fe5032

See more details on using hashes here.

File details

Details for the file geopathfinder-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: geopathfinder-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for geopathfinder-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 998c8f4d108262349e7c704f1dd6c28a318be4b1b57912bd60559c71eb0700bc
MD5 2f75791194be22fa19ded7c5aae7f3fe
BLAKE2b-256 714bfa6636ea3d6bdb7e3f77747c9f7530e1cf18972462c808ba7a013864a3b2

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