Saravanan666/pypi-org huggingface dataset:
Package: raspi-view
Raspi-ViewIntroductionThis is a very simple but extendable python app to display different kind of views on a self-made Raspberry Pi HAT with a Display (type: sh1106, size: 128x64), two LEDs (a red one and a blue one), and with two buttons.List of used partsBreadboard:https://www.amazon.de/dp/B07MCX54ZD/ref=cm_sw_em_r_mt_dp_U_FCoGEbCCPKBDWLEDs, buttons, wires:https://www.amazon.de/dp/B01M7N4WB6/ref=cm_sw_em_r_mt_dp_U_6DoGEb17VB08TDisplay:https://www.amazon.de/dp/B078J78R45/ref=cm_sw_em_r_mt_dp_U_KEoGEb8J2Q6ZZRaspberry Pi:https://www.amazon.de/dp/B07TC2BK1X/ref=cm_sw_em_r_mt_dp_U_SGoGEb8R24BM6...UsageInstalling$ pip install raspi-viewStart directly$ raspi-view --startInstall as a serviceAfter installing the pip package you can create and install an OS wide service, which will be restarted every time you restart you Raspberry Pi:$ sudo pip install raspi-view
$ raspi-view --installHint: make sure you install raspi-view with sudo.Ask for more help$ raspi-view --helpConfigureConfigure the viewsTODOAdding new viewsTODO
Package: rasplivestation
This package use paramiko and livestreamer Python 2.7 packages.Paramiko is a Python implementation of the SSHv2 protocol :http://www.paramiko.org/Livestreamer is a command-line utility use to watch streams into a video player (player, omxplayer,etc…) with an API which can work with Python :http://docs.livestreamer.io/To install Paramiko : pip install paramiko*Warning*It would be a little difficult to install paramiko, because this package have a dependance with the package cryptography, which use any C libraries bindings(OpenSSL). Checkhttps://cryptography.io/en/latest/installation/andhttps://cryptography.io/en/latest/hazmat/bindings/to have more information about this. On windows, it could be interesting to install environment like python(x,y) which include paramiko.To install Livestreamer on Debian/Ubuntu (on your Raspberry) : apt-get install livestreamer
To install Livestreamer Python package: pip install livestreamerTo install RaspLiveStation package : pip install rasplivestationEnjoy :)This package is under WTFPL licence.
Package: rasp-modules
rasp-modulesModules for Raspberry PI LCD, MCP3008.This package will provide you with basic modules for communications between LCD, MCP3008 with raspberry PI. I will add new modules soon!.Installtaion:pip install rasp-modulesUsage:import the LCD for Display and import MCP3008 for analogue communication.LCDfromdisplay.lcdimportLCDlcd=LCD(5,6,12,13,16,19)orlcd=LCD(rs=5,en=6,d4=12,d5=13,d6=16,d7=19)lcd.cursor_start(0,0)lcd.print_line(f"testing")# "Message stringMCP3008fromanalogue.mcp3008importMCP3008adc_mcp3008=MCP3008(max_speed_hz=1_000_000)lcd.cursor_start(0,0)lcd.print_line(adc_mcp3008)# "Message string
Package: rasptube
RasptubeThe Rasptube Python module was created by Walter J Hare to automate the tedious process of making a video compatable with the Raspberry Pi. It can be installed by running the command: 'pip3 install rasptube'. Rasptube runs on Python 3, it also requires that Python Module OS is installed to work.LinkgenLinkgen generates the link by using the OS Python Module to run the command: 'sudo youtube-dl -g -f 22 ""'. It requires that you supply the URL of the video as a paramater, it also requires that you have Youtube-DL installed.VideoplayerVideoplayer plays the video by using the OS Python Module to run the command: 'omxplayer -b ""'. It requires that you supply the the URL of the video as a paramater to work, it also requires that you have OMXPlayer installed. WARNING: Do not use a bluetooth keyboard.
Package: raspunzel
raspunzelCommand-line tool to run Bazel targets on systems where Bazel is not installed. For instance, we can run cross-compiled Bazel targets on a Raspberry Pi:pi@raspi:~/my_bazel_dir$raspunzelrun//my/target----foo--barRaspunzel's syntax is the same as Bazel, but it only supports theruncommand.InstallationPyPI$pipinstallraspunzelStandalone scriptRaspunzel is easy to ship in your own project as astandalone script. Check out how it is done for instance inupkie_locomotion.
Package: raspycheck
raspycheckraspycheckis a small tool to grab infos from and execute commands on a Raspberry Pi via SSH.raspycheckis in an early alpha stage!Usage:fromraspycheckimportRasPyCheckrpc=RasPyCheck(ip='ip',user='username',password='password',persist=False)# Setting persist to True keeps the connection open# Commands to grab data from the RPIip=rpc.get_rpi_ip()hostname=rpc.get_rpi_hostname()cpu_temp=rpc.get_rpi_cpu_temp()usb_devices=rpc.get_rpi_usb_devices()rpi_version=rpc.get_rpi_version()free_mem=rpc.get_rpi_free_memory()total_mem=rpc.get_rpi_total_memory()essids=rpc.get_rpi_available_essids()date=rpc.get_rpi_date()installed_packages=rpc.get_rpi_list_installed_packages()all_infos=rpc.get_all_rpi_info()# Commanding the Pirpc.cmd_reboot_pi()# Generic stuffoutput=rpc.run_command_get_output('pwd')# executes pwd on the RPI and returns the outputreturn_code=rpc.run_command_get_return_code('pwd')# executes pwd on the RPI and returns the return code# Only when persist=True:rpc.close_instance_client()# closes SSH clientSupported Versionsraspycheck is currently only tested with Python3.9TODO:Extend errorhandlingExtend functionalityAdd testsRelax/Check dependencies...Release History0.0.2 (2021-05-24)ImprovementsAdded READMEAdded HISTORYBugfixesFixed package structure0.0.1 (2021-05-24)Initial Creation
Package: raspy-qmc5883l
Python driver for the QMC5883L 3-Axis Magnetic SensorDeveloped for theRaspberry Pi, requires thepython-smbuspackage
to access the I2C bus.Usage example:importraspy_qmc5883lsensor=raspy_qmc5883l.QMC5883L()m=sensor.get_magnet()print(m)The object constructor accepts some arguments, e.g. you can pass this one to
switch the output range to 8 Gauss, for very strong magnetic fields which
can otherwise overflow the sensor:sensor=raspy_qmc5883l.QMC5883L(output_range=raspy_qmc5883l.RNG_8G)The class constructor will initialize the sensor and put it into continuous
read mode, where a new reading is available into the registers at the Output
Data Rate (default is 10 Hz). To save power you can put the sensor in standby
mode calling theQMC5883L.mode_standby()method. To wakeup the sensor, just
call theQMC5883L.mode_continuous()once, and start getting values.Module installationInstalling from PyPI$pipinstallraspy-qmc5883lInstalling from the source should be as simple as running:$ python setup.py installOutput Range ScaleThe sensor produces values as 16 bit signed integers, i.e.
numbers between -32768 and 32767. The field range is
programmable with two different values: +/-2 gauss or +/-8
gauss. The natural magnetic field produced by the Earth is
generally between 0.25 and 0.65 gauss, so the 2 G range is
preferable in natural environment. You can expect readings in
the range +/-4000 (about 0.2 gauss).If you operate in presence of strong magnetic fields, you can
experience reading overflows (over the 16 bit capabilities), in
this case the driver will generate a warning and you can try to
initialize the sensor in 8 gauss range, as seen above.Adjust for Magnetic DeclinationIf you want that theQMC5883L.get_bearing()method return
the current compass bearing adjusted by themagnetic declination,
you have to set theQMC5883L.declinationproperty.sensor.get_bearing()# 87.20sensor.declination=10.02sensor.get_bearing()# 97.22The magnetic declination changes depending on the place and upon
time; there are some web services which give your current value.CalibrationValues returned by the magnetic sensor may be altered by several
factors, like misalignment of sensor's axes, asimmetries in the
sensor sensitivity, magnetic fields and magnetic (ferrous)
metals in the proximity of the sensor.Into thecalibration directorythere are
some tools that can be used to perform a simple 2D calibration
using the Earth's magnetic field.Once you have obtained the 3x3 calibration matrix, you can set
it into the driver using thecalibrationproperty and have
it automatically applied when calling theget_bearing()function.sensor.calibration=[[1.030,0.026,-227.799],[0.0255,1.021,1016.442],[0.0,0.0,1.0]]sensor.get_bearing()DocumentationRead themodule source codeand thechip Datasheet.
Package: rasta
rastaRasta (rāstā) is a Python based library specifically design to handle geospatial data especially in the context of navigation. Currently, one can use rasta to parse/process/visualize GPX, GTFS, GEOJSON data. In addition, there are modules to use REST API from HERE and OpenTripPlanner for the navigation.FeaturesParse GPX file and convert them to pandas dataframe in a single line of code. Finally able to visualize the tracks with kepler.gl based interactive map.Parse GTFS feed and visualize the network.Navigate with HERE Maps or OpenTripPlanned by using their respective REST APIs.InstallDirectly install from PyPI:pip install rastaAlternatively, clone this repo and install:git clone https://github.com/ikespand/rasta.git
cd rasta
python setup.py installTo visualize data with the kepler.gl, user needs to have Mapbox API key which provides the tiles. Go toMapbox.comto get an API key.UsageThere are many examples available in the example folder. Additionally, code is documented with docstrings.Using GPX tracksExamplesgpx_bicycle_tracks.pyandgpx_dmrc_yellow_line.pyshow the usage ofgpxmodule for parsing gpx file along with the data processing. For any generic GPX file:fromrasta.gpximportGpxParser# Load the gpx file (if timestamp is available then also calculate speed)gpx_instance=GpxParser("../tracks/BicyleRoute.gpx",calculate_distance=True)# Extract our data in a dataframedf=gpx_instance.data# Visaulize the tracks (You will need Mapbox API key for this step)html_path,vis=gpx_instance.visualize_route(MAPBOX_API_KEY=MAPBOX_API_KEY,open_browser=True)Using GTFS feedExamplegtfs_sample_london.pyis to have the visalization of GTFS feed from a given zip file. For a generic GTFS feed:fromrasta.gtfsimportGtfs# Parse our GTFS feedmy_gtfs=Gtfs("../tracks/gtfs_london.zip")# Visaulize the routes (You will need Mapbox API key for this step)my_gtfs.visualize_route(MAPBOX_API_KEY,"london")Interaction with REST API of OpenTripPlannerotp_visualize_from_rest.ipynbis a notebook to demonstrate the usage of  OpenTripPlanner's REST API with rasta. Let's say OTP server is ruuning then one could use:fromnavigate_with_otpimportGetOtpRouteimportpandasaspdimportnumpyasnp# Pass arguments for our query along with parameters for visulizationmy_otp_nav=GetOtpRoute(start_coord="28.658420, 77.230757",end_coord="28.544442, 77.206334",MAPBOX_API_KEY=MAPBOX_API_KEY,output_map_path="temporary_map",viz=False)my_otp_nav.addressgdf,html_path=my_otp_nav.extract_itinerary()Troubleshooting and some hintsWith keplergl>0.2.1 auto-centering for map data is not working (i.e. you will see San Frasnico as default). Therefore, if you face this issue then consider to downgrade to v0.2.0.Sometime, the issue of geopandas, fiona and GDAL appears due to some inter-dependencies. To mitigate it, simply uninstall all 3 anduse conda forge to install geopandas.If you are new to OTP, then try using docker solution which is documentedhere.TODOSupport for OpenStreetMap data coming from overpyGTFS validatorMore testsExtend documentationDeveloped at:
Package: rastachimp
RastaChimpRastaChimp is a utility library to perform topological processing of polygons vectorized from rasters, as returned by therasterio.features.shapes function:Simplification, using Douglas-Peucker:Shapely(and GEOS) can be used to simplify polygons but will create gaps and overlaps between polygons that share a boundary (even with preserve_topology=true)Smoothing, using the Chaikin methodDensifyRastaChimp decomposes the polygons into edges (using Shapely), applies an operation to them then rebuilds transformed polygons. It works well as long as the output of rasterio.features.shapes is in pixel coordinates (default) or the transform to world coordinates does not have a rotation component, which is usually the case. Because of limited floating precision, it may not work well in the more general case, although it could if the polygons are noded (for example, by using thebpol tool of v.clean in GRASS).Installpip install rastachimpUsageThe function to perform simplification issimplify_dp. As inputs, it takes the tuples (geometry, value) as output from rasterio.features.shapes and the tolerance (in the same unit as the input geometries). It returns an iterator of tuples (geometry, value), just like rasterio.features.shapes.fromrasterioimportfeaturesfromrastachimpimportas_shapely,simplify_dp# 2D array with classification valuesimage=np.array(....,dtype=np.uint8)# no transform => in pixel coordinatesshapes=features.shapes(image)# convert to Shapely geometry (features.shapes returns a GeoJSON dict)shapes=as_shapely(shapes)tolerance=2# simpl is an interator of tuples (geometry, value)simpl=simplify_dp(shapes,tolerance)IssuesReport issues athttps://github.com/gvellut/rastachimp/issuesTODOBetter detection and handling of bad inputsOther generalization algorithms (Visvalingam)Other smoothing algorithm (Bezier Curves)
Package: rastafari
RastafariRasterize vector features. This library is built to rasterize emission sources in the CLAIR air quality modelling system. In contrast to most available libraries used to rasterize vector features, this library produces rasters with weights proportional to the fraction of each cell that is covered by a feature.Features:line rasterization using DDA algorithm, producing weights proportional to fraction of line intersected by each cellpolygon rasterization using even-odd rule, producing weights proportional to fraction of polygon included in each cellmass-consistent resampling of a raster using inverse nearest neighbour algorithm, allowing for different projections in source and targetSee rastafari/tests for examples.InstallUse pip to install Rastafari:python -m pip install rastafariDevelopmentTo install Rastafari in a local venv for development, run:git clone https://gitlab.com/foclair/rastafari.gitcd rastafaripython -m venv .venv. .venv/bin/activatepython -m pip install -U pippython -m pip install cython wheelRASTAFARI_USE_CYTHON=1 python -m pip install --no-build-isolation -e .[test]Rastafari usespre-commit.  Install it and runpre-commit installto run its checks every time you commit.  Run the checks
manually withpre-commit run -apytestis used as a test runner:pytestRastafari comes fully typed.  Usemypyto check the type annotations:mypy .All these tools will be run in CI in case you forget.MaintenanceThis package is maintained byDavid Segerssonat SMHI.
Package: raster2ML
raster2MLPurposeraster2MLis a utility designed to process a Raster file and its corresponding shapefile to produce a raster mask file. The mask assigns class names based on the specified field in the shapefile.OutputThe result is an 8-bit PNG file where each distinct class from the shapefile is represented by a different color.Usage1. raster2png:Converts a Raster image into an 8-bit PNG.Command:test_raster2png.py[-h]src_rasteroutput_folderExample:!pythontutorial/test_raster2png.pytutorial/in_folder/myraster.tiftutorial/out_folderView Source Code2. shp2labelme:Generate alabelmeJSON structure using raster and shapefile data.Command:test_shp2labelme.py[-h]raster_fileshapefile_pathlabel_fieldExample:!pythontutorial/test_shp2labelme.pytutorial/out_folder/myraster_8bit.pngtutorial/in_folder/myvector.shpidlinView Source Code3. labelme2mask:Defines a set of functions that transform a givenlabelmeJSON file into a labeled image (mask).Command:test_labelme2mask.py[-h]source_json_filetarget_folderExample:!pythontutorial/test_labelme2mask.pytutorial/out_folder/myraster_8bit.jsontutorial/out_folderView Source CodeDependenciesEnsure you have all the necessary dependencies installed. Refer torequirements.txtfor a list of required packages.
Package: raster2points
raster2pointsConvert one or multiple raster images to points.
Tool will read first input raster and extract lat/lon coordinates and values
for all pixels which have data. Optional it calculates geodesic area for each point based on pixel size.
Successive input rasters will use data mask from first input raster.Returns a Pandas dataframe, CLI will export results as CSV file.Input files can be local file paths or S3 paths, or a mix. For reading from
S3, you'll needAWS credentials configured,
such as with a profile in~/.awsand anAWS_PROFILEvariable in your environment.Multi-worker only works with S3 inputs, not local files.Installation and DependenciesThis module uses rasterio and requiresGDAL>=1.11.
Use pip to install.pipinstallraster2pointsCLI Usageraster2csv.py[-h][--col_namesCOL_NAMES[COL_NAMES...]][--separator{,,;,t}][--max_block_sizeMAX_BLOCK_SIZE][--calc_area[CALC_AREA]][--workersWORKERS]INPUT[INPUT...]OUTPUTPython UsageYou can also use the module directly in python. It will return a
Pandas dataframe with your data.Get Pandas data framefromraster2pointsimportraster2dfraster1="path/to/file1.tif"raster2="path/to/file2.tif"df=raster2df(raster1,raster2,col_names=["name1","name2"],calc_area=True)print(df.columns)print(df.dtypes)df.head()Export to TSVfromraster2pointsimportraster2csvraster1="path/to/file1.tif"raster2="path/to/file2.tif"output="path/to/newfile.tsv"raster2csv(raster1,raster2,output,col_names=["name1","name2"],separator="\t",calc_area=True)
Package: raster2polygon
Raster 2 PolyonExtracting vector polygons from raster imagesInstallationpip install raster2polygonExample :fromraster2polygonimportpolygonizepolygonize("data/masks_v2/4","labels.geojson")Args :input_path: Path of the directory where the image files are stored.
output_path: Path of the output file.
remove_inputs: Clears the input image after geojson is produced
simplify_tolerance : the simplification accuracy as max. percentage of the arc length, in [0, 1] , Percentage Tolerance= ( Tolerance in Meters​ / Arc Length in Meters)×100
merging_distance_threshold : Minimum distance to define adjacent polygons, in meters , default 0.5 m
area_threshold (float, optional): Threshold for filtering polygon areas. Defaults to 1 sqm.
Package: raster2xyz
Alternative and faster (vectorized) version of gdal2xyz.py
(https://svn.osgeo.org/gdal/trunk/gdal/swig/python/scripts/gdal2xyz.py)Builded on top of GDAL, Numpy and Pandas.input file:geotiffoutput file:ASCII Gridded
XYZInstallInstall fromPYPI:$ pip install raster2xyzUsageCommand Line$raster2xyz[-h]input_rasterout_csvpositionalarguments:input_rasterinput_rasterfilepathout_csvout_csvfilepathoptionalarguments:-h,--helpshowthishelpmessageandexitImporting modulefromraster2xyz.raster2xyzimportRaster2xyzinput_raster="input_raster.tif"out_csv="/tmp/out_xyz.csv"rtxyz=Raster2xyz()rtxyz.translate(input_raster,out_csv)RequirementsNumpy:http://www.numpy.org/Pandas:http://pandas.pydata.org/GDAL:http://www.gdal.org/About authorDeveloped by Cayetano Benavent. GIS Analyst at Geographica.http://www.geographica.gsLicenseThis program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
Package: raster4ml
When geospatial raster data is concerned in a machine learning pipeline, it is often required to extract meaningful features, such as vegetation indices (e.g., NDVI, EVI, NDRE, etc.) or textures. This package provides easy-to-use functions that can automatically calculates the features with one or several lines of codes in Python. It also has the functionality of extracting statistics based on shapefile (i.e., point or polygon) from a raster data. Any type of raster data is supported regardless of satellite or UAVs.Key FeaturesStack raster bandsAutomatically calculate vegetation indices (supports 350+ indices)Extract raster values based on shapefileClip raster based on polygonDocumentationDetailed documentation with tutorials can be found here:https://raster4ml.readthedocs.io/How to Use?Stacking bandsstack_bands(image_paths=['Band_1.tif', 'Band_2.tif', 'Band_3.tif',
                         'Band_4.tif', 'Band_5.tif', 'Band_6.tif'],
            out_file='Stack.tif')Vegetation index calculationVI = VegetationIndices(image_path='Landsat8.tif',
                       wavelengths=[442.96, 482.04, 561.41, 654.59, 864.67, 1608.86, 2200.73])
VI.calculate(out_dir='vegetation_indices')Dynamic visualization in Jupyter Notebookm = Map()
m.add_raster(image_path='Landsat8.tif', bands=[4, 3, 2])Output:How to Install?DependenciesRaster4MLis built on top ofgeopandas,rasterio,fiona,pyproj,rtree,shapely,numpy, andpandas.Virtual EnvironmentIt is prefered to use a virtual environment for working with this package. UseAnacondaorMinicondato create a seperate environment and then install the package and its dependencies there.conda create --name raster4ml python=3
conda activate raster4mlWindowsTo install on Windows, first download the wheel files forGDAL,rasterio, andfionafromChristoph Gohlke's website(ðŸ¤—Thanks ChristophðŸ¤—). Go to his website, pressCtrl+Fand type gdal. Download the GDAL file that mostly matches your computer configuration (64-bit or 32-bit) and Python version.After downloading it,cdinto the downloaded directory while theraster4mlenvironment is activated. Then install usingpip. Do the same forrasterioandfiona.pip install GDALâ€‘3.4.3â€‘cp310â€‘cp310â€‘win_amd64.whl
pip install rasterioâ€‘1.2.10â€‘cp310â€‘cp310â€‘win_amd64.whl
pip install Fionaâ€‘1.8.21â€‘cp310â€‘cp310â€‘win_amd64.whlIf these three are installed, the rest of the dependencies can be installed directly throughRaster4ML'spipdistribution.pip install raster4mlTutorialsThere are two tutorials provided. Find them indocs/tutorials.Questions?Please report bugs athttps://github.com/remotesensinglab/raster4ml/issues.If you are reporting a bug, please include:Your operating system name and version.Any details about your local setup that might be helpful in troubleshooting.Detailed steps to reproduce the bug.
Package: rasterarea
rasterareaThis package provides a interactive map inherit from geemap and ipyleaflet. Visuallized GRACE data, pick a point and get the time series plot of the value in this point. Calculate the area of the pixel and more!Free software: MIT licenseDocumentation:https://Feng96.github.io/rasterareaInstall InstructionPlease have GDAL and localtileserver installed in your envirmental by command:conda install -c conda-forge gdalpip install localtileserverFeaturesInteractive Map from ipyleafletInherit toolbar from geemapVisuallized GRACE satellite dataPick a point, return a plot of the time series plot of the value of the pointCreditsThis package was created withCookiecutterand thegiswqs/pypackageproject template.
Package: rasterbox
rasterboxProject on PyPiData holder and manipulator for raster images
The purpose of rasterbox is to allow seemless storage, and retrieval of raw raster data and target labels associated with the data. This is a hyper-specific use-case, and likely doesn't warrant a package, yet here we are.Installation - TODOUsageTo create a rasterbox object, you need only supply the path to your binary raster files, the path to the associated targets, and a list of available targets.
Package: raster-codecs
numcodecs-rasterProvides a lightweight wrapper overimagecodecsimplementing thenumcodecsinterface.  This lets us use the compressions provided byimagecodecsin zarr arrays.Thenumcodecsinterface is built around python's buffer protocol.  Numpy implements this buffer protocol, andimagecodecsis built around numpy.  So this all works out pretty well.Supported compressionsJPEGDeflate