Official Python client for the Nitrozen.io changelog API.
Python 3.9+
pip install nitrozenioimportnitrozeniofromnitrozenio.api.projects_apiimportProjectsApifromnitrozenio.api.entries_apiimportEntriesApi# Configure with your API tokenconfiguration=nitrozenio.Configuration(
host="https://nitrozen.io/api/v1",
access_token="YOUR_API_TOKEN",
)
withnitrozenio.ApiClient(configuration) asclient:
# List your projectsprojects_api=ProjectsApi(client)
response=projects_api.projects_get()
forprojectinresponse.data:
print(f"{project.id}{project.name} ({project.slug})")
# Create a changelog entryentries_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)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",
)API errors raise ApiException, which carries the HTTP status code and response body:
fromnitrozenio.exceptionsimportApiExceptiontry:
response=projects_api.projects_project_get(project=999)
exceptApiExceptionase:
print(e.status) # e.g. 404print(e.reason) # e.g. "Not Found"print(e.body) # raw JSON error bodyList 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)")
forentryinresponse.data:
print(f"{entry.id}{entry.title}")All URIs are relative to https://nitrozen.io/api/v1.
| 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 |
| 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 |
| 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 |
| Method | HTTP | Description |
|---|---|---|
UsersApi.user_get() | GET /user | Get current user |
UsersApi.user_usage_get() | GET /user/usage | Get usage statistics |
| 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