meteomoris


Namemeteomoris JSON
Version 2.12.1 PyPI version JSON
download
home_pagehttps://github.com/Abdur-RahmaanJ/meteomoris
SummaryPackage to get weather information about Mauritius from the official meteo website.
upload_time2024-02-22 10:44:24
maintainer
docs_urlNone
authorAbdur-Rahmaan Janhangeer
requires_python>=3.4
license
keywords weather mauritius meteo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # meteomoris

get info about the weather in mauritius!

```
pip install meteomoris
```

Venv explanations at footer.

# Ubuntu

```
sudo add-apt-repository ppa:abdur-rahmaanj/meteomoris-ppa
sudo apt update
sudo apt-get install meteomoris
```

# Important changes

- year output removed from tides, added a meta label for year and month

# Examples

NOTE: Add `print=True` to get a tabular representation

```python
>>> from meteomoris import *

>>> get_main_message()
"A Strong Wind Warning and High Wave Warning for Mauritius | Aucun avertissement de cyclone n'est en vigueur a Maurice | Avertissement de fortes houles pour Rodrigues"
>>> get_main_message(links=True)
[
   ('The Mauritius Meteorological Services (Warnings) Regulations 2023', 'http://metservice.intnet.mu/about-us/legislations/'), 
   ('Heavy Rain warning Bulletin for Mauritius issued at 0500 hours on Thursday 19 January 2023, valid until 0500 hours  Friday 20 January 2023.', 'http://metservice.intnet.mu/warning-bulletin-special-weather.php')
]
>>> get_special_weather_bulletin()
Special Weather Bulletin
Thu, Jan 19, 2023Heavy Rain warning Bulletin for Mauritius issued at 0500 hours on Thursday 19 January 2023, valid until 0500 hours  Friday 20 January 2023. 
 
Heavy rain warning is in force in Mauritius
Active clouds coming from the North-East are influencing the local weather.
Moderate to heavy showers with thunderstorms are expected over the island.
 
The public is advised to:
1. Remain in safe places and avoid open areas, hikings, sea ventures and sheltering under trees during thunderstorms.
2. Avoid places prone to water accumulation, river banks and other water courses which are flooded and certain mountain slopes prone to landslide
3. Be very cautious on the roads due to reduced visibility resulting from heavy rains and fog patches

...
>>> get_weekforecast()
[
 {
   'condition': 'Few showers highgrounds',
   'date': 'Apr 22',
   'day': 'Mon',
   'max': '32�',
   'min': '21�',
   'probability': 'High',
   'sea condition': 'rough',
   'wind': 'E25G50'
 },
 {
...
 }
]
>>> get_weekforecast(print=True)
                                                     Week forecast                                                     
┏━━━━━┳━━━━━━━━┳━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
┃ Day ┃ Date   ┃ Min ┃ Max ┃ Condition                                                     ┃ Sea condition ┃ Wind     ┃
┡━━━━━╇━━━━━━━━╇━━━━━╇━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
│ Thu │ Jan 19 │ 19° │ 30° │ Moderate to locally heavy showers with isolated thunderstorms │ rough         │ ENE25G50 │
│ Fri │ Jan 20 │ 20° │ 30° │ Moderate to locally heavy showers with isolated thunderstorms │ rough         │ NE20     │
│ Sat │ Jan 21 │ 20° │ 30° │ Moderate showers with isolated thunderstorms                  │ moderate      │ NE20     │
│ Sun │ Jan 22 │ 20° │ 30° │ Moderate showers with isolated thunderstorms                  │ moderate      │ N15      │
│ Mon │ Jan 23 │ 20° │ 30° │ Moderate to heavy thundery showers                            │ rough         │ N15      │
│ Tue │ Jan 24 │ 20° │ 30° │ Moderate to heavy thundery showers                            │ rough         │ N20      │
│ Wed │ Jan 25 │ 20° │ 30° │ Moderate to heavy thundery showers                            │ rough         │ N25      │
└─────┴────────┴─────┴─────┴───────────────────────────────────────────────────────────────┴───────────────┴──────────┘
>>> get_weekforecast(day=3)
{'condition': 'Few passing showers',
 'date': 'Apr 25',
 'day': 'Thu',
 'max': '31�',
 'min': '20�',
 'probability': 'Medium',
 'sea condition': 'moderate',
 'wind': 'SE20'}

>>> get_weekforecast(day=3)['condition']
'Few passing showers'

>>> get_cityforecast()
[
 {'condition': 'Partly cloudy',
     'date': 'Apr 22',
     'day': 'Mon',
     'max': '31�',
     'min': '26�',
     'wind': 'E25G50'},
 {'condition': ...}
]


>>> get_moonphase()
{'April 2019': {
                'first quarter': {'date': '12', 'hour': '23', 'minute': '06'},
                'full moon': {'date': '19', 'hour': '15', 'minute': '12'},
                'last quarter': {'date': '27', 'hour': '02', 'minute': '18'},
                'new moon': {'date': '05', 'hour': '12', 'minute': '50'}
                },
 'May 2019': {'first quarter': {'date': '12', 'hour': '05', 'minute': '12'},
...

>>> may = get_moonphase(month='May 2019')
>>> may['new moon']['date']
'05'

>>> get_sunrisemu()
{
 'february': {
                1: {'rise': '05:53', 'set': '18:53'},
                ...
                28: {'rise': '06:07', 'set': '18:37'}
            },
 'march': {
            1: {'rise': '06:07', 'set': '18:36'},
            2: {'rise': '06:07', 'set': '18:36'},
            ...
            31: {'rise': '06:16', 'set': '18:11'}
        }
}

>>> get_sunriserodr()

>>> get_sunrisemu().keys()
dict_keys(['february', 'march'])

>>> get_eclipses()
[
 {
    'end': {'date': 1, 'hour': 2, 'minute': 37, 'month': 'may'},
    'info': 'The eclipse will not be visible in Mauritius, Rodrigues, St. Brandon and Agalega.',
    'start': {'date': 30, 'hour': 22, 'minute': 45, 'month': 'april'},
    'status': 'partial',
    'type': 'sun',
    'title': ''
 },
 ...
 {
    'end': {'date': 8, 'hour': 17, 'minute': 56, 'month': 'november'},
    'info': 'The eclipse will not be visible in Mauritius, Rodrigues, St. Brandon and Agalega.',
    'start': {'date': 8, 'hour': 12, 'minute': 2, 'month': 'november'},
    'status': 'total',
    'type': 'moon',
    'title': ''
 }
]

>>> get_equinoxes()
[
 {
    'day': 20, 'hour': 19, 'minute': 33, 'month': 'march', 'year': 2022
 },
 {
  'day': 23, 'hour': 5, 'minute': 3, 'month': 'september', 'year': 2022
 }
]

>>> get_solstices()
[
 {
    'day': 21, 'hour': 13, 'minute': 13, 'month': 'june', 'year': 2022
 },
 {
    'day': 22, 'hour': 1, 'minute': 48, 'month': 'december', 'year': 2022
 }
]
>>> get_tides()
{
    'months': {
        'january': {
            1: ['09:27', '59', '23:37', '58', '03:27', '41', '16:55', '30'],
            ...
        },
        'february': {
            1: ['00:36', '63', '10:49', '58', '06:12', '49', '18:21', '28'],
            ...
        }
    },
    'month_format': {
        'date': [
            '1st High Tide (Time (Local))',
            '1st High Tide (Height (cm))',
            '2nd High Tide (Time (Local))',
            '2nd High Tide (Height (cm))',
            '1st Low Tide (Time (Local))',
            '1st Low Tide (Height (cm))',
            '2nd Low Tide (Time (Local))',
            '2nd Low Tide (Height (cm))'
        ]
    },
    'meta': {'months': [['january', '2023'], ['feruary', '2023']]}
}
>>> get_latest()
{
    'rainfall24h': {
        'info': 'Rainfall in (mm) from 28 January 2023 10 PM  to 29 January 2023 10 PM',
        'data': {
            'Albion': '',
            ...
            'Vacoas': '2.3'
        }
    },
    'rainfall3hrs': {
        'info': 'Last 3hrs Rainfall in (mm) on 29 January 2023 10 PM.',
        'data': {
            'Albion': '',
            ...
            'Vacoas': '0.5'
        }
    },
    'wind': {
        'info': 'Maximum wind speed (km/h) for the last 24 hours until 29 January 2023',
        'data': {
            'Albion': '',
            ...
            'Vacoas': '24'
        }
    },
    'humidity': {
        'info': 'Humidity at 10 AM on 29 January 2023',
        'data': {
            'Albion': '',
            ...
            'Vacoas': '72'
        }
    },
    'minmaxtemp': {
        'info': 'Maximum and minimum temperatures for the last 24 hours until 29 January 2023',
        'data': {
            'Albion': {'min': '', 'max': ''},
            ...
            'Vacoas': {'min': '22', 'max': '29'}
        }
    }
}
>>> get_uvindex()
{
    'vacoas': 'Extreme', 
    'port-louis': 'Extreme', 
    'plaisance': 'Low'
}
>>> get_today_moonphase() # {} if nothing today
{
    'title': 'first quarter', 
    'hour': 22, 
    'minute': 39
}
>>> get_today_eclipse() # {} if nothing today
{
    'start': eclispe_json,
    'end': eclipse_json
}
>>> get_today_sunrise("mu")
{
    'rise': '05:53', 
    'set': '18:53'
}
>>> get_today_forecast()
{
 'condition': 'Few passing showers',
 'date': 'Apr 25',
 'day': 'Thu',
 'max': '31�',
 'min': '20�',
 'probability': 'Medium',
 'sea condition': 'moderate',
 'wind': 'SE20'
}
>>> get_today_tides()
['09:27', '59', '23:37', '58', '03:27', '41', '16:55', '30']
>>> get_today_solstice()
{
    'day': 21, 'hour': 13, 'minute': 13, 'month': 'june', 'year': 2022
}
>>> get_today_equinox()
{
    'day': 20, 'hour': 19, 'minute': 33, 'month': 'march', 'year': 2022
}
```

# Cli

```
Usage: meteomoris [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  forecast     Week forecast
  message      Message of the day
  moonphase    Moonphase
  special      Special weather bulletin
  sunrisemu    Sunrise (Mauritius)
  sunriserodr  Sunrise (Rodrigues)
  today        Today's info
  uvindex      Ultra Violet Index

```

# Global settings

```python
from meteomoris import Meteo
from meteomoris import get_main_message

Meteo.CHECK_INTERNET = True # Will check if there is internet
Meteo.EXIT_ON_NO_INTERNET = True # Will exit if no internet
Meteo.ALREADY_CHECKED_INTERNET = False
Meteo.DEBUG = False # used during development
Meteo.CACHE_PERMS = True # used internally, modify to refelct if cache file can be created
Meteo.CACHE_PATH = "." # If cache path can be customized, default to  site-packages

Meteo.today = "2023-11-10" # If you want to override cache data
Meteo.headers = {
         'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0',
         'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 
         'Accept-Language' : 'en-US,en;q=0.5', 
         'Accept-Encoding' : 'gzip', 
         'DNT' : '1', # Do Not Track Request Header 
         'Connection' : 'close',
         'Sec-GPC': '1',
         'Sec-Fetch-Site': 'none',
         'Sec-Fetch-Mode': 'navigate',
         'Sec-Fetch-User': '?1',
         'Connection': 'keep-alive',
         'Upgrade-Insecure-Requests': '1'
     } # Redefine default headers here
print(get_main_message())
```
# Installing

Create and activate env

Linux 

```
python3.9 -m venv venv
. venv/bin/activate
```

Windows

```
py -3.9 -m venv venv
venv\Scripts\activate.bat :: for command prompt
venv\Scripts\Activate.ps1 :: for powershell
```

# Local dev

In env

```
pip install -e . 
```

# Local test

In env

Install pytest `pip install pytest`

Run

`python -m pytest tests/`

# Changelog

```
2.12.1
🔧 Fix: Add remaining get_today apis to init
✨ Fix: Improve get_tides parsing mechanism to be more robust

2.12.0
🎉 get_today_solstice
🎉 get_today_equinox

2.11.0
🎉 get_today_sunrise
🎉 get_today_forecast
🎉 get_today_tides

2.10.0
🎉 get_today_moonphase
🎉 get_today_eclipse

2.9.0: 🎉 Add version cli command

2.8.8
🔧 Set cache path to current directory
🖌️ Rearrange display of today command
🔧 Remove latest data from cache as need last 3hrs

2.8.7
🔧 Lots of fixes
🔧 Tests
🎉 Customizable cache path

2.8.3: 🔧 Fix key error
2.8.2: 🔧 Fix imports
2.8.4: ✨ Feat resist cache permission issues
2.8.5: 🔧 Fix cache not found on perms error
2.8.6: 🔧 Fix none error on no cache data
2.8.1: 🔥 Feat cache
2.8.0: 🎉 Add UV index

2.7.8
🔧 Fixes
🛩️ Debian package published

2.7.0
🎉 Add latest data in API
🎉 Add today command

2.6.0
🎉 Add tide
🎉 Add rainfall 

2.4.0: 🎉 Add today info
2.3.3: 🔧 Fix broken install

2.3.0
🔧 Fix get_eclipse_raw bug
✨ Add debug mode

2.2.1: 🔧 Fix get_moonphase bug
2.2.0: 🎉 Add print commands and API

2.1.0
🔧 Fix get_moonphase
🎉 Add get_equinoxes
🎉 Add get_solstices
🎉 Add get_equinoxes

2.0.2: 🔧 Fix broken install

2.0.1
📑 Add venv docs
📑 Add global settings docs

2.0.0
🎉 Add Meteo with classmethod
🎉 Add internet check
🎉 Add global settings
🎉 Add headers change option
🎉 Add get_sunrisemu
🎉 Add get_sunriserodr
🔧 Tests basics
```

# Debian

Example

```
~/code/meteomoris/$ debuild -k"<key id>" -S
~/code/meteomoris/$ cd ..
~/code/$ dput ppa:abdur-rahmaanj/meteomoris-ppa meteomoris_2.7.8_source.changes
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Abdur-RahmaanJ/meteomoris",
    "name": "meteomoris",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.4",
    "maintainer_email": "",
    "keywords": "weather mauritius meteo",
    "author": "Abdur-Rahmaan Janhangeer",
    "author_email": "arj.python@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ae/b1/b3ecd87d8cfd9643818c2e2fc951e50904e538a17037ed57b6032bc02069/meteomoris-2.12.1.tar.gz",
    "platform": null,
    "description": "# meteomoris\n\nget info about the weather in mauritius!\n\n```\npip install meteomoris\n```\n\nVenv explanations at footer.\n\n# Ubuntu\n\n```\nsudo add-apt-repository ppa:abdur-rahmaanj/meteomoris-ppa\nsudo apt update\nsudo apt-get install meteomoris\n```\n\n# Important changes\n\n- year output removed from tides, added a meta label for year and month\n\n# Examples\n\nNOTE: Add `print=True` to get a tabular representation\n\n```python\n>>> from meteomoris import *\n\n>>> get_main_message()\n\"A Strong Wind Warning and High Wave Warning for Mauritius | Aucun avertissement de cyclone n'est en vigueur a Maurice | Avertissement de fortes houles pour Rodrigues\"\n>>> get_main_message(links=True)\n[\n   ('The Mauritius Meteorological Services (Warnings) Regulations 2023', 'http://metservice.intnet.mu/about-us/legislations/'), \n   ('Heavy Rain warning Bulletin for Mauritius issued at 0500 hours on Thursday 19 January 2023, valid until 0500 hours  Friday 20 January 2023.', 'http://metservice.intnet.mu/warning-bulletin-special-weather.php')\n]\n>>> get_special_weather_bulletin()\nSpecial Weather Bulletin\nThu, Jan 19, 2023Heavy Rain warning Bulletin for Mauritius issued at 0500 hours on Thursday 19 January 2023, valid until 0500 hours\u00a0 Friday 20 January 2023. \n \nHeavy rain warning is in force in Mauritius\nActive clouds coming from the North-East are influencing the local weather.\nModerate to heavy showers with thunderstorms are expected over the island.\n \nThe public is advised to:\n1. Remain in safe places and avoid open areas, hikings, sea ventures and sheltering under trees during thunderstorms.\n2. Avoid places prone to water accumulation, river banks and other water courses which are flooded and certain mountain slopes prone to landslide\n3. Be very cautious on the roads due to reduced visibility resulting from heavy rains and fog patches\n\n...\n>>> get_weekforecast()\n[\n {\n   'condition': 'Few showers highgrounds',\n   'date': 'Apr 22',\n   'day': 'Mon',\n   'max': '32\ufffd',\n   'min': '21\ufffd',\n   'probability': 'High',\n   'sea condition': 'rough',\n   'wind': 'E25G50'\n },\n {\n...\n }\n]\n>>> get_weekforecast(print=True)\n                                                     Week forecast                                                     \n\u250f\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\n\u2503 Day \u2503 Date   \u2503 Min \u2503 Max \u2503 Condition                                                     \u2503 Sea condition \u2503 Wind     \u2503\n\u2521\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\n\u2502 Thu \u2502 Jan 19 \u2502 19\u00b0 \u2502 30\u00b0 \u2502 Moderate to locally heavy showers with isolated thunderstorms \u2502 rough         \u2502 ENE25G50 \u2502\n\u2502 Fri \u2502 Jan 20 \u2502 20\u00b0 \u2502 30\u00b0 \u2502 Moderate to locally heavy showers with isolated thunderstorms \u2502 rough         \u2502 NE20     \u2502\n\u2502 Sat \u2502 Jan 21 \u2502 20\u00b0 \u2502 30\u00b0 \u2502 Moderate showers with isolated thunderstorms                  \u2502 moderate      \u2502 NE20     \u2502\n\u2502 Sun \u2502 Jan 22 \u2502 20\u00b0 \u2502 30\u00b0 \u2502 Moderate showers with isolated thunderstorms                  \u2502 moderate      \u2502 N15      \u2502\n\u2502 Mon \u2502 Jan 23 \u2502 20\u00b0 \u2502 30\u00b0 \u2502 Moderate to heavy thundery showers                            \u2502 rough         \u2502 N15      \u2502\n\u2502 Tue \u2502 Jan 24 \u2502 20\u00b0 \u2502 30\u00b0 \u2502 Moderate to heavy thundery showers                            \u2502 rough         \u2502 N20      \u2502\n\u2502 Wed \u2502 Jan 25 \u2502 20\u00b0 \u2502 30\u00b0 \u2502 Moderate to heavy thundery showers                            \u2502 rough         \u2502 N25      \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n>>> get_weekforecast(day=3)\n{'condition': 'Few passing showers',\n 'date': 'Apr 25',\n 'day': 'Thu',\n 'max': '31\ufffd',\n 'min': '20\ufffd',\n 'probability': 'Medium',\n 'sea condition': 'moderate',\n 'wind': 'SE20'}\n\n>>> get_weekforecast(day=3)['condition']\n'Few passing showers'\n\n>>> get_cityforecast()\n[\n {'condition': 'Partly cloudy',\n     'date': 'Apr 22',\n     'day': 'Mon',\n     'max': '31\ufffd',\n     'min': '26\ufffd',\n     'wind': 'E25G50'},\n {'condition': ...}\n]\n\n\n>>> get_moonphase()\n{'April 2019': {\n                'first quarter': {'date': '12', 'hour': '23', 'minute': '06'},\n                'full moon': {'date': '19', 'hour': '15', 'minute': '12'},\n                'last quarter': {'date': '27', 'hour': '02', 'minute': '18'},\n                'new moon': {'date': '05', 'hour': '12', 'minute': '50'}\n                },\n 'May 2019': {'first quarter': {'date': '12', 'hour': '05', 'minute': '12'},\n...\n\n>>> may = get_moonphase(month='May 2019')\n>>> may['new moon']['date']\n'05'\n\n>>> get_sunrisemu()\n{\n 'february': {\n                1: {'rise': '05:53', 'set': '18:53'},\n                ...\n                28: {'rise': '06:07', 'set': '18:37'}\n            },\n 'march': {\n            1: {'rise': '06:07', 'set': '18:36'},\n            2: {'rise': '06:07', 'set': '18:36'},\n            ...\n            31: {'rise': '06:16', 'set': '18:11'}\n        }\n}\n\n>>> get_sunriserodr()\n\n>>> get_sunrisemu().keys()\ndict_keys(['february', 'march'])\n\n>>> get_eclipses()\n[\n {\n    'end': {'date': 1, 'hour': 2, 'minute': 37, 'month': 'may'},\n    'info': 'The eclipse will not be visible in Mauritius, Rodrigues, St. Brandon and Agalega.',\n    'start': {'date': 30, 'hour': 22, 'minute': 45, 'month': 'april'},\n    'status': 'partial',\n    'type': 'sun',\n    'title': ''\n },\n ...\n {\n    'end': {'date': 8, 'hour': 17, 'minute': 56, 'month': 'november'},\n    'info': 'The eclipse will not be visible in Mauritius, Rodrigues, St. Brandon and Agalega.',\n    'start': {'date': 8, 'hour': 12, 'minute': 2, 'month': 'november'},\n    'status': 'total',\n    'type': 'moon',\n    'title': ''\n }\n]\n\n>>> get_equinoxes()\n[\n {\n    'day': 20, 'hour': 19, 'minute': 33, 'month': 'march', 'year': 2022\n },\n {\n  'day': 23, 'hour': 5, 'minute': 3, 'month': 'september', 'year': 2022\n }\n]\n\n>>> get_solstices()\n[\n {\n    'day': 21, 'hour': 13, 'minute': 13, 'month': 'june', 'year': 2022\n },\n {\n    'day': 22, 'hour': 1, 'minute': 48, 'month': 'december', 'year': 2022\n }\n]\n>>> get_tides()\n{\n    'months': {\n        'january': {\n            1: ['09:27', '59', '23:37', '58', '03:27', '41', '16:55', '30'],\n            ...\n        },\n        'february': {\n            1: ['00:36', '63', '10:49', '58', '06:12', '49', '18:21', '28'],\n            ...\n        }\n    },\n    'month_format': {\n        'date': [\n            '1st High Tide (Time (Local))',\n            '1st High Tide (Height (cm))',\n            '2nd High Tide (Time (Local))',\n            '2nd High Tide (Height (cm))',\n            '1st Low Tide (Time (Local))',\n            '1st Low Tide (Height (cm))',\n            '2nd Low Tide (Time (Local))',\n            '2nd Low Tide (Height (cm))'\n        ]\n    },\n    'meta': {'months': [['january', '2023'], ['feruary', '2023']]}\n}\n>>> get_latest()\n{\n    'rainfall24h': {\n        'info': 'Rainfall in (mm) from 28 January 2023 10 PM  to 29 January 2023 10 PM',\n        'data': {\n            'Albion': '',\n            ...\n            'Vacoas': '2.3'\n        }\n    },\n    'rainfall3hrs': {\n        'info': 'Last 3hrs Rainfall in (mm) on 29 January 2023 10 PM.',\n        'data': {\n            'Albion': '',\n            ...\n            'Vacoas': '0.5'\n        }\n    },\n    'wind': {\n        'info': 'Maximum wind speed (km/h) for the last 24 hours until 29 January 2023',\n        'data': {\n            'Albion': '',\n            ...\n            'Vacoas': '24'\n        }\n    },\n    'humidity': {\n        'info': 'Humidity at 10 AM on 29 January 2023',\n        'data': {\n            'Albion': '',\n            ...\n            'Vacoas': '72'\n        }\n    },\n    'minmaxtemp': {\n        'info': 'Maximum and minimum temperatures for the last 24 hours until 29 January 2023',\n        'data': {\n            'Albion': {'min': '', 'max': ''},\n            ...\n            'Vacoas': {'min': '22', 'max': '29'}\n        }\n    }\n}\n>>> get_uvindex()\n{\n    'vacoas': 'Extreme', \n    'port-louis': 'Extreme', \n    'plaisance': 'Low'\n}\n>>> get_today_moonphase() # {} if nothing today\n{\n    'title': 'first quarter', \n    'hour': 22, \n    'minute': 39\n}\n>>> get_today_eclipse() # {} if nothing today\n{\n    'start': eclispe_json,\n    'end': eclipse_json\n}\n>>> get_today_sunrise(\"mu\")\n{\n    'rise': '05:53', \n    'set': '18:53'\n}\n>>> get_today_forecast()\n{\n 'condition': 'Few passing showers',\n 'date': 'Apr 25',\n 'day': 'Thu',\n 'max': '31\ufffd',\n 'min': '20\ufffd',\n 'probability': 'Medium',\n 'sea condition': 'moderate',\n 'wind': 'SE20'\n}\n>>> get_today_tides()\n['09:27', '59', '23:37', '58', '03:27', '41', '16:55', '30']\n>>> get_today_solstice()\n{\n    'day': 21, 'hour': 13, 'minute': 13, 'month': 'june', 'year': 2022\n}\n>>> get_today_equinox()\n{\n    'day': 20, 'hour': 19, 'minute': 33, 'month': 'march', 'year': 2022\n}\n```\n\n# Cli\n\n```\nUsage: meteomoris [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  forecast     Week forecast\n  message      Message of the day\n  moonphase    Moonphase\n  special      Special weather bulletin\n  sunrisemu    Sunrise (Mauritius)\n  sunriserodr  Sunrise (Rodrigues)\n  today        Today's info\n  uvindex      Ultra Violet Index\n\n```\n\n# Global settings\n\n```python\nfrom meteomoris import Meteo\nfrom meteomoris import get_main_message\n\nMeteo.CHECK_INTERNET = True # Will check if there is internet\nMeteo.EXIT_ON_NO_INTERNET = True # Will exit if no internet\nMeteo.ALREADY_CHECKED_INTERNET = False\nMeteo.DEBUG = False # used during development\nMeteo.CACHE_PERMS = True # used internally, modify to refelct if cache file can be created\nMeteo.CACHE_PATH = \".\" # If cache path can be customized, default to  site-packages\n\nMeteo.today = \"2023-11-10\" # If you want to override cache data\nMeteo.headers = {\n         'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0',\n         'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', \n         'Accept-Language' : 'en-US,en;q=0.5', \n         'Accept-Encoding' : 'gzip', \n         'DNT' : '1', # Do Not Track Request Header \n         'Connection' : 'close',\n         'Sec-GPC': '1',\n         'Sec-Fetch-Site': 'none',\n         'Sec-Fetch-Mode': 'navigate',\n         'Sec-Fetch-User': '?1',\n         'Connection': 'keep-alive',\n         'Upgrade-Insecure-Requests': '1'\n     } # Redefine default headers here\nprint(get_main_message())\n```\n# Installing\n\nCreate and activate env\n\nLinux \n\n```\npython3.9 -m venv venv\n. venv/bin/activate\n```\n\nWindows\n\n```\npy -3.9 -m venv venv\nvenv\\Scripts\\activate.bat :: for command prompt\nvenv\\Scripts\\Activate.ps1 :: for powershell\n```\n\n# Local dev\n\nIn env\n\n```\npip install -e . \n```\n\n# Local test\n\nIn env\n\nInstall pytest `pip install pytest`\n\nRun\n\n`python -m pytest tests/`\n\n# Changelog\n\n```\n2.12.1\n\ud83d\udd27 Fix: Add remaining get_today apis to init\n\u2728 Fix: Improve get_tides parsing mechanism to be more robust\n\n2.12.0\n\ud83c\udf89 get_today_solstice\n\ud83c\udf89 get_today_equinox\n\n2.11.0\n\ud83c\udf89 get_today_sunrise\n\ud83c\udf89 get_today_forecast\n\ud83c\udf89 get_today_tides\n\n2.10.0\n\ud83c\udf89 get_today_moonphase\n\ud83c\udf89 get_today_eclipse\n\n2.9.0: \ud83c\udf89 Add version cli command\n\n2.8.8\n\ud83d\udd27 Set cache path to current directory\n\ud83d\udd8c\ufe0f Rearrange display of today command\n\ud83d\udd27 Remove latest data from cache as need last 3hrs\n\n2.8.7\n\ud83d\udd27 Lots of fixes\n\ud83d\udd27 Tests\n\ud83c\udf89 Customizable cache path\n\n2.8.3: \ud83d\udd27 Fix key error\n2.8.2: \ud83d\udd27 Fix imports\n2.8.4: \u2728 Feat resist cache permission issues\n2.8.5: \ud83d\udd27 Fix cache not found on perms error\n2.8.6: \ud83d\udd27 Fix none error on no cache data\n2.8.1: \ud83d\udd25 Feat cache\n2.8.0: \ud83c\udf89 Add UV index\n\n2.7.8\n\ud83d\udd27 Fixes\n\ud83d\udee9\ufe0f Debian package published\n\n2.7.0\n\ud83c\udf89 Add latest data in API\n\ud83c\udf89 Add today command\n\n2.6.0\n\ud83c\udf89 Add tide\n\ud83c\udf89 Add rainfall \n\n2.4.0: \ud83c\udf89 Add today info\n2.3.3: \ud83d\udd27 Fix broken install\n\n2.3.0\n\ud83d\udd27 Fix get_eclipse_raw bug\n\u2728 Add debug mode\n\n2.2.1: \ud83d\udd27 Fix get_moonphase bug\n2.2.0: \ud83c\udf89 Add print commands and API\n\n2.1.0\n\ud83d\udd27 Fix get_moonphase\n\ud83c\udf89 Add get_equinoxes\n\ud83c\udf89 Add get_solstices\n\ud83c\udf89 Add get_equinoxes\n\n2.0.2: \ud83d\udd27 Fix broken install\n\n2.0.1\n\ud83d\udcd1 Add venv docs\n\ud83d\udcd1 Add global settings docs\n\n2.0.0\n\ud83c\udf89 Add Meteo with classmethod\n\ud83c\udf89 Add internet check\n\ud83c\udf89 Add global settings\n\ud83c\udf89 Add headers change option\n\ud83c\udf89 Add get_sunrisemu\n\ud83c\udf89 Add get_sunriserodr\n\ud83d\udd27 Tests basics\n```\n\n# Debian\n\nExample\n\n```\n~/code/meteomoris/$ debuild -k\"<key id>\" -S\n~/code/meteomoris/$ cd ..\n~/code/$ dput ppa:abdur-rahmaanj/meteomoris-ppa meteomoris_2.7.8_source.changes\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Package to get weather information about Mauritius from the official meteo website.",
    "version": "2.12.1",
    "project_urls": {
        "Bug Reports": "https://github.com/Abdur-RahmaanJ/meteomoris/issues",
        "Homepage": "https://github.com/Abdur-RahmaanJ/meteomoris",
        "Source": "https://github.com/Abdur-RahmaanJ/meteomoris/"
    },
    "split_keywords": [
        "weather",
        "mauritius",
        "meteo"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08b69ad0fc2558d0e42cbf2b81977c73df9a2269815d3cfa6b5c7ba830dc7219",
                "md5": "bbb37f3009f69ba1d17c1dcc0ea974f1",
                "sha256": "ad7134f0c08484313cd32b6e2f63d37844f1468c855cbc01f6ed73afa9056f48"
            },
            "downloads": -1,
            "filename": "meteomoris-2.12.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bbb37f3009f69ba1d17c1dcc0ea974f1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.4",
            "size": 17776,
            "upload_time": "2024-02-22T10:44:21",
            "upload_time_iso_8601": "2024-02-22T10:44:21.347723Z",
            "url": "https://files.pythonhosted.org/packages/08/b6/9ad0fc2558d0e42cbf2b81977c73df9a2269815d3cfa6b5c7ba830dc7219/meteomoris-2.12.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aeb1b3ecd87d8cfd9643818c2e2fc951e50904e538a17037ed57b6032bc02069",
                "md5": "89493144f7dcf33318238383235a18cf",
                "sha256": "8ab2d7afb0de4899e2086ce4a42c9ff1f69614931bde4d7094e53050c5e5b86a"
            },
            "downloads": -1,
            "filename": "meteomoris-2.12.1.tar.gz",
            "has_sig": false,
            "md5_digest": "89493144f7dcf33318238383235a18cf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.4",
            "size": 24448,
            "upload_time": "2024-02-22T10:44:24",
            "upload_time_iso_8601": "2024-02-22T10:44:24.177791Z",
            "url": "https://files.pythonhosted.org/packages/ae/b1/b3ecd87d8cfd9643818c2e2fc951e50904e538a17037ed57b6032bc02069/meteomoris-2.12.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-22 10:44:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Abdur-RahmaanJ",
    "github_project": "meteomoris",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "meteomoris"
}
        
Elapsed time: 0.20017s