Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Kivy Blueprints

You're reading from   Kivy Blueprints Build your very own app-store-ready, multi-touch games and applications with Kivy!

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher Packt
ISBN-13 9781783987849
Length 282 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
 Vasilkov Vasilkov
Author Profile Icon Vasilkov
Vasilkov
Arrow right icon
View More author details
Toc

Appendix A. The Python Ecosystem

This book doesn't attempt to answer all the questions that you might have had about Kivy, or exemplify every remotely possible approach to writing a Kivy app; it should instead serve as a practical, hands-on introduction to writing various programs with a user interface in Python.

Kivy's major achievement is bridging the gap between a Python toolchain and mobile app development on Android and iOS. Unlike bindings to Qt (PyQt and PySide), Kivy is inherently Pythonic (apart from minor implementation details such as the Window object). These two aspects alone make Kivy a viable option to consider when writing your next user-facing application.

This notwithstanding, I strongly encourage you to explore the vast Python ecosystem. It just so happens that a great many Python modules manage to stay under the radar. Kivy is actually one of them, overshadowed by, for example, the relatively more popular Qt framework (they clearly don't belong in the same ballpark, but a common misconception is that these are mostly interchangeable, for reasons unclear).

The following annotated list contains a few interesting Python modules, both well-known and relatively obscure. This may serve as an inspiration for writing a new app, or merely as an illustration of the riches found in the Python biome. Obviously, this list is far from complete, or even extensive: you will certainly uncover many other unique libraries and tools over the course of your Python career.

So here it is, a highly subjective enumeration of selected, downright amazing Python packages, in no particular order:

  • Requests: This module is a well-known, über-useful HTTP package with readable, consistent interface. It greatly simplifies writing all sorts of HTTP clients.

  • Pyjnius: Discussed in slightly more detail in Chapter 3, Sound Recorder for Android, this module provides a seamless and relatively lightweight Java interoperability layer. This tool lets you reuse any Java library, on Android and desktop, from the comfort of your Python environment. Needless to say, Java libraries (of equivocal usefulness) come in great numbers, so Pyjnius may prove useful on many occasions.

  • mitmproxy (man-in-the-middle proxy): This is a toolkit for capturing and editing HTTP traffic. Possible uses for mitmproxy include debugging and testing network applications, security auditing, and otherwise toying with unsuspecting programs. It can be also exploited as a network screen for filtering traffic; this particular use case is popular with governments these days. Might land you a job with the KGB, or not.

  • music21: This is a toolkit for computer-aided musicology developed at MIT that provides a way to work with symbolic music data. It allows you to read, write, and manipulate musical scores, conduct complex musical and statistical analysis on a representative corpus of classical music, fiddle with algorithmic composition, and so on.

  • Pydub: This is a library for audio manipulation with a consistent, Pythonic interface. It allows you to perform a number of audio editing tasks, such as slicing, concatenating, crossfading, and so on. Pydub uses ffmpeg for transcoding, which means it supports most popular file formats out of the box.

  • Django: This is an undoubtedly popular web framework for building dynamic, database-backed websites. What many people don't suspect, however, is that Django can also be used for many other, barely related, tasks that include the following:

    • Making powerful command-line tools for database manipulation, using Django models and object-relational mapping (ORM)

    • Employing the excellent Django's template engine for pretty much anything that requires a template engine

    • Building static websites

  • RenPy (stylized as Ren'Py): This is a visual novel engine, used for professional game development. Visual novels, once practically unheard of outside Japan, are becoming more popular now, with selected RenPy-powered titles readily available for consumption on the AppStore, Google Play, Steam, and via other software distribution channels.

NumPy, SciPy, IPython, and so on were purposefully omitted from the preceding list; they are so pervasive that there is hardly any need to reintroduce them.

Note

If you find this topic mildly interesting and would like to learn more, there are a few websites that might be useful:

The multitude of packages that provide practical solutions to real-world problems is a defining characteristic of today's Python programming. Code reuse is great, so in no event should you hesitate to borrow from the rich Python ecosystem and to give back when (if) that's feasible.

As a direct consequence of the preceding discussion, Python expands your toolbelt with many things that are universally considered non-trivial. This includes a certain subset of scientific computations, secure and scalable web servers, network services, fast hardware-accelerated graphics, and so on.

This is a valid reason to choose Python for your next project, and it also gives some insight into why many great projects loaded with powerful features—such as Kivy—are written in Python (and related languages, for example, RPython).

The moral of the story: know your ecosystem and it will pay off immensely by shouldering a lot of hard work, making you more productive and your hair soft and silky. Because having a right tool for the job is indispensable.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images