Skip to main content

('SERTIT python library for generic tools',)

Project description

pypi Conda Tests pre-commit black Apache DOI

Library gathering functions for all SERTIT's projects.

Find the API documentation here.

Installing

Pip

For installing this library to your environment, please type this: pip install sertit[full]

[full] will allow you to use the whole library, but you will need to install also rioxarray and geopandas (with GDAL installation issues on Windows, so please install them from wheels that you can find here).

However, if you do not need everything, you can type instead:

  • nothing, and you won't need rasterio, rioxarray: pip install sertit --extra-index-url ...
  • [rasters], and you won't need rioxarray: pip install sertit[rasters] --extra-index-url ...
  • [rasters_rio]: pip install sertit[rasters_rio] --extra-index-url ...
  • [colorlog]: pip install sertit[colorlog] --extra-index-url ... to have colorlog installed

Conda

You can install it via conda (but you will automatically have the full version):

conda config --env --set channel_priority strict

conda install -c conda-forge sertit

What is in it ?

Files

File gathering file-related functions:

  • paths
  • Create archive
  • Add folder to zip file
  • file extraction
  • file name
  • copy/remove
  • find files
  • JSON/pickles
  • hash

Logs

  • Init simple logger
  • Create complex logger (file and stream + color)
  • Shutdown logger

Misc

  • Function on lists: convert a list to a dict, remove empty values...
  • Function on dicts: nested set, check mandatory keys, find by key
  • Run a command line
  • Get a function name
  • Test if in docker
  • Change current directory (cd) as a context manager

Strings

  • Conversion from string to bool, logging level, list, list of dates...
  • Convert the string to be usable in command line
  • Case conversion (snake_case to/from CamelCase)

Vectors

  • Load an AOI as WKT
  • Get UTM projection from lat/lon
  • Manage bounds and polygons
  • Get geopandas.Geodataframe from polygon and CRS

Rasters and rasters_rio

Basically, these functions are overloads of rasterio's functions:

  • Get extent and footprint of a raster
  • Read/write overload of rasterio functions
  • Masking and cropping with masked array
  • Collocation (superimpose)
  • Sieving
  • Vectorization and get nodata vector
  • Merge rasters (as GTiff and VRT)
  • Get the path of the BEAM-DIMAP image that can be read by rasterio
  • Manage bit arrays

The main difference between the two is that rasters outputs one xarray variable when rasters_rio outputs numpy.ma.masked_arrays + dict for the raster array and its metadata.

Network

SNAP

  • Function converting bytes to SNAP understanding
  • Function creating a SNAP optimized commande line

Documentation

An HTML documentation is provided to document the code. It can be found:

  • online (here),
  • on git, in docs. To consult it, just open the index.html file in a web browser (you need first to clone this project) To generate the HTML documentation, just type pdoc sertit -o docs\html -f --html -c sort_identifiers=False

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sertit-1.21.1.tar.gz (151.6 kB view details)

Uploaded Source

Built Distribution

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

sertit-1.21.1-py3-none-any.whl (100.7 kB view details)

Uploaded Python 3

File details

Details for the file sertit-1.21.1.tar.gz.

File metadata

  • Download URL: sertit-1.21.1.tar.gz
  • Upload date:
  • Size: 151.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for sertit-1.21.1.tar.gz
Algorithm Hash digest
SHA256 5cdae24c3914046ca8ca23b797267a08d8ef56bcff83b3585e94801ad333cc28
MD5 8e8b16b177de567b96eb34e9528b3948
BLAKE2b-256 ff7c20044054b83a52fc8acf1d7a1879cc7199947cd67d459f0771a039d049de

See more details on using hashes here.

File details

Details for the file sertit-1.21.1-py3-none-any.whl.

File metadata

  • Download URL: sertit-1.21.1-py3-none-any.whl
  • Upload date:
  • Size: 100.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for sertit-1.21.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f2119f9cd81e7c1df02c0f54be61bf5ec9bc0bb4f6f9528a168d7a8fc102dec
MD5 596ffdfc38c5210338b2f72b2c4d810a
BLAKE2b-256 b8f8c4704f596fbda9cc8ae4a1ecdf473647b4d0a3a62bb481759218f99bfab0

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