@@ -121,7 +121,11 @@ async def fetch_content(
121121 tracker = DataLineageTracker (source_url = url )
122122
123123 result = await converter .from_url (url )
124- tracker .record ("extract" , tool = "trafilatura" , output_hash = DataLineageTracker .hash_content (result .markdown ))
124+ tracker .record (
125+ "extract" ,
126+ tool = "trafilatura" ,
127+ output_hash = DataLineageTracker .hash_content (result .markdown ),
128+ )
125129
126130 content_format = negotiate (accept )
127131
@@ -130,8 +134,11 @@ async def fetch_content(
130134 if content_format == ContentFormat .MARKDOWN :
131135 response = PlainTextResponse (result .markdown , media_type = "text/markdown" )
132136 _attach_compliance_headers (
133- response , signer = signer , content = result .markdown ,
134- license_type = license_type , license_id = grant_header ,
137+ response ,
138+ signer = signer ,
139+ content = result .markdown ,
140+ license_type = license_type ,
141+ license_id = grant_header ,
135142 )
136143 _attach_preferred_access (response , request )
137144 return response
@@ -164,8 +171,11 @@ async def fetch_content(
164171 response = JSONResponse (content = packet .to_jsonld ())
165172
166173 _attach_compliance_headers (
167- response , signer = signer , content = result .markdown ,
168- license_type = license_type , license_id = grant_header ,
174+ response ,
175+ signer = signer ,
176+ content = result .markdown ,
177+ license_type = license_type ,
178+ license_id = grant_header ,
169179 )
170180 _attach_preferred_access (response , request )
171181 return response
@@ -183,13 +193,15 @@ async def get_summary(
183193 result = await converter .from_url (url )
184194 summary_result = await summarizer .summarize (result .markdown )
185195
186- return JSONResponse (content = {
187- "url" : url ,
188- "title" : result .title ,
189- "author" : result .author ,
190- "summary" : summary_result .summary ,
191- "model" : summary_result .model ,
192- })
196+ return JSONResponse (
197+ content = {
198+ "url" : url ,
199+ "title" : result .title ,
200+ "author" : result .author ,
201+ "summary" : summary_result .summary ,
202+ "model" : summary_result .model ,
203+ }
204+ )
193205
194206
195207@router .get ("/content/markdown" )
@@ -206,8 +218,11 @@ async def get_markdown(
206218 grant_header = await _issue_grant_for_response (request , result .markdown , url , license_type )
207219 response = PlainTextResponse (result .markdown , media_type = "text/markdown" )
208220 _attach_compliance_headers (
209- response , signer = signer , content = result .markdown ,
210- license_type = license_type , license_id = grant_header ,
221+ response ,
222+ signer = signer ,
223+ content = result .markdown ,
224+ license_type = license_type ,
225+ license_id = grant_header ,
211226 )
212227 _attach_preferred_access (response , request )
213228 return response
@@ -236,8 +251,10 @@ async def get_optout_status(
236251 opted_out = log .is_opted_out (domain )
237252 entries = log .get_entries (domain )
238253
239- return JSONResponse (content = {
240- "domain" : domain ,
241- "opted_out" : opted_out ,
242- "entries" : [e .model_dump () for e in entries ],
243- })
254+ return JSONResponse (
255+ content = {
256+ "domain" : domain ,
257+ "opted_out" : opted_out ,
258+ "entries" : [e .model_dump () for e in entries ],
259+ }
260+ )
0 commit comments