Skip to main content

Simple Python wrapper for the International NameDay API @ https://api.abalin.net/

Project description

GitHub GitHub code size in bytes PyPI PyPI - Python Version PyPI - Format

abalin_nameday

Simple Python wrapper for the International NameDay API @ https://api.abalin.net

Installation

Use the package manager pip to install abalin_nameday.

pip install abalin_nameday

Usage

import abalin_nameday
myClient = abalin_nameday.namedayRequestor(country, timezone)
print(json.dumps(json.loads(myClient.GetData()), indent=2, sort_keys=True))

Explanation

country: one of the countries from this list:

['cz','sk','pl','fr','hu','hr','se','us','at','it','es','de','dk','fi','bg','lt','ee','lv','gr','ru']

timezone: One of the time zones from this list:

'America/Denver',
'America/Costa_Rica',
'America/Los_Angeles',
'America/St_Vincent',
'America/Toronto',
'Europe/Amsterdam',
'Europe/Monaco',
'Europe/Prague',
'Europe/Isle_of_Man',
'Africa/Cairo',
'Africa/Johannesburg',
'Africa/Nairobi',
'Asia/Yakutsk',
'Asia/Hong_Kong',
'Asia/Taipei',
'Pacific/Midway',
'Pacific/Honolulu',
'Etc/GMT-6',
'US/Samoa',
'Zulu',
'US/Hawaii',
'Israel',
'Etc/GMT-2',

If the call is successful, abalin_nameday returns a string that contains today's date and name day in the selected country. It also contains version information about itself.

See the documentation of the actual API for up to date list of countries/time zones supported.

Sample response from owm2json:

{
  "module": {
    "version": "0.0.1"
  },
  "namedays": {
    "data": {
      "dates": {
        "day": 5,
        "month": 4
      },
      "namedays": {
        "hu": "Vince"
      }
    }
  }
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU General Public License v3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

abalin_nameday-0.0.4.tar.gz (15.4 kB view hashes)

Uploaded Source

Built Distribution

abalin_nameday-0.0.4-py3-none-any.whl (15.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page