@@ -17,7 +17,7 @@ from instaparser import InstaparserClient
1717client = InstaparserClient(api_key = " your-api-key" )
1818
1919# Parse an article from a URL
20- article = client.Article (url = " https://example.com/article" )
20+ article = client.article (url = " https://example.com/article" )
2121
2222# Access article properties
2323print (article.title)
@@ -46,34 +46,34 @@ from instaparser import InstaparserClient
4646client = InstaparserClient(api_key = " your-api-key" )
4747
4848# Parse from URL (HTML output)
49- article = client.Article (url = " https://example.com/article" )
49+ article = client.article (url = " https://example.com/article" )
5050print (article.html) # HTML content
5151print (article.body) # Same as html when output='html'
5252
5353# Parse from URL (text output)
54- article = client.Article (url = " https://example.com/article" , output = " text" )
54+ article = client.article (url = " https://example.com/article" , output = " text" )
5555print (article.text) # Plain text content
5656print (article.body) # Same as text when output='text'
5757
5858# Parse from URL (markdown output)
59- article = client.Article (url = " https://example.com/article" , output = " markdown" )
59+ article = client.article (url = " https://example.com/article" , output = " markdown" )
6060print (article.markdown) # Markdown content
6161print (article.body) # Same as markdown when output='markdown'
6262
6363# Parse from HTML content
6464html_content = " <html><body><h1>Title</h1><p>Content</p></body></html>"
65- article = client.Article (url = " https://example.com/article" , content = html_content)
65+ article = client.article (url = " https://example.com/article" , content = html_content)
6666
6767# Disable cache
68- article = client.Article (url = " https://example.com/article" , use_cache = False )
68+ article = client.article (url = " https://example.com/article" , use_cache = False )
6969```
7070
7171### Article Properties
7272
7373The ` Article ` object provides access to all parsed metadata:
7474
7575``` python
76- article = client.Article (url = " https://example.com/article" )
76+ article = client.article (url = " https://example.com/article" )
7777
7878# Basic properties
7979article.url # Canonical URL
@@ -103,7 +103,7 @@ Generate AI-powered summaries:
103103
104104``` python
105105# Generate summary
106- summary = client.Summary (url = " https://example.com/article" )
106+ summary = client.summary (url = " https://example.com/article" )
107107
108108print (summary.overview) # Concise summary
109109print (summary.key_sentences) # List of key sentences
@@ -112,7 +112,7 @@ print(summary.key_sentences) # List of key sentences
112112def on_stream_line (line ):
113113 print (f " Streaming: { line} " )
114114
115- summary = client.Summary (
115+ summary = client.summary (
116116 url = " https://example.com/article" ,
117117 stream_callback = on_stream_line
118118)
@@ -124,19 +124,19 @@ Parse PDFs from URLs or files. The PDF class inherits from Article, so it has al
124124
125125``` python
126126# Parse PDF from URL
127- pdf = client.PDF (url = " https://example.com/document.pdf" )
127+ pdf = client.pdf (url = " https://example.com/document.pdf" )
128128
129129# Parse PDF from file
130130with open (' document.pdf' , ' rb' ) as f:
131- pdf = client.PDF (file = f)
131+ pdf = client.pdf (file = f)
132132
133133# Parse PDF with text output
134- pdf = client.PDF (url = " https://example.com/document.pdf" , output = " text" )
134+ pdf = client.pdf (url = " https://example.com/document.pdf" , output = " text" )
135135print (pdf.text)
136136print (pdf.body) # Same as text when output='text'
137137
138138# Parse PDF with markdown output
139- pdf = client.PDF (url = " https://example.com/document.pdf" , output = " markdown" )
139+ pdf = client.pdf (url = " https://example.com/document.pdf" , output = " markdown" )
140140print (pdf.markdown)
141141print (pdf.body) # Same as markdown when output='markdown'
142142
@@ -162,7 +162,7 @@ from instaparser import (
162162client = InstaparserClient(api_key = " your-api-key" )
163163
164164try :
165- article = client.Article (url = " https://example.com/article" )
165+ article = client.article (url = " https://example.com/article" )
166166except InstaparserAuthenticationError:
167167 print (" Invalid API key" )
168168except InstaparserRateLimitError:
@@ -185,7 +185,7 @@ Initialize the client.
185185
186186- ` api_key ` : Your Instaparser API key
187187
188- #### ` Article (url: str, content: Optional[str] = None, output: str = 'html', use_cache: bool = True) -> Article`
188+ #### ` article (url: str, content: Optional[str] = None, output: str = 'html', use_cache: bool = True) -> Article`
189189
190190Parse an article from a URL or HTML content.
191191
@@ -196,7 +196,7 @@ Parse an article from a URL or HTML content.
196196
197197Returns: ` Article ` object
198198
199- #### ` Summary (url: str, content: Optional[str] = None, use_cache: bool = True, stream_callback: Optional[Callable[[str], None]] = None) -> Summary`
199+ #### ` summary (url: str, content: Optional[str] = None, use_cache: bool = True, stream_callback: Optional[Callable[[str], None]] = None) -> Summary`
200200
201201Generate a summary of an article.
202202
@@ -207,7 +207,7 @@ Generate a summary of an article.
207207
208208Returns: ` Summary ` object with ` key_sentences ` and ` overview ` attributes
209209
210- #### ` PDF (url: Optional[str] = None, file: Optional[Union[BinaryIO, bytes]] = None, output: str = 'html', use_cache: bool = True) -> PDF`
210+ #### ` pdf (url: Optional[str] = None, file: Optional[Union[BinaryIO, bytes]] = None, output: str = 'html', use_cache: bool = True) -> PDF`
211211
212212Parse a PDF from a URL or file.
213213
0 commit comments