Skip to main content

This package demonstrates building and publishing Python Packages with GitHubs infrastructure

Project description

hetzner-fix-report

Fixes Hetzner CSV reports by cleaning the CSV and merging project name from PDF.

Installation

This project is hosted on PyPI and can therefore be installed easily through pip:

pip install hetzner_fix_report

Dependending on your setup you may need to add --user after the install.

Usage

Single report

Use the command line interface to combine a csv and pdf file:

hetzner-fix-report Hetzner_2020-01-05_RXXXXXXXXXX.csv Hetzner_2020-01-05_RXXXXXXXXXX.pdf

Or shorten it using brace expansion:

hetzner-fix-report Hetzner_2020-01-05_RXXXXXXXXXX.{csv,pdf}

If you want to save the enriched csv output, use either the -o parameter as explained in the program's help or redirect output to a file using >.

Batchwise processing

When in a directory that holds multiple csv and pdf files the following shell script should call the tool and save its output within a newly created subdirectory:

mkdir -p fix
for csv in *.csv; do pdf=${csv%%.*}.pdf; hetzner-fix-report -o "fix/$csv" "$csv" "$pdf"; done

Original & enriched format

Hetzner's original CSV reports have the problem of being unprecise and not machine readable. This is especially noticeable in the long multiline comment column that may is mostly human readable. Currently the PDF report contains additional information about the entry's (server/backup) associated project. Since this information is not contained within the CSV reports I wanted to fix this. The enriched format has the following keys and examplary values:

Key Example
id 2520725
name my-server
project My Project
type cx31
quantity 1
usage_hours 42
price 8.9
price_netto 4.9
price_max 2.49
day_from 2020-06-01
day_to 2020-06-30
is_backup False
is_server True
is_ceph False

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

hetzner_fix_report-0.2.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

hetzner_fix_report-0.2.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file hetzner_fix_report-0.2.0.tar.gz.

File metadata

  • Download URL: hetzner_fix_report-0.2.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for hetzner_fix_report-0.2.0.tar.gz
Algorithm Hash digest
SHA256 795af7bc4a87af984333fd16907253e86b70308d1efe99cd5548f5ba281ada8f
MD5 4d676a115fc44281aed2e81435fe8181
BLAKE2b-256 d2232c3cdbf056b1c2a73c9b9706e1bfb4ca0c95136956fe8f42546191ff44a0

See more details on using hashes here.

File details

Details for the file hetzner_fix_report-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: hetzner_fix_report-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for hetzner_fix_report-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e32274024b1701fdb9573281c85c531a19baa59466d9ec397773eb2ed6c129d
MD5 e444e96619a54ea8dec59232958f7dab
BLAKE2b-256 a6a52039f608ea88d53466ee148e49655ef931d0381f92a4b43f4151873a46b1

See more details on using hashes here.

Supported by

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