SERTIT python library for generic tools
Project description
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 needrioxarray: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 havecolorloginstalled
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_caseto/fromCamelCase)
Vectors
- Load an AOI as WKT
- Get UTM projection from lat/lon
- Manage bounds and polygons
- Get
geopandas.Geodataframefrom 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
- Standard Exponential Backoff algorithm
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 theindex.htmlfile in a web browser (you need first to clone this project) To generate the HTML documentation, just typepdoc 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
555212d5da04597df241ec76a0740ecd16d3c6daeb23579080fa0b61ef7236b8
|
|
| MD5 |
07c6ad46a2e91719298b21aca2d7765d
|
|
| BLAKE2b-256 |
79c553e9750db5e5377c4de6105001c311abe80ba086eff24f5044cc67e6fee3
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76af6496789cf922fa43e57f6f023987d11cbe451e3c204ebbc479cbe5d08512
|
|
| MD5 |
fae690b2dcfaff0372a326e86582dd29
|
|
| BLAKE2b-256 |
65832b93a738ed674e84c8d24a8b96148354733d27b70e192ecc0448c979a1fb
|