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.12.2.tar.gz (143.9 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.12.2-py3-none-any.whl (89.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sertit-1.12.2.tar.gz
  • Upload date:
  • Size: 143.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for sertit-1.12.2.tar.gz
Algorithm Hash digest
SHA256 8e02ba86cf41d3e0a92ab354bf2c53334f335a1ea1cebf631e4bdf6ac0957957
MD5 1e1cb8f181dcfb4f62e2ebe3f66f2f48
BLAKE2b-256 7a6121b786befb9cd9b41d509f6e58c27abc79ed267ae0e55197351c7346d0c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sertit-1.12.2-py3-none-any.whl
  • Upload date:
  • Size: 89.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for sertit-1.12.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6ae382922806957dd1132a0ff48c9dfbdaa1f1b6ab600e05149d89261e045a5d
MD5 af559fd55e5af467ea0409a62a1bde0d
BLAKE2b-256 aa3611ce2b2e2ddc9a3aa56953f0121335678e0039fb2d23265472a7d8fe306b

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