Grafana Calendar Annotator
Generate annotations in Grafana from events pulled from an ICS calendar.
Hacktoberfest
This project welcomes Hacktoberfest contributions! Any contributions to increase the OpenSSF Best Practices percentage or that close an issue will be given priority.
Getting Started
CLI
$ grafana-calendar-annotator --help
Usage: grafana-calendar-annotator [OPTIONS]
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ * --grafana-url -g TEXT Url of the Grafana instance to populate annotations into │
│ [required] │
│ * --grafana-api-key -k TEXT API key to authenticate to the Grafana instance [required] │
│ * --calendar-url -c TEXT URL of the ICS Calendar to use to populate events from │
│ [required] │
│ * --flatten/--no-flatten -f/-nf Flattening events will create a single time annotation │
│ instead of a span │
│ [default: no-flatten] │
│ [required] │
│ * --flatten-direction -fd [start|end] Create the annotation at the start or the end of the event │
│ if the event is flattened │
│ [default: (start)] │
│ [required] │
│ * --tags -t TEXT List of tags to add to created annotations │
│ [default: (generated,)] │
│ [required] │
│ * --regenerate/--no-regenerate -r/-nr Regenerating will delete all annotations that have the same │
│ set of tags before creating new annotations │
│ [default: regenerate] │
│ [required] │
│ --delete-only -d Only delete annotations with tags, do not create new │
│ annotations │
│ --help Show this message and exit. │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
The following flags can be set with environment variables:
| Flag | Variable Name |
|---|---|
| --grafana-url | GRAFANA_URL |
| --grafana-api-key | GRAFANA_TOKEN |
| --flatten | FLATTEN |
| --flatten-direction | FLATTEN_DIRECTION |
grafana-calendar-annotator --grafana-url https://my-grafana.com --grafana-api-key abcd1234 --flatten --flatten-direction end --calendar-url https://my-calendar.com/personal.ics
# is the same as this
GRAFANA_URL=https://my-grafana.com GRAFANA_TOKEN=abcd1234 FLATTEN=true FLATTEN_DIRECTION=end grafana-calendar-annotator --calendar-url https://my-calendar.com/personal.ics
Installing
Pip
For the library and the cli
pip install grafana_calendar_annotator
Pipx
Pipx is useful for installing and running applications in isolated environments. I've always found it useful to ensure python applications are can be executed from anywhere in your system.
pipx install grafana_calendar_annotator
Running the tests
Deployment
Built With
- Contributor Covenant - Used for the Code of Conduct
- Poetry - Used for build and packaging
- Contributing.md Generator
- Billie Thompson's README Template
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use Semantic Versioning for versioning. For the versions available, see the tags on this repository.
Contributors
Contributors who participated in this project.
License
This project is licensed under the MIT.
Release files for grafana-calendar-annotator 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| grafana-calendar-annotator-0.1.2.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| grafana_calendar_annotator-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:13.8 kB
Release files / grafana-calendar-annotator-0.1.2.tar.gz
| Download URL | grafana-calendar-annotator-0.1.2.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
439fa1f82b7687fb5a33ef1616a20e7e0f1660d0155d90f67156df3fa67f4848
|
|
BLAKE2b-256 checksum How to use checksums |
9812eaea482234e6b654395c72fec87cbc1b4e09d16c57ee4022fb6d44924a74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.1 CPython/3.10.7 Linux/5.19.13-zen1-1-zen
|
Release files / grafana_calendar_annotator-0.1.2-py3-none-any.whl
| Download URL | grafana_calendar_annotator-0.1.2-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d788d55f42d2cc41f2e569739f1e0e60a055490a1f6d0d1fa684feeec6286e0
|
|
BLAKE2b-256 checksum How to use checksums |
9f627f5aa948fd97dbcb943d3ca4cde63783a89dfbb8dbdde27e85a157763bde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.1 CPython/3.10.7 Linux/5.19.13-zen1-1-zen
|