Skip to main content

sageranger

A package to aide in the utilization of Earthranger as a way to capture and display data of interest from camera traps and other data loggers. This package is used in cougarvision to post events and observations: https://github.com/conservationtechlab/cougarvision/blob/master/README.md

Installation:

pip install sageranger

Additional Setup

For use in cougarvision (visit readme) or for testing (see below) an authorization token is needed "Bearer ". Visit <your_instance>.pamdas.org/admin. Under Das Configuration in DAS Tokens add a new Das Acess Token. Set the expiration date and ensure the scope is 'read write'. We recommend the use of an online UUID generator to create a unique token. Once the above fields are filled save the token. This token can be used in the fetch and alert yaml in cougarvision or for testing purposes in the unit tests.

sageranger Functions

Sageranger performs multiple functions such as posting events to earthranger, attaching images to events, creating camera sources and subjects, posting observations to camera subjects and retrieving camera coordinates and subject ids.

post_camera_er.py: Uses a csv containing camera data such as coordinates and camera names. This csv is located on your local machine. Post camera posts an intial observation for each camera at their specified coordinates to make cameras visible on the map.

post_event_er.py: Posts events of specified type (ex. "cougarvision_detection") to earthranger.

attach_image_er.py: Attaches an image to an event given an image and event id.

get_cam_locations.py: Retrieves the coordinates and subject_id of the cameras.

post_cougar_log.py: posts an observation with an animal of interest has been detected (ex. "cougar", "bobcat" ...).

post_monthly.py: An optional function which posts empty observations to keep cameras visible on the earthranger map.

post_obs.py: Is a supporting function which handles posting observations for the post_camera.py, post_monthly.py, and post_cougar_log.py functions.

For more information about the earthranger api visit <your_instance>.pamdas.org/api/v1.0/docs/interactive/

Testing

The sageranger files are not directly runnable but each have their own test case. All of these test cases are located in the unit_tests folder. These test cases require an authorization token as well as additional information such as camera_name, label...etc see test docstrings for more information.

test_cougar_log.py:

python3 unit_tests.test_cougar_log

test_attach.py:

python3 -m unit_tests.test_attach

test_locations.py:

python3 -m unit_tests.test_locations

test_post_monthly:

python3 -m unit_tests.test_post_monthly

test_post_obs.py:

python3 -m unit_tests.test_post_obs

test_post.py

python3 -m unit_tests.test_post

Metadata

Release files for sageranger 2.0.0

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

Built distribution (wheel)

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

Release files / sageranger-2.0.0-py3-none-any.whl

Download URL sageranger-2.0.0-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
020210e8c09a69e7b693b82543ce2739b2601ee0a66a31a455628b03116471bc
BLAKE2b-256 checksum
How to use checksums
f1ed20294dd9f6f031bd92b167bc4485c059f18a561a87edc5c52c248c14b5b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Security for sageranger 2.0.0

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.

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