Skip to main content

A small example package

Project description

Install

pip install grambox

Quickstart

from grambox import GramBox, cookie, delete_session, userid, media_id

# Initialize and login
g = GramBox("USERNAME", "PASSWORD")

1. Direct Messaging

text_message(target, text)

Send a plain text DM.

print(g.text_message("user_target", "Hello from GramBox!"))

voice_message(target, audio_path)

Send a voice note (MP3).

print(g.voice_message("user_target", "voice.mp3"))

img_message(target, img_path)

Send an image (JPEG/PNG).

print(g.img_message("user_target", "photo.jpg"))

video_message(target, video_path)

Send a video (MP4).

print(g.video_message("user_target", "video.mp4"))

2. Post Interactions

like(post_url)

Like a post by URL.

print(g.like("https://www.instagram.com/p/xxxxxx/"))

comment(post_url, text)

Leave a comment under a post.

print(g.comment("https://www.instagram.com/p/xxxxxx/", "🔥 Nice shot!"))

3. Follow Management

follow(username)

Follow a user.

print(g.follow("user_target"))

unfollow(username)

Unfollow a user.

print(g.unfollow("user_target"))

4. Publishing Content

create_note(text)

Post a short “note” in DM requests.

print(g.create_note("Check your DMs!"))

story(image_path)

Upload a Story image.

print(g.story("story.jpg"))

post_img(image_path, caption)

Publish a feed photo with caption.

print(g.post_img("post.jpg", "My latest photo"))

5. Profile Editing

edit_profile(new_username=…, new_full_name=…, new_bio=…)

Update username, full name or bio.

print(g.edit_profile(
    new_username="new_user",
    new_full_name="Full Name",
    new_bio="Bio text"
))

edit_profile_img(image_path)

Change your profile picture.

print(g.edit_profile_img("avatar.jpg"))

6. Data Retrieval

get_info_A(username)

Fetch account info (requires login).

print(g.get_info_A("user_target"))

get_info_B(username)

Fetch public account info (no login).

print(g.get_info_B("user_target"))

download_story(username)

Download current Story (requires login).

print(g.download_story("user_target"))

download_story_b(username)

Download Story publicly (no login).

print(g.download_story_b("user_target"))

download_posts(post_url)

Download all media from a post/reel/carousel.

print(g.download_posts("https://www.instagram.com/p/xxxxxx/"))

7. Inbox & Messages

get_messages()

Retrieve the latest DM thread’s last message.

print(g.get_messages())

get_inbox_request()

Retrieve the most recent DM request.

print(g.get_inbox_request())

8. Utility Functions (outside class)

cookie(username, password)

Return stored session or login.

print(cookie("USERNAME", "PASSWORD"))

delete_session(username)

Remove saved session.

print(delete_session("USERNAME"))

userid(username, password, target)

Get a user’s numeric ID.

print(userid("USERNAME", "PASSWORD", "user_target"))

media_id(post_url)

Extract media ID from a post URL.

print(media_id("https://www.instagram.com/p/xxxxxx/"))

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

grambox-0.0.0.2.tar.gz (13.0 kB view details)

Uploaded Source

Built Distribution

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

grambox-0.0.0.2-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file grambox-0.0.0.2.tar.gz.

File metadata

  • Download URL: grambox-0.0.0.2.tar.gz
  • Upload date:
  • Size: 13.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for grambox-0.0.0.2.tar.gz
Algorithm Hash digest
SHA256 40029876b757bea1e88138ed32d2ea367877adb658eeca29aa66e629a27e337a
MD5 6a2527a4f122b58de12593c37a24b600
BLAKE2b-256 f61ac4be2fb324a53524949fcd8839adb4ac0915aa32c73de783b0585b6f8d01

See more details on using hashes here.

File details

Details for the file grambox-0.0.0.2-py3-none-any.whl.

File metadata

  • Download URL: grambox-0.0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for grambox-0.0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e17c88aa533b6fba3c8014d944d5e176be20295034830368d025ceb5bf5736e6
MD5 3f66d1ecb770a9808d2ccda45f77e66e
BLAKE2b-256 e2dbbfdc66c26985c0725ceb0410a2ded808c81b7cfc009e0295262df9b98cf5

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