A Ruby gem providing structured data for every country, including ISO 3166 subdivisions, ISO 4217 currencies, and E.164 phone numbers.
Countries is a Ruby gem that provides structured, standardized data about every country in the world. It packages information from ISO 3166 (countries and subdivisions), ISO 4217 (currencies), and E.164 (phone numbers) into convenient Ruby objects, solving the problem of sourcing and managing reliable country data for applications.
Ruby and Rails developers building applications that require country-specific information, such as international e-commerce platforms, localization tools, address validation systems, or any software needing standardized geographic data.
Developers choose Countries because it offers a comprehensive, officially sourced dataset with a clean Ruby API, eliminating the need to manually manage or scrape country data. Its adherence to ISO standards and support for translations, extensions, and custom data make it a robust foundation for international features.
All sorts of useful information about every country packaged as convenient little country objects. It includes data from ISO 3166 (countries and states/subdivisions ), ISO 4217 (currency), and E.164 (phone numbers).
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Integrates multiple ISO standards (3166-1, 3166-2, 4217, E.164) and ITU data, ensuring reliable, officially sourced information for countries, subdivisions, currencies, and phone codes.
Provides intuitive Ruby objects with dynamic finders like find_country_by_alpha2 and attribute-based searches, simplifying data access and manipulation in Ruby applications.
Includes translations for country and subdivision names in numerous locales, with configurable loading via locales setting to optimize memory usage based on application needs.
Supports optional extensions for timezones (via tzinfo gem) and currencies (via Money gem), allowing enhanced functionality without bloating the core gem.
Full feature set requires external gems like tzinfo for timezones and Money for currencies, adding to bundle size and potential dependency conflicts.
Loading all locales and data can be memory-intensive; while configurable, default behavior in Rails may load more translations than needed, impacting performance in constrained environments.
Major version upgrades, such as to 5.x, involve breaking changes like removed methods and dropped Ruby version support, requiring code updates and careful migration as noted in UPGRADE.md.