Skip to main content

OpenSense API

The Unofficial opensense.network API

osnapi documentation
official documentation

What is https://opensense.network/?

OpenSense is "A participatory open sensor data platform", making a uniform data format for a variety of open source weather data sources available to the public.
For more information, visit the website.

Install

To use this module in your project, you have multiple options. The easiest is to install it using the pip packetmanager:

pip install osnapi

You can also clone this repo and create an editable install, in case you want to customize e.g. the error messages behaviour:

git clone <this repo>
cd <this repo>
pip install -e .

This module uses nbdev, a jupyter notebook based environment. If you go for the editable install, we recommend you to take a short look at nbdev first.

If you want a simple portable module, you can also just copy the osnapi folder into your project. No installation necessary.

How to use

Once you have installed this module using any of the methods above, you can use

import osnapi as api

and start coding.

If you want to use functions that require a login, use:

api.login(username, password)

The default api_enpoint is https://www.opensense.network/beta/api/v1.0/. This is stored inside the Settings object.

The Settings object looks like this:

class Settings():
    api_endpoint = 'https://www.opensense.network/beta/api/v1.0/'
    username     = None
    password     = None
    auth_token   = None

To change the api_endpoint, username, password, or auth_token manually, simply assign to the Settings objects class variables e.g. api.Settings.username = 'Alice'. Doing this is normally not necessary, because the values will automatically be filled out when using api.login().
It's important that you do not use an instance of Settings, but the class directly, because instanced changes will not be seen by the module.
To view your current settings, you can however instantiate a Settings object with api.Settings(). Its string representation will display the current settings.

The authentication tokens you get from the server are JSON Web Tokens.
A Token is valid for one hour, but will automatically be reaquired using the credentials saved in Settings, once it runs out.

For an overview and documentation of the available functionality, check out the links at the top of this README

References

An example of a project using this api is: https://github.com/flpeters/serverless_opensense_dwd_importer
In that project we implement a data importer that downloads data from https://www.dwd.de/ and pushes that data to opensense.

Metadata

Release files for osnapi 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for osnapi 0.0.1
File Size Uploaded Provenance Actions
osnapi-0.0.1.tar.gz 15.8 kB Without provenance Details for osnapi-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for osnapi 0.0.1
File Interpreter ABI Platform Actions
osnapi-0.0.1-py3-none-any.whl Python 3 none any Details for osnapi-0.0.1-py3-none-any.whl

Total release size: 28.9 kB

Release files / osnapi-0.0.1.tar.gz

Download URL osnapi-0.0.1.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b0c35a3816e592851f0b4a88b5f11fef755b9c0aa4165c65a5a4f0d71efccc8a
BLAKE2b-256 checksum
How to use checksums
b3d4805939e39123c9890bff307b1f206ae008455b292fff27f251c573b128ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

Release files / osnapi-0.0.1-py3-none-any.whl

Download URL osnapi-0.0.1-py3-none-any.whl
Size 13.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d52a12685a6a4322deda9ed2cecd65b10cf292784ddb00d067808f7e2d9854f
BLAKE2b-256 checksum
How to use checksums
216faaaac0867d8788e0f26b978b94a8a9d0db14f5d9ff4f469d8130a6ae39b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

Security for osnapi 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page