Paul Krill
Editor at Large

Facebook’s Hydra simplifies Python development

news
Oct 7, 20192 mins

Open source framework replaces boilerplate code in complex apps with the ability to compose and override configurations

python snake programming language
Credit: Thinkstock

Aiming to reduce the need for boilerplate code and speed up the development of complex Python applications, Facebook Engineering has created an open source framework called Hydra. Hydra allows developers to “compose” the configurations of applications from the command line or from configuration files. 

Facebook says Hydra offers a flexible approach to developing and maintaining code and configurations, thus speeding up the development of complex applications in fields such as machine learning research. Offered under an MIT license, Hydra lets developers compose and override configurations.

Other promised benefits of Hydra include:

  • Making it easier to add functionality to projects for new use cases and requirements with no need to rewrite significant portions of code.
  • A reduction in the need for some boilerplate code common in complex applications, such as manipulating configuration files, configuration logging, and defining command-line flags.

With Hydra, changes to a composition can be done through configuration files or from the command line. This addresses issues that can arise when modifying a config, such as maintaining slightly different copies of a configuration or adding logic to override configuration values. Configuration can be composed and overridden just prior to running the application. Dynamic command-line tab completion assists developers with discoverability of complex configurations and reduces errors. Applications can be launched locally or remotely, enabling users to take advantage of more local resources.

Facebook engineers use Hydra for prototyping complex research projects. It has a pluggable architecture for adding new features in the future, whether internally from Facebook or from the community. Future plug-ins are planned that will enable the launching of code from Amazon Web Services or other clouds via the command line.

Where to download Hydra

You can download Hydra from GitHub.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author