pirateweather


Namepirateweather JSON
Version 0.0.10 PyPI version JSON
download
home_pagehttps://github.com/Pirate-Weather/pirate-weather-python
SummaryThe Pirate Weather API wrapper
upload_time2025-07-12 18:33:55
maintainerNone
docs_urlNone
authorPirate-Weather
requires_pythonNone
licenseGPLv3 License
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            Pirate Weather Python
==========

This library for the [Pirate Weather API](https://pirateweather.net) which is an alternative to the deprecated DarkSky
API, and provides access to detailed
weather information from around the globe.

* [Installation](#installation)
* [Get started](#get-started)
* [Contact us](#contact-us)
* [License](#license)

## This library was made by updating the [darksky library by Detrous](https://github.com/Detrous/darksky) so all credits go to them.

### Installation

```
pip3 install pirate_weather_python
```

### Get started

Before you start using this library, you need to get your API key
[here](https://pirate-weather.apiable.io/).

#### Notes on functionality

The Pirate Weather timemachine data is limited in availability, it is only possible to fetch data about 1-2 months ago.
For recent historical weather data use the get_recent_time_machine_forecast which will have data from about 1-5 days prior.
Unfortunately, at the time of writing this it is not possible to get data from 2 weeks ago for example.

All classes are fully annotated, source code is your best doc : )

Use of synchronous client:

```python
from pirate_weather.api import PirateWeather
from pirate_weather.types.languages import Languages
from pirate_weather.types.units import Units
from pirate_weather.types.weather import Weather

API_KEY = "0123456789"
pirate_weather = PirateWeather(API_KEY)

latitude = 42.3601
longitude = -71.0589
forecast = pirate_weather.get_forecast(
    latitude, longitude,
    extend=False,  # default `False`
    lang=Languages.ENGLISH,  # default `ENGLISH`
    values_units=Units.AUTO,  # default `auto`
    exclude=[Weather.MINUTELY, Weather.ALERTS],  # default `[]`,
    timezone='UTC'  # default None - will be set by Pirate Weather API automatically
)
```

Use of synchronous timemachine client:

```python
from pirate_weather.api import PirateWeather
from pirate_weather.types.languages import Languages
from pirate_weather.types.units import Units
from pirate_weather.types.weather import Weather
from datetime import datetime as dt

API_KEY = "0123456789"
pirate_weather = PirateWeather(API_KEY)
t = dt(2022, 5, 6, 12)

latitude = 42.3601
longitude = -71.0589
forecast = pirate_weather.get_time_machine_forecast(
    latitude, longitude,
    extend=False,  # default `False`
    lang=Languages.ENGLISH,  # default `ENGLISH`
    values_units=Units.AUTO,  # default `auto`
    exclude=[Weather.MINUTELY, Weather.ALERTS],  # default `[]`,
    timezone='UTC',  # default None - will be set by Pirate Weather API automatically
    time=t
)
```

Use of synchronous client getting recent timemachine data:

```python
from pirate_weather.api import PirateWeather
from pirate_weather.types.languages import Languages
from pirate_weather.types.units import Units
from pirate_weather.types.weather import Weather
from datetime import datetime as dt

API_KEY = "0123456789"
pirate_weather = PirateWeather(API_KEY)
t = dt(2023, 4, 4)

latitude = 42.3601
longitude = -71.0589
forecast = pirate_weather.get_recent_time_machine_forecast(
    latitude, longitude,
    extend=False,  # default `False`
    lang=Languages.ENGLISH,  # default `ENGLISH`
    values_units=Units.AUTO,  # default `auto`
    exclude=[Weather.MINUTELY, Weather.ALERTS],  # default `[]`,
    timezone='UTC',  # default None - will be set by Pirate Weather API automatically
    time=t
)
```

Use of asynchronous client:

```python
from pirate_weather.api import PirateWeatherAsync
from pirate_weather.types.languages import Languages
from pirate_weather.types.units import Units
from pirate_weather.types.weather import Weather

import asyncio
import aiohttp


async def main(api_key):
    async with aiohttp.ClientSession() as session:
        pirate_weather = PirateWeatherAsync(api_key)

        latitude = 42.3601
        longitude = -71.0589
        forecast = await pirate_weather.get_forecast(
            latitude, longitude,
        extend=False,  # default `False`
        lang=Languages.ENGLISH,  # default `ENGLISH`
        values_units=Units.AUTO,  # default `auto`
        exclude=[Weather.MINUTELY, Weather.ALERTS],  # default `[]`,
        timezone='UTC',  # default None - will be set by Pirate Weather API automatically
         client_session=session  # default aiohttp.ClientSession()
        )

api_key = "0123456789"
asyncio.run(main(api_key))
```

### License.

Library is released under the [MIT License](./LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Pirate-Weather/pirate-weather-python",
    "name": "pirateweather",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Pirate-Weather",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/79/46/58fb02b828e9012fb9148e813b2c21686c18d7fe3b7285e4eab60e8cf820/pirateweather-0.0.10.tar.gz",
    "platform": null,
    "description": "Pirate Weather Python\n==========\n\nThis library for the [Pirate Weather API](https://pirateweather.net) which is an alternative to the deprecated DarkSky\nAPI, and provides access to detailed\nweather information from around the globe.\n\n* [Installation](#installation)\n* [Get started](#get-started)\n* [Contact us](#contact-us)\n* [License](#license)\n\n## This library was made by updating the [darksky library by Detrous](https://github.com/Detrous/darksky) so all credits go to them.\n\n### Installation\n\n```\npip3 install pirate_weather_python\n```\n\n### Get started\n\nBefore you start using this library, you need to get your API key\n[here](https://pirate-weather.apiable.io/).\n\n#### Notes on functionality\n\nThe Pirate Weather timemachine data is limited in availability, it is only possible to fetch data about 1-2 months ago.\nFor recent historical weather data use the get_recent_time_machine_forecast which will have data from about 1-5 days prior.\nUnfortunately, at the time of writing this it is not possible to get data from 2 weeks ago for example.\n\nAll classes are fully annotated, source code is your best doc : )\n\nUse of synchronous client:\n\n```python\nfrom pirate_weather.api import PirateWeather\nfrom pirate_weather.types.languages import Languages\nfrom pirate_weather.types.units import Units\nfrom pirate_weather.types.weather import Weather\n\nAPI_KEY = \"0123456789\"\npirate_weather = PirateWeather(API_KEY)\n\nlatitude = 42.3601\nlongitude = -71.0589\nforecast = pirate_weather.get_forecast(\n    latitude, longitude,\n    extend=False,  # default `False`\n    lang=Languages.ENGLISH,  # default `ENGLISH`\n    values_units=Units.AUTO,  # default `auto`\n    exclude=[Weather.MINUTELY, Weather.ALERTS],  # default `[]`,\n    timezone='UTC'  # default None - will be set by Pirate Weather API automatically\n)\n```\n\nUse of synchronous timemachine client:\n\n```python\nfrom pirate_weather.api import PirateWeather\nfrom pirate_weather.types.languages import Languages\nfrom pirate_weather.types.units import Units\nfrom pirate_weather.types.weather import Weather\nfrom datetime import datetime as dt\n\nAPI_KEY = \"0123456789\"\npirate_weather = PirateWeather(API_KEY)\nt = dt(2022, 5, 6, 12)\n\nlatitude = 42.3601\nlongitude = -71.0589\nforecast = pirate_weather.get_time_machine_forecast(\n    latitude, longitude,\n    extend=False,  # default `False`\n    lang=Languages.ENGLISH,  # default `ENGLISH`\n    values_units=Units.AUTO,  # default `auto`\n    exclude=[Weather.MINUTELY, Weather.ALERTS],  # default `[]`,\n    timezone='UTC',  # default None - will be set by Pirate Weather API automatically\n    time=t\n)\n```\n\nUse of synchronous client getting recent timemachine data:\n\n```python\nfrom pirate_weather.api import PirateWeather\nfrom pirate_weather.types.languages import Languages\nfrom pirate_weather.types.units import Units\nfrom pirate_weather.types.weather import Weather\nfrom datetime import datetime as dt\n\nAPI_KEY = \"0123456789\"\npirate_weather = PirateWeather(API_KEY)\nt = dt(2023, 4, 4)\n\nlatitude = 42.3601\nlongitude = -71.0589\nforecast = pirate_weather.get_recent_time_machine_forecast(\n    latitude, longitude,\n    extend=False,  # default `False`\n    lang=Languages.ENGLISH,  # default `ENGLISH`\n    values_units=Units.AUTO,  # default `auto`\n    exclude=[Weather.MINUTELY, Weather.ALERTS],  # default `[]`,\n    timezone='UTC',  # default None - will be set by Pirate Weather API automatically\n    time=t\n)\n```\n\nUse of asynchronous client:\n\n```python\nfrom pirate_weather.api import PirateWeatherAsync\nfrom pirate_weather.types.languages import Languages\nfrom pirate_weather.types.units import Units\nfrom pirate_weather.types.weather import Weather\n\nimport asyncio\nimport aiohttp\n\n\nasync def main(api_key):\n    async with aiohttp.ClientSession() as session:\n        pirate_weather = PirateWeatherAsync(api_key)\n\n        latitude = 42.3601\n        longitude = -71.0589\n        forecast = await pirate_weather.get_forecast(\n            latitude, longitude,\n        extend=False,  # default `False`\n        lang=Languages.ENGLISH,  # default `ENGLISH`\n        values_units=Units.AUTO,  # default `auto`\n        exclude=[Weather.MINUTELY, Weather.ALERTS],  # default `[]`,\n        timezone='UTC',  # default None - will be set by Pirate Weather API automatically\n         client_session=session  # default aiohttp.ClientSession()\n        )\n\napi_key = \"0123456789\"\nasyncio.run(main(api_key))\n```\n\n### License.\n\nLibrary is released under the [MIT License](./LICENSE).\n",
    "bugtrack_url": null,
    "license": "GPLv3 License",
    "summary": "The Pirate Weather API wrapper",
    "version": "0.0.10",
    "project_urls": {
        "Download": "https://github.com/Pirate-Weather/pirate-weather-python/archive/0.0.10.tar.gz",
        "Homepage": "https://github.com/Pirate-Weather/pirate-weather-python"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "21dde74e83f3583326c275c2cda46e4df17b5c0c9a94933ba57c0f65f826ad3c",
                "md5": "d2136879a36dc14fa6522a0cf1ebe76c",
                "sha256": "508166616af6dbaff522327b5ae75b369af47b55ee934d417d9049aa753cea96"
            },
            "downloads": -1,
            "filename": "pirateweather-0.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d2136879a36dc14fa6522a0cf1ebe76c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13921,
            "upload_time": "2025-07-12T18:33:54",
            "upload_time_iso_8601": "2025-07-12T18:33:54.274225Z",
            "url": "https://files.pythonhosted.org/packages/21/dd/e74e83f3583326c275c2cda46e4df17b5c0c9a94933ba57c0f65f826ad3c/pirateweather-0.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "794658fb02b828e9012fb9148e813b2c21686c18d7fe3b7285e4eab60e8cf820",
                "md5": "c6306b08c3bf87093fb7f005b377b833",
                "sha256": "07f442a8359b5542f059246ad91098dae05ebd3f5af920a61a2286e1854512cb"
            },
            "downloads": -1,
            "filename": "pirateweather-0.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "c6306b08c3bf87093fb7f005b377b833",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12002,
            "upload_time": "2025-07-12T18:33:55",
            "upload_time_iso_8601": "2025-07-12T18:33:55.371265Z",
            "url": "https://files.pythonhosted.org/packages/79/46/58fb02b828e9012fb9148e813b2c21686c18d7fe3b7285e4eab60e8cf820/pirateweather-0.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-12 18:33:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Pirate-Weather",
    "github_project": "pirate-weather-python",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "circle": true,
    "lcname": "pirateweather"
}
        
Elapsed time: 0.48239s