Skip to main content

Official Python SDK for the Nitrozen.io changelog API

Project description

Nitrozen Python SDK

Official Python client for the Nitrozen.io changelog API.

PyPI Python GitHub

Requirements

Python 3.9+

Installation

pip install nitrozenio

Quick Start

import nitrozenio
from nitrozenio.api.projects_api import ProjectsApi
from nitrozenio.api.entries_api import EntriesApi

# Configure with your API token
configuration = nitrozenio.Configuration(
    host="https://nitrozen.io/api/v1",
    access_token="YOUR_API_TOKEN",
)

with nitrozenio.ApiClient(configuration) as client:
    # List your projects
    projects_api = ProjectsApi(client)
    response = projects_api.projects_get()
    for project in response.data:
        print(f"{project.id}  {project.name}  ({project.slug})")

    # Create a changelog entry
    entries_api = EntriesApi(client)
    entry = entries_api.projects_project_entries_post(
        project=response.data[0].id,
        entry_input=nitrozenio.EntryInput(
            title="New feature",
            content="We shipped something great.",
            category="new",
        ),
    )
    print(entry.data.title)

Authentication

Create an API token on the API Tokens page, then pass it via access_token in the configuration:

configuration = nitrozenio.Configuration(
    host="https://nitrozen.io/api/v1",
    access_token="YOUR_API_TOKEN",
)

Error Handling

API errors raise ApiException, which carries the HTTP status code and response body:

from nitrozenio.exceptions import ApiException

try:
    response = projects_api.projects_project_get(project=999)
except ApiException as e:
    print(e.status)   # e.g. 404
    print(e.reason)   # e.g. "Not Found"
    print(e.body)     # raw JSON error body

Pagination

List endpoints accept page and per_page parameters and return a meta object:

response = entries_api.projects_project_entries_get(
    project=project_id,
    page=2,
    per_page=20,
)
print(f"page {response.meta.current_page} of {response.meta.last_page} ({response.meta.total} total)")
for entry in response.data:
    print(f"{entry.id}  {entry.title}")

API Reference

All URIs are relative to https://nitrozen.io/api/v1.

Authentication

Method HTTP Description
AuthenticationApi.tokens_get() GET /tokens List API tokens
AuthenticationApi.tokens_post(body) POST /tokens Create an API token
AuthenticationApi.tokens_token_delete(id) DELETE /tokens/{token} Revoke an API token

Projects

Method HTTP Description
ProjectsApi.projects_get() GET /projects List projects
ProjectsApi.projects_post(body) POST /projects Create a project
ProjectsApi.projects_project_get(id) GET /projects/{project} Get a project
ProjectsApi.projects_project_put(id, body) PUT /projects/{project} Update a project
ProjectsApi.projects_project_delete(id) DELETE /projects/{project} Delete a project

Entries

Method HTTP Description
EntriesApi.projects_project_entries_get(id, page?, per_page?) GET /projects/{project}/entries List entries
EntriesApi.projects_project_entries_post(id, body) POST /projects/{project}/entries Create an entry
EntriesApi.projects_project_entries_entry_get(pid, eid) GET …/entries/{entry} Get an entry
EntriesApi.projects_project_entries_entry_put(pid, eid, body) PUT …/entries/{entry} Update an entry
EntriesApi.projects_project_entries_entry_delete(pid, eid) DELETE …/entries/{entry} Delete an entry

Users

Method HTTP Description
UsersApi.user_get() GET /user Get current user
UsersApi.user_usage_get() GET /user/usage Get usage statistics

Public

Method HTTP Description
PublicApi.public_projects_slug_entries_get(slug) GET /public/projects/{slug}/entries List published entries (no auth)

Valid values for the category field: new, improvement, fix, announcement

Links

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

nitrozenio-1.0.0.tar.gz (39.3 kB view details)

Uploaded Source

Built Distribution

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

nitrozenio-1.0.0-py3-none-any.whl (76.6 kB view details)

Uploaded Python 3

File details

Details for the file nitrozenio-1.0.0.tar.gz.

File metadata

  • Download URL: nitrozenio-1.0.0.tar.gz
  • Upload date:
  • Size: 39.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nitrozenio-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c4e755ce2f24dc9eefdf35d7ab031f253973c5af6327b4b48f21e26b0d93d9c8
MD5 066ea14f17642b33e0cdbc3bb453c7ba
BLAKE2b-256 f9535834e1a050902f01a9918d18277435888b774082191d689b8baac58ac645

See more details on using hashes here.

File details

Details for the file nitrozenio-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: nitrozenio-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 76.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nitrozenio-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 499bff090d95526ce65fe089158e87586cd0da1eb2f0e791e3d45f442c4794f3
MD5 b36c1d0a83633ffde63adf9d4a7dc6b7
BLAKE2b-256 d67415815936db4fcc660b67d851f183de69007accbe7edd6a071f4dce1c3a70

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