Saravanan666/pypi-org huggingface dataset:
Package: osmdiff
I am considering moving my open source repos to sourcehut. For now, I mirror this repo at sourcehut, and issues are still on here. The plan is to move the issue tracker to sourcehut next, and then archive this repo. No, I don't have a timeline.osmdiffA read-only interface to OpenStreetMap change APIs and files. See alsopyosmwhich can do similar things.Python 3.7+Installingpip install osmdiffUsageReadingRetrieve the latest replication diff from the OSM API:>>>fromosmdiffimportOSMChange>>>o=OSMChange()>>>o.frequency="minute"# the default>>>o.get_state()# retrieve current sequence ID>>>o.sequence_number2704451>>>o.retrieve()# retrieve from API>>>oOSMChange(677created,204modified,14deleted)Read a replication diff from a file:>>>fromosmdiffimportOSMChange>>>o=OSMChange(file="test_osmchange.xml")>>>oOSMChange(831created,368modified,3552deleted)Retrieve the latest Augmented Diff from Overpass:>>>fromosmdiffimportAugmentedDiff>>>a=AugmentedDiff()>>>a.get_state()>>>a.sequence_number2715051>>>a.retrieve()>>>aAugmentedDiff(747created,374modified,55deleted)Read an augmented diff file:>>>fromosmdiffimportAugmentedDiff>>>a=AugmentedDiff(file="test_adiff.xml")>>>aAugmentedDiff(2329created,677modified,39deleted)Inspect contentsGet all the things thatchris66has created:>>> [n for n in a.create if n.attribs["user"] == "chris66"]
[Node 5221564287, Node 5221564288, Node 5221564289, Node 5221564290, Node 5221564291, Node 5221564292, Node 5221564293, Node 5221564294, Node 5221564295, Node 5221564296, Node 5221564297, Node 5221564298, Node 5221564299, Node 5221564301, Node 5221564302, Node 5221564303, Node 5221564304, Way 539648222 (5 nodes), Way 539648223 (5 nodes), Way 539648323 (5 nodes)]Get allresidentialways that were modified:>>>[n["new"]fornina.modifyiftype(n["new"])==Wayandn["new"].tags.get("highway")=="residential"][Way34561958(3nodes),Way53744484(6nodes),Way53744485(6nodes),Way122650942(3nodes),Way283221266(4nodes),Way344272652(5nodes),Way358243999(13nodes),Way410489319(5nodes),Way452218081(10nodes)]Get all ways that were changed toresidentialfrom something else:>>>[n["new"]fornina.modifyiftype(n["new"])==Wayandn["new"].tags.get("highway")=="residential"andn["old"].tags["highway"]!="residential"][Way410489319(5nodes),Way452218081(10nodes)]Inspect details:>>>w=[n["new"]fornina.modifyifn["new"].attribs["id"]=="452218081"]>>>w[Way452218081(10nodes)]>>>w[0]Way452218081(10nodes)>>>w[0].tags{'highway':'residential'}>>>w[0].attribs{'id':'452218081','version':'2','timestamp':'2017-11-10T13:52:01Z','changeset':'53667190','uid':'2352517','user':'carths81'}>>>w[0].attribs{'id':'452218081','version':'2','timestamp':'2017-11-10T13:52:01Z','changeset':'53667190','uid':'2352517','user':'carths81'}>>>w[0].bounds['12.8932677','43.3575917','12.8948117','43.3585947']
Package: osmeterium
OSMeteriumThe osmeterium is a defensive organ found in all papilionid larvae, in all stages.A simple wrapper for Popen to meet MapColonies org needs for running background processes and pipe the output.UsageAsynct=run_command_async('ping -c 5 www.google.com',(lambdax:print('Hey this stdout output{0}'.format(x))),(lambdax:print('Hey this stderr output{0}'.format(x))),(lambday:print('This is exit code ${0}'.format(y))),(lambda:print('Command success')))#  return a Thread Objectt.join()Syncrun_command('ping -c 5 www.google.com',(lambdax:print('Hey this stdout output{0}'.format(x))),(lambdax:print('Hey this stderr output{0}'.format(x))),(lambday:print('This is exit code ${0}'.format(y))),(lambda:print('Command success')))
Package: osm-find-first
===============================OpenStreetMap First Version Finder===============================.. image:: https://badge.fury.io/py/osm-find-first.png:target: http://badge.fury.io/py/osm-find-first.. image:: https://travis-ci.org/rory/osm-find-first.png?branch=master:target: https://travis-ci.org/rory/osm-find-first.. image:: https://pypip.in/d/osm-find-first/badge.png:target: https://pypi.python.org/pypi/osm-find-firstFind the first version, incl. datetime, of objects in the OSM database* Free software: GNU GPL v3 (or later)* Documentation: https://osm-find-first.readthedocs.org.Features--------Downloads metadata about objects in OpenStreetMap, so that you can see when they were created. Works with CSV files to store whatHistory-------0.1.0 (2014-01-11)---------------------* First release on PyPI.
Package: osm-flex
osm-flexPython package for flexible data extraction from OpenStreetMap. This packages allows todownload OSM data dumps[optional] clip to desired shapeextract specific features to geodataframes[optional] simplify results based on geospatial operationsDocumentationPlease refer to theReadTheDocsof this project for the full documentation of all functions.Installationconda create -n osm-flex cartopy geopandas
conda activate osm-flex
pip install osm-flexNOTEThis package requires shapely v2.0 or later. Installing this package in an existing environment might overwrite older versions.The (optional) clipping functionalities require manual installation of osmconvert or osmosis. See tutorial 1 for details.ExampleDownload osm data for Switzerland from geofabrik.importosm_flex.downloadasdliso3='CHE'dl.get_country_geofabrik(iso3)Extract all buildings related to education and extract all polygons with forests.importosm_flex.extractasexfromosm_flex.configimportOSM_DATA_DIRpath_che_dump=OSM_DATA_DIR.joinpath('switzerland-latest.osm.pbf')gdf_ch_education=ex.extract_cis(path_che_dump,'education')gdf_ch_forest=ex.extract(path_che_dump,'multipolygons',['landuse','name'],"landuse='forest'")Drop all education building units that are contained within larger education buildings.importosm_flex.simplifyassygdf_ch_education=sy.rremove_contained_polys(gdf_ch_education)Running TestsFollow installation instructions. Then,python -m pip install -e "./[tests]"
pytest
Package: osmgeocoder
Python implementation for a OSM / Openaddresses.io Geocoder.This geocoder is implemented in PostgreSQL DB functions as much as possible, there is a simple API and an example flask app included.You will need PostgreSQL 9.5+ (or 11.0+ for Openaddresses.io) with PostGIS installed as well as some disk space and data-files from OpenStreetMap and (optionally) OpenAddresses.io.Data import will be done viaOmniscale's imposm3and a supplied python script to import the openaddresses.io data.Optionally you can use thelibpostal machine learning address classifierto parse addresses supplied as input to the forward geocoder.For formatting the addresses from the reverse geocoder theworldwide.ymlfromOpenCageData address-formatting repositoryis used to format the address according to customs in the country that is been encoded.SeeREADME.mdin therepositoryfor more information.
Package: osmgraph
osmgraph========Create [networkx](https://networkx.github.io/) graphs from OpenStreetMap (OSM)data.  `osmgraph` uses[imposm-parser](https://github.com/omniscale/imposm-parser) for parsingOpenStreetMap XML (including bz2) and PBFfiles and [osmqa-parser](https://github.com/mapkin/osmqa-parser) for parsing[OSM QA tiles](http://osmlab.github.io/osm-qa-tiles/).Usage-----```>>> import osmgraph>>> g = osmgraph.parse_file(filename)```Graph Structure---------------`osmgraph` parses OSM data to create a networkx [directed graph](https://networkx.readthedocs.org/en/stable/reference/classes.digraph.html). OSM nodes correspond directly to the nodes in the directed graph. The OSM tags become attributes of the node. Additionally `osmgraph` adds a `coordinate` attribute containing the (lon, lat) tuple of the node's coordinates.For example:```>>> g = osmgraph.parse_file('boston_massachusetts.osm.bz2')```Given the following XML node:```<node id="665539692" lat="42.3971185" lon="-71.0207486" version="2" timestamp="2014-06-25T04:45:25Z" changeset="23135192" uid="422979" user="Parcanman"><tag k="railway" v="level_crossing"/></node>``````>>> g.node[665539692]{'coordinate': (-71.0207486, 42.3971185), 'railway': 'level_crossing'}```Similarly, the nodes comprising an OSM way form the graph's edges. The way's attributes are duplicated across the edges. For example, given the following XML way:```<way id="8636532" version="13" timestamp="2011-01-14T00:47:46Z" changeset="6963395" uid="381909" user="JessAk71"><nd ref="61448456"/><nd ref="1102764005"/><nd ref="1099120555"/><nd ref="1099120556"/><nd ref="61420229"/><nd ref="61420222"/><nd ref="61420249"/><nd ref="61420207"/><nd ref="61420214"/><nd ref="643774918"/><tag k="name" v="North Washington Street"/><tag k="width" v="30.2"/><tag k="oneway" v="yes"/><tag k="source" v="massgis_import_v0.1_20071008193615"/><tag k="highway" v="primary"/><tag k="condition" v="fair"/><tag k="attribution" v="Office of Geographic and Environmental Information (MassGIS)"/><tag k="massgis:way_id" v="134349"/></way>``````>>> g[61448456][1102764005]{'attribution': 'Office of Geographic and Environmental Information (MassGIS)','condition': 'fair','highway': 'primary','massgis:way_id': '134349','name': 'North Washington Street','oneway': 'yes','source': 'massgis_import_v0.1_20071008193615','width': '30.2'}```Ways that are not oneway roads will have edges in both directions.See Also--------* [networkx](https://networkx.github.io)* [OSM QA Tiles](https://osmlab.github.io/osm-qa-tiles/)* [imposm.parser](https://github.com/omniscale/imposm-paser)
Package: osm-graph
osm-graphis a package for NetworkX and OpenStreetMap.%matplotlib inline
import networkx as nx
from osm_graph import OsmGraph
og = OsmGraph(35.7158, 139.8741)
nd1 = og.find_node(35.7165, 139.8738)
nd2 = og.find_node(35.7153, 139.8752)
path = nx.dijkstra_path(og.graph, nd1, nd2)
g = nx.subgraph(og.graph, path)
ax = og.draw_graph()
og.draw_graph(graph=g, ax=ax, edge_color='r', width=2);RequirementsPython 3, networkx, matplotlib, overpyFeaturesThis is a sample. So it may not be efficient.Setup$ pip install osm-graphHistory0.0.1 (2018-6-9)first release
Package: osmhm_site
IntroductionThis is a frontend for use with the [OSM Hall Monitor](https://github.com/ethan-nelson/osm_hall_monitor) monitoring package. Rather than using a command line to add things to track or to view log events, the website provides the ability to add any trackable things, review log events, and support restrictions to this data via OSM authentication.InstallingNote: Python is required and virtualenv is _strongly_ recommended..cd osmhm_sitevirtualenv envenv/bin/python setup.py developenv/bin/initialize_osmhm_db development.inienv/bin/pserve development.iniDependencies include [OSM Diff Tool](https://github.com/ethan-nelson/osm_diff_tool) and [OSM Hall Monitor](https://github.com/ethan-nelson/osm_hall_monitor).Deploying to Cloud ServicesThe repository contains a [Procfile](https://devcenter.heroku.com/articles/procfile) and sample scripts to run the web and process workers (including a custom SendGrid implementation). Once you deploy the repo, you will need to run theinitialize_db.pyscript to prepare the database. Then, the first user to log in will be set as the server owner.
Package: osm-iterator
This code loads .osm file and allows to call function on all OSM objects in dataset.Installationpip install osm-iteratorLikelypip3 install osm-iteratorifpippoints to Python2 pip.It is distributed as anosm_iteratorPyPI package.Usage exampleDownload data and show itThis usage example includes downloading data usingrequestslibrary, that you may need to install (also available via pip).from osm_iterator import osm_iterator
import requests
import os.path

def download_from_overpass(query, output_filepath):
  print(query)
  url = "http://overpass-api.de/api/interpreter"
  r = requests.get(url, params={'data': query})
  result = r.text
  with open(output_filepath, 'w') as file:
      file.write(str(result))

def show_places(element):
    place_tag = element.get_tag_value("place")
    name_tag = element.get_tag_value("name")
    osm_object_url = element.get_link()
    if place_tag != None:
        print(name_tag, "(", place_tag, ") is ", osm_object_url)

filepath = "places_in_Kraków.osm"
query = """
[out:xml][timeout:2500];
area[name='Kraków']->.searchArea;
(
  node["place"](area.searchArea);
  way["place"](area.searchArea);
  relation["place"](area.searchArea);
);
out center;
"""

if os.path.isfile(filepath) == False:
    download_from_overpass(query, filepath)
osm = osm_iterator.Data(filepath)
osm.iterate_over_data(show_places)Load data onlyfrom osm_iterator import osm_iterator

global osm_object_store
osm_object_store = []

def record_objects(element):
    global osm_object_store
    print(element.element.tag, element.element.attrib['id'])
    osm_object_store.append({"type": element.get_type(), "id": element.get_id()})

filepath = "output.osm"
osm = osm_iterator.Data(filepath)
osm.iterate_over_data(record_objects)
for entry in osm_object_store:
    print(entry)Running testsnosetests3orpython3 -m unittestorpython3 tests.pyHistoryDesign explanation: this code has deeply suboptimal handling of pretty much everything. For start, all data is loaded into memory and then duplicated in-memory dataset is created.As result, attempt to process any large datasets will cause issues due to excessive memory consumption.This situation is consequence of following factsThis code was written during my first attempt to process OSM data using PythonAPI allows (at least in theory) to painlessly switch to real iterator that is not loading all data into memory at onceSo far this was good enough for my purposes so I had no motivation to spend time on improving something that is not a bottleneckThough, if someone has good ideas for improvements (especially in form of a working code) - comments and pull requests are welcomed.
Package: osmium
This library provides Python bindings for theLibosmiumC++
library, a library for working with OpenStreetMap data in a fast and flexible
manner.Installationpyosmium can be installed with pip:pip install osmiumThe Pypi source package already comes bundled with a matching version of
libosmium, protozero and pybind11. Pyosmium additionally depends on
expat, libz, libbz2 and Boost variant and iterator. You need to install
development packages for these libraries. On Debian/Ubuntu do:sudo apt-get install build-essential cmake libboost-dev \
                   libexpat1-dev zlib1g-dev libbz2-devPython >= 3.6 is supported. Pypy is known not to work.DocumentationThe documentation for the latest release is available atosmcode.org.If you find bugs or have feature requests, please report those in theGithub issue tracker. For general questions about using pyosmium you
can contanct theOSM development mailing listor ask onOSM help.ExamplesThe package contains anexampledirectory with small examples on how to use
the library. They are mostly ports of the examples in Libosmium and
osmium-contrib.FineprintPyosmium is available under the BSD 2-Clause License. See LICENSE.TXT.The source code can be found onGitHub.
Package: osml-imagery-toolkit
OversightML Imagery ToolkitThe OversightML Imagery Toolkit is a Python package that contains image processing and photogrammetry routines commonly
used during the analysis of imagery collected by satellites and unmanned aerial vehicles (UAVs). It builds upon GDAL
by providing additional support for images compliant with the National Imagery Transmission Format (NITF), Sensor
Independent Complex Data (SICD), and Sensor Independent Derived Data (SIDD) standards.This library contains four core packages under theaws.osmlnamespace:photogrammetry: convert locations between the image (x, y) and geodetic (lon, lat, elev) coordinate systemsgdal: utilities to work with datasets loaded by GDALimage_processing: common image manipulation routinesfeatures: common geospatial feature manipulation routinesDocumentationAPIs: You can find API documentation for the OSML Imagery Toolkit hosted on ourGitHub project page.
If you are working from the source code runningtox -e docswill trigger the Sphinx documentation build.Example Notebooks: Example notebooks for some operations are in theexamplesdirectoryInstallationThis software is available through a Python Package Index.
If your environment has a distribution, you should be able to install it using pip:pipinstallosml-imagery-toolkit[gdal]If you are working from a source code, you can build and install the package from the root directory of the
distribution.pipinstall.[gdal]Note that GDAL is listed as an extra dependency for this package. This is done to facilitate environments that either
don't want to use GDAL or those that have their own custom installation steps for that library. Future versions of
this package will include image IO backbones that have fewer dependencies.ContributingThis project welcomes contributions and suggestions. If you would like to submit a pull request, see ourContribution Guidefor more information.SecuritySeeCONTRIBUTINGfor more information.LicenseThis library is licensed under the MIT-0 License. See theLICENSEfile.
Package: osml-model-runner-test
OSML Model Runner TestThis package contains the integration tests for OSML applicationTable of ContentsGetting StartedPrerequisitesInstallation GuideDocumentationBuild and Local TestingRunning Tests in DockerRunning LoadTestSupport & FeedbackSecurityLicenseGetting StartedPrerequisitesFirst, ensure you have installed the following tools locallyaws clidockertoxInstallation GuideCloneosml-model-runner-testpackage into your desktopgitclonehttps://github.com/aws-solutions-library-samples/osml-model-runner-test.gitRuntoxto create a virtual environmentcdosml-model-runner-test
toxDocumentationYou can find documentation for this library in the./docdirectory. Sphinx is used to construct a searchable HTML
version of the API documents.tox-edocsBuild and Local TestingYou can run the hydra tests against your dev account by exporting the required parameters and using the pytest CLI by
using the demo utilitybin/run_test.sh. Do not forget to load up your AWS credentials into your terminal, please follow thisguideon how to load your aws credentials.export ACCOUNT="INSERT YOUR ACCOUNT"
export IMAGE_TYPE="INSERT YOUR IMAGE TYPE" # small, medium, large, or tile.<tif|ntf|jpeg|png>
export MODEL_TYPE="INSERT YOUR MODEL TYPE" # centerpoint, flood, or aircraft

./bin/run_test.sh ${IMAGE_TYPE} ${MODEL_TYPE} NITF JPEG us-west-2 $ACCOUNT_NUMBERExamples:./bin/run_test.sh small centerpoint NITF JPEG us-west-2 $ACCOUNT_NUMBER

./bin/run_test.sh medium flood NITF JPEG us-west-2 $ACCOUNT_NUMBER

./bin/run_test.sh large centerpoint NITF JPEG us-west-2 $ACCOUNT_NUMBER

./bin/run_test.sh tile.tif aircraft NITF JPEG us-west-2 $ACCOUNT_NUMBERIf you prefer, you can execute the python script:python3 bin/process_image.py --image small --model centerpointTo print out the usage for python script, execute:python3 bin/process_image.py --helpRunning Tests in DockerArguments can be passed in to docker run in the same way that they are provided to the shell script.
For example, the container can be built and run as follows:docker build . -t model-runner-hydra-test:latest
docker run -v ~/.aws:/root/.aws model-runner-hydra-test:latest small centerpoint NITF JPEG us-west-2 $ACCOUNT_NUMBERCredentials from the user's account are volume mounted into the container's root directory.Running LoadTestYou can run the load test against your dev account and be able to determine the cost and the performance.Please adviseit can potentially rack up your AWS bills!Examples:python3 bin/run_load_test.py --periodic_sleep 60 --processing_window 1To print out the usage for this load test script, execute:python3 bin/run_load_test.py --helpSupport & FeedbackTo post feedback, submit feature ideas, or report bugs, please use theIssuessection of this GitHub repo.If you are interested in contributing to OversightML Model Runner, see theCONTRIBUTINGguide.SecuritySeeCONTRIBUTINGfor more information.LicenseMIT No Attribution Licensed. SeeLICENSE.
Package: osml-models
OSML ModelsThis package contains sample models that can be used to test OversightML installations without incurring high compute costs typically associated with complex Computer Vision models. These models implement an interface compatible with SageMaker and are suitable for deployment as endpoints with CPU instances.Table of ContentsGetting StartedPrerequisitesInstallation GuideDocumentationBuild and Local TestingSupport & FeedbackResourcesSecurityLicenseGetting StartedPrerequisites:First, ensure you have installed the following tools locallydockerInstallation GuideCloneosml-modelspackage into your desktopgitclonehttps://github.com/aws-solutions-library-samples/osml-models.gitDocumentationYou can find documentation for this library in the./docdirectory. Sphinx is used to construct a searchable HTML
version of the API documents.tox-edocsBuild and Local TestingTo build the container, it uses the defaultDockerfilefrom the root of this repository. If you want to change to anotherDockerfile, replace the.with the newDockerfilepath.dockerbuild.-tosml-models:latestNote: TheMODEL_SELECTIONenvironment variable can be used to pick the model to run. Currently, we support 3 different types of a model and below are the appropriate naming convention:centerpointfloodaircraftIn one terminal, run the following command to start the server:dockerrun-p8080:8080-eMODEL_SELECTION=${MODEL_SELECTION}osml-models:latestIn another terminal to invoke the rest server and return the inference on a single tile, run the following command from the root of this repository:curl-Ilocalhost:8080/ping
curl--requestPOST--data-binary"@<imagery file>"localhost:8080/invocationsExample:curl --request POST --data-binary "@assets/images/2_planes.tiff" localhost:8080/invocationsExecuting above should return:{"type": "FeatureCollection", "features": [{"geometry": {"coordinates": [0.0, 0.0], "type": "Point"}, "id": "7683a11e4c93f0332be9a4a53e0c6762", "properties": {"bounds_imcoords": [204.8, 204.8, 307.2, 307.2], "detection_score": 1.0, "feature_types": {"sample_object": 1.0}, "image_id": "8cdac8849cae2b4a8885c0dd0d34f722"}, "type": "Feature"}]}Support & FeedbackOversightML Models are maintained by AWS Solution Architects.
It is not part of an AWS service and support is provided best-effort by the OversightML community.To post feedback, submit feature ideas, or report bugs, please use theIssuessection of this GitHub repo.If you are interested in contributing to OversightML Models, see theCONTRIBUTINGguide.ResourcesAircraft ModelsSecuritySeeCONTRIBUTINGfor more information.LicenseMIT No Attribution Licensed. SeeLICENSE.