SourceForge AVPython
Python Language Support for ArcView GIS

News - Tutorial - Share Ideas - Project Page - Download

AVPython embeds the Python programming language within ArcView GIS.

ArcView already has the Avenue scripting language. Back in 1994, this was a tremendous innovation. It was the easiest to customize, best integrated platform for Desktop GIS, at the time. But my, how times have changed. Even the most avid Avenist has to admit that the language has gotten a little long in the tooth. The core language and its integration features have not really changed to keep pace with today's wired, connected, component-based world, so by today's standards, Avenue doesn't have everything that professional developers expect from a language.

Enter Python By embedding Python within ArcView GIS, we can break through most of the barriers to interoperability, scalability, and extensibility that the Avenue developer faces when trying to build a modern application. Unlike Avenue, Python is a real programming language suitable for large-scale collaborative development, yet like Avenue it is easy to use, and very easy to read.

If you have ever wanted to write your own classes or extend existing classes, or wished you could integrate your ArcView app with other system components through TCP/IP, XML, or COM, or more easily share code between projects, then you know what I'm talking about. Python provides all of those services and more, and so you are the target user for AVPython.

To call Python code from inside ArcView, just load the "Python Language Support" extension into your project, and use the Python.Exec or Python.Eval scripts that are then available. To call back to ArcView from Python, just say "from arcview import avexec" in your Python script, and then use the avexec function to run Avenue code. However, you can only do that from scripts that are running inside of ArcView (i.e. using the "Python Language Support" extension). This is documented further in the readme file included in the package.

Script.The.GetSource - My intention in developing AVPython was to give ArcView developers more power. By releasing it as open-source software, we made sure there were no licensing barriers preventing consultants and extension developers from taking advantage of it. Now AVPython has been out for a few years, and I know some people have been doing some very interesting things with it, and we want to give the developers an opportunity to give back, if they see fit.

Those who have been using AVPython and are comfortable with its inner workings are welcome to share enhancements to the core interface, to perhaps deepen the integration between Avenue and Python. This can be done primarily in Avenue and Python; C/C++ programming skills will not be required to make valuable contributions (although it can't hurt). In addition, developers may wish to share and collaborate on scripts / extensions that use AVPython. If you are developing with AVPython, and want to share some of your work under an MIT-style open source license, please visit our SourceForge project page.

Although has some really great tools, some of these are heavily Unix-oriented, and may present a steep learning curve for some (including this author!) We don't want that to create any obstacles to collaborative development and code-sharing, so we have also established a forum called AVPython Developers on Yahoo! Groups. Group members may post their scripts and extensions there for others to download. To become a full member with access to all of the available features - mailing list, file uploads, chat, etc. - you need a Yahoo! ID. However, you can join the mailing list without a Yahoo! ID.

For those unfamiliar with Python (there are still a few), I want to give credit where credit is due. I didn't write Python; Guido van Rossum did that. I also didn't write the Python COM extension; that's Mark Hammond's work. All I did was embed the Python interpreter (plus all of its extensions) within Avenue, and provide a way to embed Avenue (plus the ArcView class heirarchy) within Python. It was a relatively simple thing, as you can tell if you peek at the source code.

I would also like to thank my employer, ESRI Canada Limited. ESRI Canada has the copyright on AVPython, but has agreed to make it available as open source software.

Finally, since the open source release, Howard Butler and Patrick Brown have made some great contributions to the documentation for AVPython (the tutorial is their work). They also developed avTerra which, aside from being an award-winning application in its own right, is also a great sample for AVPython.

[DOWNLOAD 1.2.6]
[Python Powered]       [OSI Certified]