Skip to main content

An API and CLI for reporting CoCoRaHS observations.

Project description

PyCoCoraHS

PyCoCoraHS is a Python package providing a CLI utility and an API for uploading observations to CoCoRaHS.

Installing

Install this package using pip:

python3 -m pip install --user cocorahs

Using the CLI

You can invoke the CLI via cocorahs. Here is the help output:

Usage: cocorahs [OPTIONS] PERCIPITATION

  Report PERCIPITATION amount to CoCoRaHS. Enter T for trace amounts.

Options:
  --station TEXT   The CoCoRaHS station code
  --username TEXT  Your CoCoRaHS username
  --password TEXT  Your CoCoRaHS password
  --help           Show this message and exit.

Configuring the CLI via a config file.

Create a file at ~/.config/cocorahs/config.ini containing a config like the following but changing the details to your username, password, & station.

[CoCoRaHS]
username = DanielSchep
password = hunter2
station = VA-RCC-15

API Usage

Here is a simple example of making a new report via the API:

from cocorahs import CoCoRaHS

api = CoCoRaHS(username='DanielSchep', password='hunter2')
api.new_report(station='VA-RCC-15', percipitation=0.1, trace=False)

The new_report function also accepts an observation_time keyword argument. It should be a datetime.datetime object.

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

cocorahs-0.1.3.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cocorahs-0.1.3-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file cocorahs-0.1.3.tar.gz.

File metadata

  • Download URL: cocorahs-0.1.3.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.24.0

File hashes

Hashes for cocorahs-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f09083fe0381ed29c3478e005e05bf8da7aa9042df8a61a01f6133cb22dd6dac
MD5 c2f96242fadd188e76174c9276e6f50d
BLAKE2b-256 f15d73609490b98a10cc8ea51477bc835fad97bb0c968e7c343b8a213855c8b4

See more details on using hashes here.

File details

Details for the file cocorahs-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: cocorahs-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.24.0

File hashes

Hashes for cocorahs-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 94b395c797aaf857c2a6de4a89431995910cf2ffd99f5470f7c4a4f1e1b766ad
MD5 f9dfd305938990f87ba0b25ca3112081
BLAKE2b-256 9222e852ee61e377d098b74ebc53d7141c75c45baa489ecb45a1a5398bda8e34

See more details on using hashes here.

Supported by

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