Skip to main content

Businnect Python

The official Python SDK for the Businnect API.

Installation

pip install businnect

Setup

Find your API token at https://businnect.com/settings/developer after creating an account at https://businnect.com/register.

from businnect import Businnect

client = Businnect(api_token="your_api_token_here")

Micropost

Create a post

from businnect.schemas.micropost import PostType

# Text post
post = client.micropost.client_create_micropost(
    title="Hello World",
    body="This is my first post.",
)
print(post.public_id)
print(post.link)

# Media post
with open("photo.png", "rb") as f:
    post = client.micropost.client_create_micropost(
        title="My photo",
        body="Check this out",
        post_type=PostType.MEDIA,
        file=("photo.png", f, "image/png"),
    )

# Reply to a post
reply = client.micropost.client_create_micropost(
    body="Great post!",
    parent_micropost_public_id="post_public_id_here",
)

# Nested reply (reply to a comment)
nested = client.micropost.client_create_micropost(
    body="I agree!",
    parent_micropost_public_id="post_public_id_here",
    parent_micropost_comment_public_id="comment_public_id_here",
)

Delete a post

client.micropost.client_delete_micropost(public_id="post_public_id_here")

Vote on a post (toggle)

result = client.micropost.client_vote_micropost(public_id="post_public_id_here")
print(result.user_voted)  # True or False

Blog

Get admin article

article = client.blog.client_get_admin_blog()
if article:
    print(article.title)
    print(article.body)

List admin articles

result = client.blog.client_list_admin_blogs()
print(result.total_list)
for article in result.list:
    print(article.title, article.slug)

API Reference

Businnect(api_token, base_url?)

Parameter Type Description
api_token str Your API token
base_url str API base URL (default: https://api.businnect.com)

client.micropost.client_create_micropost(...)

Parameter Type Default Description
body str required Content of the post
title str None Required for original posts
post_type PostType PostType.TEXT TEXT or MEDIA
community_name str None Community to post in
parent_micropost_public_id str None For replies
parent_micropost_comment_public_id str None For nested replies
allow_comments bool True Whether comments are allowed
is_draft bool False Save as draft
file tuple None (filename, file_object, mime_type) for MEDIA posts

Returns: CreatedWithPublicIdAndLinkResponse with public_id and link


client.micropost.client_delete_micropost(public_id)

Parameter Type Description
public_id str Public ID of the post to delete

Returns: None (204 on success)


client.micropost.client_vote_micropost(public_id)

Parameter Type Description
public_id str Public ID of the post to vote on

Returns: VoteResponse with user_voted (bool)


client.blog.client_get_admin_blog()

Returns: BlogResponse or None


client.blog.client_list_admin_blogs()

Returns: BlogListResponse with list, total_list and total_pages


Development

# Install in editable mode
pip install -e .

# Run unit tests
python -m pytest businnect/tests/test_businnect_unit.py -v

# Run integration tests (requires real API token)
BUSINNECT_API_TOKEN=your_token python -m pytest businnect/tests/test_businnect_integration.py -v -s

License

MIT

Metadata

Release files for businnect 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for businnect 0.0.2
File Size Uploaded Provenance Actions
businnect-0.0.2.tar.gz 7.8 kB Without provenance Details for businnect-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for businnect 0.0.2
File Interpreter ABI Platform Actions
businnect-0.0.2-py3-none-any.whl Python 3 none any Details for businnect-0.0.2-py3-none-any.whl

Total release size: 17.3 kB

Release files / businnect-0.0.2.tar.gz

Download URL businnect-0.0.2.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8f9598ff4c09af9e4c851088f9f39f978911353357ea6c5b3adca21bce6289ca
BLAKE2b-256 checksum
How to use checksums
c254cc10a8308d7dd2750817a5cd835928cf64ee8a9352e5279cf315f2164a08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Release files / businnect-0.0.2-py3-none-any.whl

Download URL businnect-0.0.2-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
984f2336a76537762a7b76234c4e921cde4ead3c7977d7ac83f24844d8d340b1
BLAKE2b-256 checksum
How to use checksums
916648ceb69c5c526546a089135dad266cfea35d30e6678f6ae244c9796af061
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Security for businnect 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page