SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
Esri International User Conference | San Diego, CA
Technical Workshops | Tuesday, July 12th


Python: Integrating Standard and
Third-Party Libraries
Jason Scheirer
Other Sessions
•   Building Tools with Python (Technical Workshop)

     -   Thursday 10:15AM 9

•   Getting Started With Map Algebra Using the Raster Calculator and Python (Demo Theater Presentation)

     -   Wednesday 10:00AM Exhibit Hall C (Spatial Analysis Demo Theater)

•   Python - Analyzing your GPS tracking data (Demo Theater Presentation)

     -   Thursday 11:00AM Exhibit Hall C (Spatial Analysis Demo Theater)

•   Python - Automating Geodatabase Administration (Tech Workshop 20 Minute)

     -   Thursday 11:05AM 23 B

•   Python - Creating an ArcGIS Script Tool (Demo Theater Presentation)

     -   Tuesday 4:00PM Exhibit Hall C (Spatial Analysis Demo Theater)

•   Python - Getting Started (Technical Workshop)

     -   Tuesday 1:30PM 2
     -   Thursday 8:30AM 2
Other Sessions (continued)
•   Python - Getting to know the Python Window (Demo Theater Presentation)

     -   Tuesday 10:00AM Exhibit Hall C (Spatial Analysis Demo Theater)

•   Python - Improving the Performance of your Script Tools (Tech Workshop 20 Minute)

     -   Tuesday 8:30AM 6 A

•   Python - Raster Analysis (Technical Workshop)

     -   Tuesday 3:15PM 6 C
     -   Wednesday 3:15PM 5 A/B

•   Python - Scripting for Map Automation (Technical Workshop)

     -   Tuesday 10:15AM 9
     -   Wednesday 3:15PM 9

•   Python - Spatial Analysis (Intermediate) (Technical Workshop)

     -   Tuesday 3:15PM 1 A/B
     -   Thursday 10:15AM 2
Other Sessions (yes, there are more)
•   Python - The Ease and Power of Cursors (Demo Theater Presentation)

     -   Tuesday 11:30AM Exhibit Hall C (Spatial Analysis Demo Theater)

•   Python Scripts - Using A Template (Demo Theater Presentation)

     -   Tuesday 11:00AM Exhibit Hall C (Spatial Analysis Demo Theater)

•   Road Ahead - Python Scripting Abilities

     -   Thursday 4:05PM 6 B
Python in ArcGIS
 •   Implementing geoprocessing script tools
      -   Creating an ArcGIS Script Tool (Tuesday 4:00PM)
      -   Building Tools with Python (Thursday 10:15AM)

 •   Automating workflows
      -   Gluing together other GP tools

      -   Scheduled tasks

 •   Integrating ArcGIS with other systems, other systems
     into ArcGIS
      -   Data interop: import/export
      -   Automating ArcGIS processes from other applications
      -   Preparing data from ArcGIS for consumption by other applications
Built-in Libraries
Batteries Included
 •   Libraries for many common tasks come with the
     language
     -   File formats: XML (DOM, SAX, ElementTree), JSON, CSV, .ZIP
         (zipfile)
     -   Networking: HTTP (urllib, urllib2), TCP/UDP (socket)
     -   Parallelism: threading, multiprocessing, subprocess
     -   Command line applications: optparse
     -   Paths, directories, files: sys, os, os.path
     -   User Interfaces: tkinter
     -   Data structures and algorithms: collections, itertools,
         heapq, struct, many more
     -   Date/time (time, datetime)
     -   Calling C++/C (ctypes)
Read the Docs!
•   Help file: ArcGIS 10.0 | Python 2.6 | Python Manuals
Read the Docs!
•   What’s installed: ArcGIS 10.0 | Python 2.6 | Module Docs
More Help

•   PyMOTW (Python Module of the Week)
    -   http://www.doughellmann.com/PyMOTW/
    -   Also available as a book
Example


            •   Summary Statistics in R
                -   Uses a third-party module for reading spatial data: maptools
                -   Only accepts shapefiles!
            •   Going to use two different system libraries:
                -   subprocess (Open/monitor other programs)
                -   re (Regular Expressions)



CopyFeatures to temporary Shapefile    Run R Script   Clean up temp file   Parse R Script’s Output




                                                                              Statistics!
Demo
But don’t reinvent the wheel!


  •   wget: Popular utility to download resources over
      HTTP/FTP
  •   Do I need it?
       -   urllib2 can download simple URLs
  •   But I need to follow links
       -   Don’t write a web spider in Python, use the –r option on
           wget
       -   Use subprocess, like in the previous example
Third-Party Libraries
The Cheese Shop
  •   http://pypi.python.org/pypi
  •   The official place for 3rd party Python modules
Some Interesting Modules
  •   PDF writing – reportlab
  •   Image manipulation – PIL
  •   (Messy) HTML – beautifulsoup
  •   Advanced graphing/plotting – matplotlib
  •   Advanced date/time handling – dateutil
  •   Excel
      -   Read – xlrd
      -   Write – xlwt
  •   Consuming .Net
      -   http://pythonnet.sourceforge.net/
  •   .docx Read/write – docx
      -   https://github.com/mikemaccana/python-docx
      -   This brings us to…
There’s No Installer!


  •   Find python.exe in your install, add it to %PATH%.
      Scripts too.
  •   Try pip:
       -   http://python-distribute.org/
  •   Or on the command line:
       -   python.exe setup.py install
  •   Look for it on an unofficial Python library builds site:
       -   http://www.lfd.uci.edu/~gohlke/pythonlibs/
Conclusion


  •   A lot of what you need is already there
  •   Amazing documentation at your fingertips, more online
  •   There are built-in ways of interfacing with non-Python
      utilities (great for using script tools to integrate into
      ArcGIS)
  •   There’s a HUGE ecosystem out there that probably
      already has what you need
Esri International User Conference 2011: Python: Integrating Standard and Third-Party Libraries

Mais conteúdo relacionado

Mais procurados

Protocol libraries the right way
Protocol libraries the right wayProtocol libraries the right way
Protocol libraries the right wayLeo Zhou
 
Buzzwords Numba Presentation
Buzzwords Numba PresentationBuzzwords Numba Presentation
Buzzwords Numba Presentationkammeyer
 
Scientific Plotting in Python
Scientific Plotting in PythonScientific Plotting in Python
Scientific Plotting in PythonJack Parmer
 
Python VS GO
Python VS GOPython VS GO
Python VS GOOfir Nir
 
Object Detection with Tensorflow
Object Detection with TensorflowObject Detection with Tensorflow
Object Detection with TensorflowElifTech
 
Numba: Flexible analytics written in Python with machine-code speeds and avo...
Numba:  Flexible analytics written in Python with machine-code speeds and avo...Numba:  Flexible analytics written in Python with machine-code speeds and avo...
Numba: Flexible analytics written in Python with machine-code speeds and avo...PyData
 
Map Analytics in Starcraft II
Map Analytics in Starcraft IIMap Analytics in Starcraft II
Map Analytics in Starcraft IIgy8
 
Go: Beyond the Basics
Go: Beyond the BasicsGo: Beyond the Basics
Go: Beyond the BasicsJoey Gibson
 
Accelerate Your Python* Code through Profiling, Tuning, and Compilation Part ...
Accelerate Your Python* Code through Profiling, Tuning, and Compilation Part ...Accelerate Your Python* Code through Profiling, Tuning, and Compilation Part ...
Accelerate Your Python* Code through Profiling, Tuning, and Compilation Part ...Intel® Software
 

Mais procurados (10)

Protocol libraries the right way
Protocol libraries the right wayProtocol libraries the right way
Protocol libraries the right way
 
Buzzwords Numba Presentation
Buzzwords Numba PresentationBuzzwords Numba Presentation
Buzzwords Numba Presentation
 
Scientific Plotting in Python
Scientific Plotting in PythonScientific Plotting in Python
Scientific Plotting in Python
 
Python VS GO
Python VS GOPython VS GO
Python VS GO
 
Object Detection with Tensorflow
Object Detection with TensorflowObject Detection with Tensorflow
Object Detection with Tensorflow
 
Numba: Flexible analytics written in Python with machine-code speeds and avo...
Numba:  Flexible analytics written in Python with machine-code speeds and avo...Numba:  Flexible analytics written in Python with machine-code speeds and avo...
Numba: Flexible analytics written in Python with machine-code speeds and avo...
 
Map Analytics in Starcraft II
Map Analytics in Starcraft IIMap Analytics in Starcraft II
Map Analytics in Starcraft II
 
Go: Beyond the Basics
Go: Beyond the BasicsGo: Beyond the Basics
Go: Beyond the Basics
 
FleetDB
FleetDBFleetDB
FleetDB
 
Accelerate Your Python* Code through Profiling, Tuning, and Compilation Part ...
Accelerate Your Python* Code through Profiling, Tuning, and Compilation Part ...Accelerate Your Python* Code through Profiling, Tuning, and Compilation Part ...
Accelerate Your Python* Code through Profiling, Tuning, and Compilation Part ...
 

Semelhante a Esri International User Conference 2011: Python: Integrating Standard and Third-Party Libraries

Esri South Africa Python for Everyone
Esri South Africa Python for EveryoneEsri South Africa Python for Everyone
Esri South Africa Python for EveryoneEsri South Africa
 
Reproducibility and automation of machine learning process
Reproducibility and automation of machine learning processReproducibility and automation of machine learning process
Reproducibility and automation of machine learning processDenis Dus
 
How to write a well-behaved Python command line application
How to write a well-behaved Python command line applicationHow to write a well-behaved Python command line application
How to write a well-behaved Python command line applicationgjcross
 
Python and GIS: Improving Your Workflow
Python and GIS: Improving Your WorkflowPython and GIS: Improving Your Workflow
Python and GIS: Improving Your WorkflowJohn Reiser
 
Overview of Modern Graph Analysis Tools
Overview of Modern Graph Analysis ToolsOverview of Modern Graph Analysis Tools
Overview of Modern Graph Analysis ToolsKeiichiro Ono
 
from ai.backend import python @ pycontw2018
from ai.backend import python @ pycontw2018from ai.backend import python @ pycontw2018
from ai.backend import python @ pycontw2018Chun-Yu Tseng
 
Cytoscape and External Data Analysis Tools
Cytoscape and External Data Analysis ToolsCytoscape and External Data Analysis Tools
Cytoscape and External Data Analysis ToolsKeiichiro Ono
 
Python For Audio Signal Processing ( PDFDrive ).pdf
Python For Audio Signal Processing ( PDFDrive ).pdfPython For Audio Signal Processing ( PDFDrive ).pdf
Python For Audio Signal Processing ( PDFDrive ).pdfshaikriyaz89
 
Monitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntopMonitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntopPyCon Italia
 
Analysing GitHub commits with R
Analysing GitHub commits with RAnalysing GitHub commits with R
Analysing GitHub commits with RBarbara Fusinska
 
Python in geospatial analysis
Python in geospatial analysisPython in geospatial analysis
Python in geospatial analysisSakthivel R
 
How to integrate python into a scala stack
How to integrate python into a scala stackHow to integrate python into a scala stack
How to integrate python into a scala stackFliptop
 
Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Fwdays
 
Practical automation for beginners
Practical automation for beginnersPractical automation for beginners
Practical automation for beginnersSeoweon Yoo
 
Matplotlib presentation 20 apr2013 final
Matplotlib presentation 20 apr2013   finalMatplotlib presentation 20 apr2013   final
Matplotlib presentation 20 apr2013 finalpythonsd
 
Presto as a Service - Tips for operation and monitoring
Presto as a Service - Tips for operation and monitoringPresto as a Service - Tips for operation and monitoring
Presto as a Service - Tips for operation and monitoringTaro L. Saito
 
HiPEAC 2019 Tutorial - Maestro RTOS
HiPEAC 2019 Tutorial - Maestro RTOSHiPEAC 2019 Tutorial - Maestro RTOS
HiPEAC 2019 Tutorial - Maestro RTOSTulipp. Eu
 
Monitorama 2015 Netflix Instance Analysis
Monitorama 2015 Netflix Instance AnalysisMonitorama 2015 Netflix Instance Analysis
Monitorama 2015 Netflix Instance AnalysisBrendan Gregg
 

Semelhante a Esri International User Conference 2011: Python: Integrating Standard and Third-Party Libraries (20)

Esri South Africa Python for Everyone
Esri South Africa Python for EveryoneEsri South Africa Python for Everyone
Esri South Africa Python for Everyone
 
Reproducibility and automation of machine learning process
Reproducibility and automation of machine learning processReproducibility and automation of machine learning process
Reproducibility and automation of machine learning process
 
Python ml
Python mlPython ml
Python ml
 
How to write a well-behaved Python command line application
How to write a well-behaved Python command line applicationHow to write a well-behaved Python command line application
How to write a well-behaved Python command line application
 
Python and GIS: Improving Your Workflow
Python and GIS: Improving Your WorkflowPython and GIS: Improving Your Workflow
Python and GIS: Improving Your Workflow
 
Overview of Modern Graph Analysis Tools
Overview of Modern Graph Analysis ToolsOverview of Modern Graph Analysis Tools
Overview of Modern Graph Analysis Tools
 
from ai.backend import python @ pycontw2018
from ai.backend import python @ pycontw2018from ai.backend import python @ pycontw2018
from ai.backend import python @ pycontw2018
 
PyData Boston 2013
PyData Boston 2013PyData Boston 2013
PyData Boston 2013
 
Cytoscape and External Data Analysis Tools
Cytoscape and External Data Analysis ToolsCytoscape and External Data Analysis Tools
Cytoscape and External Data Analysis Tools
 
Python For Audio Signal Processing ( PDFDrive ).pdf
Python For Audio Signal Processing ( PDFDrive ).pdfPython For Audio Signal Processing ( PDFDrive ).pdf
Python For Audio Signal Processing ( PDFDrive ).pdf
 
Monitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntopMonitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntop
 
Analysing GitHub commits with R
Analysing GitHub commits with RAnalysing GitHub commits with R
Analysing GitHub commits with R
 
Python in geospatial analysis
Python in geospatial analysisPython in geospatial analysis
Python in geospatial analysis
 
How to integrate python into a scala stack
How to integrate python into a scala stackHow to integrate python into a scala stack
How to integrate python into a scala stack
 
Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"Travis Oliphant "Python for Speed, Scale, and Science"
Travis Oliphant "Python for Speed, Scale, and Science"
 
Practical automation for beginners
Practical automation for beginnersPractical automation for beginners
Practical automation for beginners
 
Matplotlib presentation 20 apr2013 final
Matplotlib presentation 20 apr2013   finalMatplotlib presentation 20 apr2013   final
Matplotlib presentation 20 apr2013 final
 
Presto as a Service - Tips for operation and monitoring
Presto as a Service - Tips for operation and monitoringPresto as a Service - Tips for operation and monitoring
Presto as a Service - Tips for operation and monitoring
 
HiPEAC 2019 Tutorial - Maestro RTOS
HiPEAC 2019 Tutorial - Maestro RTOSHiPEAC 2019 Tutorial - Maestro RTOS
HiPEAC 2019 Tutorial - Maestro RTOS
 
Monitorama 2015 Netflix Instance Analysis
Monitorama 2015 Netflix Instance AnalysisMonitorama 2015 Netflix Instance Analysis
Monitorama 2015 Netflix Instance Analysis
 

Último

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Esri International User Conference 2011: Python: Integrating Standard and Third-Party Libraries

  • 1. Esri International User Conference | San Diego, CA Technical Workshops | Tuesday, July 12th Python: Integrating Standard and Third-Party Libraries Jason Scheirer
  • 2. Other Sessions • Building Tools with Python (Technical Workshop) - Thursday 10:15AM 9 • Getting Started With Map Algebra Using the Raster Calculator and Python (Demo Theater Presentation) - Wednesday 10:00AM Exhibit Hall C (Spatial Analysis Demo Theater) • Python - Analyzing your GPS tracking data (Demo Theater Presentation) - Thursday 11:00AM Exhibit Hall C (Spatial Analysis Demo Theater) • Python - Automating Geodatabase Administration (Tech Workshop 20 Minute) - Thursday 11:05AM 23 B • Python - Creating an ArcGIS Script Tool (Demo Theater Presentation) - Tuesday 4:00PM Exhibit Hall C (Spatial Analysis Demo Theater) • Python - Getting Started (Technical Workshop) - Tuesday 1:30PM 2 - Thursday 8:30AM 2
  • 3. Other Sessions (continued) • Python - Getting to know the Python Window (Demo Theater Presentation) - Tuesday 10:00AM Exhibit Hall C (Spatial Analysis Demo Theater) • Python - Improving the Performance of your Script Tools (Tech Workshop 20 Minute) - Tuesday 8:30AM 6 A • Python - Raster Analysis (Technical Workshop) - Tuesday 3:15PM 6 C - Wednesday 3:15PM 5 A/B • Python - Scripting for Map Automation (Technical Workshop) - Tuesday 10:15AM 9 - Wednesday 3:15PM 9 • Python - Spatial Analysis (Intermediate) (Technical Workshop) - Tuesday 3:15PM 1 A/B - Thursday 10:15AM 2
  • 4. Other Sessions (yes, there are more) • Python - The Ease and Power of Cursors (Demo Theater Presentation) - Tuesday 11:30AM Exhibit Hall C (Spatial Analysis Demo Theater) • Python Scripts - Using A Template (Demo Theater Presentation) - Tuesday 11:00AM Exhibit Hall C (Spatial Analysis Demo Theater) • Road Ahead - Python Scripting Abilities - Thursday 4:05PM 6 B
  • 5. Python in ArcGIS • Implementing geoprocessing script tools - Creating an ArcGIS Script Tool (Tuesday 4:00PM) - Building Tools with Python (Thursday 10:15AM) • Automating workflows - Gluing together other GP tools - Scheduled tasks • Integrating ArcGIS with other systems, other systems into ArcGIS - Data interop: import/export - Automating ArcGIS processes from other applications - Preparing data from ArcGIS for consumption by other applications
  • 7. Batteries Included • Libraries for many common tasks come with the language - File formats: XML (DOM, SAX, ElementTree), JSON, CSV, .ZIP (zipfile) - Networking: HTTP (urllib, urllib2), TCP/UDP (socket) - Parallelism: threading, multiprocessing, subprocess - Command line applications: optparse - Paths, directories, files: sys, os, os.path - User Interfaces: tkinter - Data structures and algorithms: collections, itertools, heapq, struct, many more - Date/time (time, datetime) - Calling C++/C (ctypes)
  • 8. Read the Docs! • Help file: ArcGIS 10.0 | Python 2.6 | Python Manuals
  • 9. Read the Docs! • What’s installed: ArcGIS 10.0 | Python 2.6 | Module Docs
  • 10. More Help • PyMOTW (Python Module of the Week) - http://www.doughellmann.com/PyMOTW/ - Also available as a book
  • 11. Example • Summary Statistics in R - Uses a third-party module for reading spatial data: maptools - Only accepts shapefiles! • Going to use two different system libraries: - subprocess (Open/monitor other programs) - re (Regular Expressions) CopyFeatures to temporary Shapefile Run R Script Clean up temp file Parse R Script’s Output Statistics!
  • 12. Demo
  • 13. But don’t reinvent the wheel! • wget: Popular utility to download resources over HTTP/FTP • Do I need it? - urllib2 can download simple URLs • But I need to follow links - Don’t write a web spider in Python, use the –r option on wget - Use subprocess, like in the previous example
  • 15. The Cheese Shop • http://pypi.python.org/pypi • The official place for 3rd party Python modules
  • 16. Some Interesting Modules • PDF writing – reportlab • Image manipulation – PIL • (Messy) HTML – beautifulsoup • Advanced graphing/plotting – matplotlib • Advanced date/time handling – dateutil • Excel - Read – xlrd - Write – xlwt • Consuming .Net - http://pythonnet.sourceforge.net/ • .docx Read/write – docx - https://github.com/mikemaccana/python-docx - This brings us to…
  • 17. There’s No Installer! • Find python.exe in your install, add it to %PATH%. Scripts too. • Try pip: - http://python-distribute.org/ • Or on the command line: - python.exe setup.py install • Look for it on an unofficial Python library builds site: - http://www.lfd.uci.edu/~gohlke/pythonlibs/
  • 18. Conclusion • A lot of what you need is already there • Amazing documentation at your fingertips, more online • There are built-in ways of interfacing with non-Python utilities (great for using script tools to integrate into ArcGIS) • There’s a HUGE ecosystem out there that probably already has what you need