IP::Ge...etadata(3pm)

πŸ“¦
version 1.013 Β· 4 versions
, in debian trixie, ubuntu resolute

πŸ’– IP::Geolocation::MMDB::Metadata β€” the vibe ✨

okay so bestie, welcome to IP::Geolocation::MMDB::Metadata, a Perl module (manual section 3pm, iykyk) that hands you the metadata from a MaxMind DB file. it's giving backstage pass to the database's own little ID card πŸ’…


πŸŽ€ VERSION

version 1.013


✨ SYNOPSIS

use IP::Geolocation::MMDB;
my $db = IP::Geolocation::MMDB->new(file => '/path/to/City.mmdb');
my $metadata = $db->metadata;

like. that's it. that's the whole entrance exam πŸ¦‹


🌸 DESCRIPTION

A class for metadata from a MaxMind DB file. she's the metadata girlie. she knows things about the database. she's not the database, she's the about the database ✨


πŸ‘‘ SUBROUTINES/METHODS

πŸ’œ new

my $metadata = IP::Geolocation::MMDB::Metadata->new(
  binary_format_major_version => 2,
  binary_format_minor_version => 0,
  build_epoch   => time,
  database_type => 'City',
  languages     => [qw(en fr pt-BR)],
  description   => {
    en => 'IP to city',
    fr => 'IP vers ville',
  },
  ip_version    => 6,
  node_count    => 3829268,
  record_size   => 28,
);

Returns a new metadata object. literally manifesting a metadata object into existence, no cap 🌈

🌸 binary_format_major_version

my $major_version = $metadata->binary_format_major_version;

Returns the database format's major version number. the big number. the main character number. πŸ‘‘

πŸ¦‹ binary_format_minor_version

my $minor_version = $metadata->binary_format_minor_version;

Returns the database format's minor version number. the supporting role that still ate πŸ’…

⭐ build_epoch

my $t = gmtime $metadata->build_epoch;

Returns the database's build timestamp as an epoch number. yes bestie, an epoch number β€” that's raw seconds, you gotta gmtime it yourself if you want something human-readable. the gmtime in the example is doing the heavy lifting there πŸ•°οΈ

πŸ“ database_type

my $database_type = $metadata->database_type;

Returns a free-form string indicating the database type. free-form! so she can say whatever she wants. unhinged queen πŸ’€

🧚 languages

for my $language (@{$metadata->languages}) {
  say $language;
}

Returns a reference to an array of locale codes indicating what languages this database has information for. note the @{$...} deref, because she hands you a reference to an array, not a plain array. multilingual icon 🌍

πŸ’– description

my %description_for = %{$metadata->description};
for my $language (keys %description_for) {
  my $description = $description_for{$language};
  say "$language: $description";
}

Returns a reference to a hash that maps locale codes to strings that describe the database content. again: a reference, this time to a hash, so deref with %{$...} like the example does. she's describing herself in every language she knows, and honestly? relatable 🌸

πŸ’… ip_version

my $ip_version = $metadata->ip_version;

Returns 4 or 6. that's the whole menu. pick your fighter πŸ₯Š

🌈 node_count

my $node_count = $metadata->node_count;

Returns the number of nodes in the database's search tree. she counted. she's thorough. respect 🌳

πŸŽ€ record_size

my $record_size = $metadata->record_size;

Returns the record size for nodes in the database's search tree. nodes got a size and she's reporting it fr fr πŸ“


πŸ’€ DIAGNOSTICS

None. zero drama. no errors, no warnings, nothing to worry about 🫢


πŸ”₯ CONFIGURATION AND ENVIRONMENT

None. she does not read your environment variables. she does not want your environment variables. she's low maintenance ✨


🧚 DEPENDENCIES

None. she stands on her own two feet, self-made queen πŸ‘‘


πŸ™ˆ INCOMPATIBILITIES

None. she gets along with everybody πŸ’–


πŸ’œ BUGS AND LIMITATIONS

None known. as far as anyone can tell, she's flawless. (as far as anyone can tell!! 😭)


🌸 SEE ALSO

  • IP::Geolocation::MMDB β€” her parent, her origin story, her whole world

⭐ AUTHOR

Andreas VΓΆgele <voegelas@cpan.org>


Copyright (C) 2025 Andreas VΓΆgele

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page bestie, brought to you by perl v5.40.1, dated 2025-03-20 πŸ’…βœ¨ go forth and read your metadata, you've got this 🫢

πŸ“¦ where this page comes from