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 alsorioxarray 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.7.4.tar.gz (253.3 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.7.4-py3-none-any.whl (85.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sertit-1.7.4.tar.gz
  • Upload date:
  • Size: 253.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.12

File hashes

Hashes for sertit-1.7.4.tar.gz
Algorithm Hash digest
SHA256 555212d5da04597df241ec76a0740ecd16d3c6daeb23579080fa0b61ef7236b8
MD5 07c6ad46a2e91719298b21aca2d7765d
BLAKE2b-256 79c553e9750db5e5377c4de6105001c311abe80ba086eff24f5044cc67e6fee3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sertit-1.7.4-py3-none-any.whl
  • Upload date:
  • Size: 85.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.12

File hashes

Hashes for sertit-1.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 76af6496789cf922fa43e57f6f023987d11cbe451e3c204ebbc479cbe5d08512
MD5 fae690b2dcfaff0372a326e86582dd29
BLAKE2b-256 65832b93a738ed674e84c8d24a8b96148354733d27b70e192ecc0448c979a1fb

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