Skip to content

A new package that generates professional LinkedIn posts from user-provided text input. Users can input their key points, achievements, or ideas, and the package will return a well-structured LinkedIn

Notifications You must be signed in to change notification settings

chigwell/linkedin-post-craft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

linkedin-post-craft

PyPI version License: MIT Downloads LinkedIn

linkedin-post-craft is a lightweight Python package that generates professional LinkedIn posts from simple user‑provided text.
Pick one of five tones (professional, casual, inspirational, analytical, humorous) and let the package craft a LinkedIn‑ready post that follows best practices for engagement and visibility.

Installation

pip install linkedin_post_craft

Quick Start

from linkedin_post_craft import linkedin_post_craft

# Simple call – uses the default ChatLLM7 model
post = linkedin_post_craft(
    user_input="Just completed a successful product launch that increased revenue by 30%."
)

print(post)   # → list of generated LinkedIn post strings

Parameters

Name Type Description
user_input str The raw text containing key points, achievements, or ideas you want to turn into a LinkedIn post.
llm Optional[BaseChatModel] A LangChain chat model instance. If omitted, the package creates a ChatLLM7 instance automatically.
api_key Optional[str] API key for LLM7. If omitted, the package reads LLM7_API_KEY from the environment or falls back to an unauthenticated request (subject to rate limits).

Using a Custom LLM

You can pass any LangChain‑compatible chat model (OpenAI, Anthropic, Google, etc.):

OpenAI

from langchain_openai import ChatOpenAI
from linkedin_post_craft import linkedin_post_craft

llm = ChatOpenAI(model="gpt-4o-mini")
post = linkedin_post_craft(user_input="My team just earned a industry award.", llm=llm)

Anthropic

from langchain_anthropic import ChatAnthropic
from linkedin_post_craft import linkedin_post_craft

llm = ChatAnthropic(model="claude-3-haiku-20240307")
post = linkedin_post_craft(user_input="Celebrating 5 years at my company!", llm=llm)

Google GenAI

from langchain_google_genai import ChatGoogleGenerativeAI
from linkedin_post_craft import linkedin_post_craft

llm = ChatGoogleGenerativeAI(model="gemini-1.5-flash")
post = linkedin_post_craft(user_input="Excited to share my new certification.", llm=llm)

Default LLM (LLM7)

If you don’t provide your own model, linkedin-post-craft uses ChatLLM7 from the langchain_llm7 package:

from linkedin_post_craft import linkedin_post_craft

post = linkedin_post_craft(
    user_input="Announcing a partnership with XYZ Corp.",
    api_key="your_llm7_api_key"   # optional; otherwise reads LLM7_API_KEY env var
)

You can obtain a free LLM7 API key by registering at https://token.llm7.io/.

The free tier’s rate limits are sufficient for most typical usage. For higher throughput, supply a paid API key via the api_key argument or the LLM7_API_KEY environment variable.

Output

The function returns a List[str] containing one or more generated LinkedIn posts that match the chosen tone and adhere to LinkedIn’s style guidelines.

Development & Issues

If you encounter bugs, have feature requests, or want to contribute, please open an issue on GitHub:

https://github.com/chigwell/linkedin-post-craft/issues

License

This project is licensed under the MIT License.

Author

Eugene Evstafev
Email: hi@eugene.plus
GitHub: @chigwell

Releases

No releases published

Packages

No packages published

Languages