{"id":42394558,"url":"https://github.com/getoctane/octane-python","last_synced_at":"2026-01-28T00:51:12.912Z","repository":{"id":48345442,"uuid":"345789729","full_name":"getoctane/octane-python","owner":"getoctane","description":"Python library providing programatic access to the Octane API","archived":false,"fork":false,"pushed_at":"2023-12-12T23:28:20.000Z","size":2886,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-12-31T15:25:36.307Z","etag":null,"topics":["api","billing","octane","python","python-library","python-package"],"latest_commit_sha":null,"homepage":"https://getoctane.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getoctane.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-03-08T20:44:40.000Z","updated_at":"2022-11-21T17:36:35.000Z","dependencies_parsed_at":"2023-11-22T20:38:56.981Z","dependency_job_id":"15b923d3-9494-43fe-bc75-d54fdd18a901","html_url":"https://github.com/getoctane/octane-python","commit_stats":{"total_commits":41,"total_committers":5,"mean_commits":8.2,"dds":0.4878048780487805,"last_synced_commit":"6c9e9eaa69cb920c39a872a75ff1cdefb0eeb048"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/getoctane/octane-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getoctane%2Foctane-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getoctane%2Foctane-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getoctane%2Foctane-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getoctane%2Foctane-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getoctane","download_url":"https://codeload.github.com/getoctane/octane-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getoctane%2Foctane-python/sbom","scorecard":{"id":424498,"data":{"date":"2025-08-11","repo":{"name":"github.com/getoctane/octane-python","commit":"90779bc74e59cc571e51881edf2c82df13f65a18"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":5,"reason":"Found 6/12 approved changesets -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/getoctane/octane-python/build.yml/main?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2023-62 / GHSA-m2qf-hxjv-5gpq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T01:57:27.286Z","repository_id":48345442,"created_at":"2025-08-19T01:57:27.286Z","updated_at":"2025-08-19T01:57:27.286Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28830070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","billing","octane","python","python-library","python-package"],"created_at":"2026-01-28T00:51:08.687Z","updated_at":"2026-01-28T00:51:12.906Z","avatar_url":"https://github.com/getoctane.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Octane Python Library\n\n[![Version](https://img.shields.io/pypi/v/octane.svg)](https://pypi.org/project/octane/)\n[![GitHub Actions status](https://github.com/getoctane/octane-python/workflows/build/badge.svg)](https://github.com/getoctane/octane-python/actions?query=workflow%3Abuild+)\n\n[![Octane](./octane.png)](https://www.getoctane.io/)\n\nThe **[Octane](https://www.getoctane.io/)** Python library provides programmatic access\nto the Octane API for Python applications.\n\n---\n\n-   [Getting started](#getting-started)\n-   [Example apps](#example-apps)\n-   [Making API calls](#making-api-calls)\n    -   [Customers API](#customers-api)\n        -   [Example: Creating a new customer](#example-creating-a-new-customer)\n        -   [Example: Subscribe a customer to a price plan](#example-subscribe-a-customer-to-a-price-plan)\n    -   [Meters API](#meters-api)\n        -   [Example: Creating a new meter](#example-creating-a-new-meter)\n    -   [Price Plans API](#price-plans-api)\n        -   [Example: Creating a new price plan](#example-creating-a-new-price-plan)\n    -   [Measurements API](#measurements-api)\n        -   [Example: Sending a measurement](#example-sending-a-measurement)\n-   [Development](#development)\n-   [Contributing](#contributing)\n\n## Getting started\n\nFirst, install the package (`octane`):\n\n```bash\npip install --upgrade octane\n```\n\nNext, obtain an API key from within the [Octane portal](http://cloud.getoctane.io/), and set it in your environment:\n\n```shell\nexport OCTANE_API_KEY=\"\u003cinsert_octane_api_key_here\u003e\"\n```\n\nThen, from within your application, import the module:\n\n```python\nimport os, octane\noctane.api_key = os.getenv(\"OCTANE_API_KEY\")\n```\n\n## Example apps\n\nThe following demo applications found in the [examples/](./examples/) directory display\nhow to use the Octane Python library in real-world settings:\n\n-   [antler-db-cloud-shop](examples/antler-db-cloud-shop/) - Enable your customers to self-service various cloud resources\n-   [customer-hours-tracker](./examples/customer-hours-tracker/) - Track hours spent working on freelance projects\n\n## Making API calls\n\nThe `octane` instance provides programmatic access to the Octane API.\n\n### Customers API\n\nThe `Customer` namespace on the `octane` instance provides the ability to\nmake calls to the Octane Customers API.\n\n#### Example: Creating a new customer\n\n```python\ncustomer_name = \"r2d2\"\n\noctane.Customer.create(\n    name=customer_name,\n    measurement_mappings=[{\n        \"label\": \"customer_name\",\n        \"value_regex\": customer_name\n    }]\n)\n```\n\n#### Example: Subscribe a customer to a price plan\n\n```python\ncustomer_name = \"r2d2\"\nprice_plan_name = \"droidplan\"\n\noctane.Customer.create_subscription(customer_name, price_plan_name=price_plan_name)\n```\n\n### Meters API\n\nThe `Meter` namespace on the `octane` instance provides the ability to\nmake calls to the Octane Meters API.\n\n#### Example: Creating a new meter\n\n```python\nmeter_name = \"droidrepairs\"\n\noctane.Meter.create(\n    name=meter_name,\n    meter_type=\"COUNTER\",\n    is_incremental=True,\n    expected_labels=[\"customer_name\"]\n)\n```\n\n### Price Plans API\n\nThe `PricePlan` namespace on the `octane` instance provides the ability to\nmake calls to the Octane Price Plans API.\n\n#### Example: Creating a new price plan\n\n```python\nprice_plan_name = \"droidplan\"\nprice_plan_rate = 10000  # $100.00\nmeter_name = \"droidrepairs\"\n\noctane.PricePlan.create(\n    name=price_plan_name,\n    period=\"month\",\n    metered_components=[{\n        \"meter_name\": meter_name,\n        \"price_scheme\": {\n            \"prices\": [{\n                \"price\": price_plan_rate\n            }],\n            \"scheme_type\": \"FLAT\"\n        }\n    }]\n)\n```\n\n### Measurements API\n\nThe `Measurement` namespace on the `octane` instance provides the ability to\nmake calls to the Octane Measurements API.\n\n#### Example: Sending a measurement\n\n```python\nmeter_name = \"droidrepairs\"\ncustomer_name = \"r2d2\"\n\noctane.Measurement.create(\n    meter_name=meter_name,\n    customer_name=customer_name,\n    value=1,\n)\n```\n\n#### Example: Sending a batch of measurements\n\n```python\nmeter_name = \"droidrepairs\"\ncustomer_name = \"r2d2\"\n\noctane.Measurement.create_multi(\n    measurements=[\n        {\n            \"meter_name\": meter_name,\n            \"customer_name\": customer_name,\n            \"value\": 1,\n            \"time\": \"2023-01-01T00:00:00\",\n        },\n        {\n            \"meter_name\": meter_name,\n            \"customer_name\": customer_name,\n            \"value\": 1,\n            \"time\": \"2023-01-02T00:00:00\",\n        },\n    ]\n)\n```\n\n## Development\n\nRun the following command to set up the development virtualenv:\n\n```sh\nmake\n```\n\nRun all tests on all supported Python versions:\n\n```sh\nmake test\n```\n\nRun all tests for a specific Python version (modify `-e` according to your Python target):\n\n```sh\nTOX_ARGS=\"-e py37\" make test\n```\n\nRun all tests in a single file:\n\n```sh\nTOX_ARGS=\"-e py37 -- tests/api_resources/abstract/test_updateable_api_resource.py\" make test\n```\n\nRun a single test suite:\n\n```sh\nTOX_ARGS=\"-e py37 -- tests/api_resources/abstract/test_updateable_api_resource.py::TestUpdateableAPIResource\" make test\n```\n\nRun a single test:\n\n```sh\nTOX_ARGS=\"-e py37 -- tests/api_resources/abstract/test_updateable_api_resource.py::TestUpdateableAPIResource::test_save\" make test\n```\n\nRun the linter with:\n\n```sh\nmake lint\n```\n\nThe library uses [Black][black] for code formatting. Code must be formatted\nwith Black before PRs are submitted, otherwise CI will fail. Run the formatter\nwith:\n\n```sh\nmake fmt\n```\n\n[black]: https://github.com/ambv/black\n[octane-mock]: https://github.com/octane/octane-mock\n\n## Contributing\n\nContributions are welcome!\n\nPrior to submitting a\n[pull request](https://github.com/getoctane/octane-python/pulls), please\ncheck the list of [open issues](https://github.com/getoctane/octane-python/issues).\nIf there is not an existing issue related to your changes, please open a\nnew issue to first discuss your thoughts with the project maintainers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetoctane%2Foctane-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetoctane%2Foctane-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetoctane%2Foctane-python/lists"}