Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
add python sdk ref generator
[email protected]5f683250f47e
diff --git a/.gitignore b/.gitignoreindex 4a1b14f70..155c39b82 100644--- a/.gitignore+++ b/.gitignore@@ -50,7 +50,7 @@ fern/docs/sdk/__pycache__/*.py[cod]*.pyo-+*.egg-info/# wrangler.wranglerdiff --git a/fern/docs.yml b/fern/docs.ymlindex e567bbb1c..55f02e330 100644--- a/fern/docs.yml+++ b/fern/docs.yml@@ -254,614 +254,619 @@ navigation:contents:- page: Introductionpath: tools/introduction.mdx- # - page: Ably- # path: tools/ably.mdx- # - page: Accelo- # path: tools/accelo.mdx- # - page: Acculynx- # path: tools/acculynx.mdx- # - page: Active Campaign- # path: tools/active_campaign.mdx- # - page: Adobe- # path: tools/adobe.mdx- # - page: Aero Workflow- # path: tools/aero_workflow.mdx- # - page: Affinity- # path: tools/affinity.mdx- # - page: Agencyzoom- # path: tools/agencyzoom.mdx- # - page: Ahrefs- # path: tools/ahrefs.mdx- # - page: Airtable- # path: tools/airtable.mdx- # - page: Alchemy- # path: tools/alchemy.mdx- # - page: Altoviz- # path: tools/altoviz.mdx- # - page: Amazon- # path: tools/amazon.mdx- # - page: Amcards- # path: tools/amcards.mdx- # - page: Amplitude- # path: tools/amplitude.mdx- # - page: Apaleo- # path: tools/apaleo.mdx- # - page: Apollo- # path: tools/apollo.mdx- # - page: Appdrag- # path: tools/appdrag.mdx- # - page: Appsflyer- # path: tools/appsflyer.mdx- # - page: Asana- # path: tools/asana.mdx- # - page: Ashby- # path: tools/ashby.mdx- # - page: Atlassian- # path: tools/atlassian.mdx- # - page: Attio- # path: tools/attio.mdx- # - page: Auth0- # path: tools/auth0.mdx- # - page: Axonaut- # path: tools/axonaut.mdx- # - page: Bamboohr- # path: tools/bamboohr.mdx- # - page: Bannerbear- # path: tools/bannerbear.mdx- # - page: Baserow- # path: tools/baserow.mdx- # - page: Battlenet- # path: tools/battlenet.mdx- # - page: Beeminder- # path: tools/beeminder.mdx- # - page: Bigmailer- # path: tools/bigmailer.mdx- # - page: Bitbucket- # path: tools/bitbucket.mdx- # - page: Bitwarden- # path: tools/bitwarden.mdx- # - page: Blackbaud- # path: tools/blackbaud.mdx- # - page: Blackboard- # path: tools/blackboard.mdx- # - page: Boldsign- # path: tools/boldsign.mdx- # - page: Bolna- # path: tools/bolna.mdx- # - page: Borneo- # path: tools/borneo.mdx- # - page: Botbaba- # path: tools/botbaba.mdx- # - page: Box- # path: tools/box.mdx- # - page: Braintree- # path: tools/braintree.mdx- # - page: Brandfetch- # path: tools/brandfetch.mdx- # - page: Breezy Hr- # path: tools/breezy_hr.mdx- # - page: Brevo- # path: tools/brevo.mdx- # - page: Brex- # path: tools/brex.mdx- # - page: Brex Staging- # path: tools/brex_staging.mdx- # - page: Brightpearl- # path: tools/brightpearl.mdx- # - page: Brilliant Directories- # path: tools/brilliant_directories.mdx- # - page: Browseai- # path: tools/browseai.mdx- # - page: Browserbase Tool- # path: tools/browserbase_tool.mdx- # - page: Browserhub- # path: tools/browserhub.mdx- # - page: Browserless- # path: tools/browserless.mdx- # - page: Bubble- # path: tools/bubble.mdx- # - page: Bugbug- # path: tools/bugbug.mdx- # - page: Cal- # path: tools/cal.mdx- # - page: Calendly- # path: tools/calendly.mdx- # - page: Canva- # path: tools/canva.mdx- # - page: Canvas- # path: tools/canvas.mdx- # - page: Chatwork- # path: tools/chatwork.mdx- # - page: Chmeetings- # path: tools/chmeetings.mdx- # - page: Clickup- # path: tools/clickup.mdx- # - page: Clockify- # path: tools/clockify.mdx- # - page: Close- # path: tools/close.mdx- # - page: Cloudflare- # path: tools/cloudflare.mdx- # - page: Coda- # path: tools/coda.mdx- # - page: Codeinterpreter- # path: tools/codeinterpreter.mdx- # - page: Coinbase- # path: tools/coinbase.mdx- # - page: Coinmarketcal- # path: tools/coinmarketcal.mdx- # - page: Composio- # path: tools/composio.mdx- # - page: Composio Search- # path: tools/composio_search.mdx- # - page: Confluence- # path: tools/confluence.mdx- # - page: Contentful- # path: tools/contentful.mdx- # - page: Crustdata- # path: tools/crustdata.mdx- # - page: Customer Io- # path: tools/customer_io.mdx- # - page: Cutt Ly- # path: tools/cutt_ly.mdx- # - page: D2Lbrightspace- # path: tools/d2lbrightspace.mdx- # - page: Dailybot- # path: tools/dailybot.mdx- # - page: Datadog- # path: tools/datadog.mdx- # - page: Datagma- # path: tools/datagma.mdx- # - page: Datarobot- # path: tools/datarobot.mdx- # - page: Deel- # path: tools/deel.mdx- # - page: Demio- # path: tools/demio.mdx- # - page: Dialpad- # path: tools/dialpad.mdx- # - page: Digicert- # path: tools/digicert.mdx- # - page: Discord- # path: tools/discord.mdx- # - page: Discordbot- # path: tools/discordbot.mdx- # - page: Docmosis- # path: tools/docmosis.mdx- # - page: Docusign- # path: tools/docusign.mdx- # - page: Dropbox- # path: tools/dropbox.mdx- # - page: Dropbox Sign- # path: tools/dropbox_sign.mdx- # - page: Dynamics365- # path: tools/dynamics365.mdx- # - page: Echtpost- # path: tools/echtpost.mdx- # - page: Elevenlabs- # path: tools/elevenlabs.mdx- # - page: Emailoctopus- # path: tools/emailoctopus.mdx- # - page: Enigma- # path: tools/enigma.mdx- # - page: Entelligence- # path: tools/entelligence.mdx- # - page: Epic Games- # path: tools/epic_games.mdx- # - page: Eventbrite- # path: tools/eventbrite.mdx- # - page: Exa- # path: tools/exa.mdx- # - page: Excel- # path: tools/excel.mdx- # - page: Exist- # path: tools/exist.mdx- # - page: Facebook- # path: tools/facebook.mdx- # - page: Factorial- # path: tools/factorial.mdx- # - page: Figma- # path: tools/figma.mdx- # - page: Finage- # path: tools/finage.mdx- # - page: Firecrawl- # path: tools/firecrawl.mdx- # - page: Fireflies- # path: tools/fireflies.mdx- # - page: Fitbit- # path: tools/fitbit.mdx- # - page: Flutterwave- # path: tools/flutterwave.mdx- # - page: Fomo- # path: tools/fomo.mdx- # - page: Formcarry- # path: tools/formcarry.mdx- # - page: Formsite- # path: tools/formsite.mdx- # - page: Foursquare- # path: tools/foursquare.mdx- # - page: Freshbooks- # path: tools/freshbooks.mdx- # - page: Freshdesk- # path: tools/freshdesk.mdx- # - page: Front- # path: tools/front.mdx- # - page: Github- # path: tools/github.mdx- # - page: Gmail- # path: tools/gmail.mdx- # - page: Go To Webinar- # path: tools/go_to_webinar.mdx- # - page: Gong- # path: tools/gong.mdx- # - page: Google Analytics- # path: tools/google_analytics.mdx- # - page: Google Maps- # path: tools/google_maps.mdx- # - page: Googleads- # path: tools/googleads.mdx- # - page: Googlebigquery- # path: tools/googlebigquery.mdx- # - page: Googlecalendar- # path: tools/googlecalendar.mdx- # - page: Googledocs- # path: tools/googledocs.mdx- # - page: Googledrive- # path: tools/googledrive.mdx- # - page: Googlemeet- # path: tools/googlemeet.mdx- # - page: Googlephotos- # path: tools/googlephotos.mdx- # - page: Googlesheets- # path: tools/googlesheets.mdx- # - page: Googleslides- # path: tools/googleslides.mdx- # - page: Googlesuper- # path: tools/googlesuper.mdx- # - page: Googletasks- # path: tools/googletasks.mdx- # - page: Gorgias- # path: tools/gorgias.mdx- # - page: Gumroad- # path: tools/gumroad.mdx- # - page: Guru- # path: tools/guru.mdx- # - page: Hackernews- # path: tools/hackernews.mdx- # - page: Hackerrank Work- # path: tools/hackerrank_work.mdx- # - page: Harvest- # path: tools/harvest.mdx- # - page: Helcim- # path: tools/helcim.mdx- # - page: Heygen- # path: tools/heygen.mdx- # - page: Highlevel- # path: tools/highlevel.mdx- # - page: Hubspot- # path: tools/hubspot.mdx- # - page: Humanloop- # path: tools/humanloop.mdx- # - page: Icims Talent Cloud- # path: tools/icims_talent_cloud.mdx- # - page: Idea Scale- # path: tools/idea_scale.mdx- # - page: Intercom- # path: tools/intercom.mdx- # - page: Interzoid- # path: tools/interzoid.mdx- # - page: Jira- # path: tools/jira.mdx- # - page: Junglescout- # path: tools/junglescout.mdx- # - page: Keap- # path: tools/keap.mdx- # - page: Klaviyo- # path: tools/klaviyo.mdx- # - page: Klipfolio- # path: tools/klipfolio.mdx- # - page: Kommo- # path: tools/kommo.mdx- # - page: Lastpass- # path: tools/lastpass.mdx- # - page: Launch Darkly- # path: tools/launch_darkly.mdx- # - page: Leadfeeder- # path: tools/leadfeeder.mdx- # - page: Leadoku- # path: tools/leadoku.mdx- # - page: Lever- # path: tools/lever.mdx- # - page: Lever Sandbox- # path: tools/lever_sandbox.mdx- # - page: Lexoffice- # path: tools/lexoffice.mdx- # - page: Linear- # path: tools/linear.mdx- # - page: Linkedin- # path: tools/linkedin.mdx- # - page: Linkhut- # path: tools/linkhut.mdx- # - page: Linkup- # path: tools/linkup.mdx- # - page: Listennotes- # path: tools/listennotes.mdx- # - page: Lmnt- # path: tools/lmnt.mdx- # - page: Lodgify- # path: tools/lodgify.mdx- # - page: Mailchimp- # path: tools/mailchimp.mdx- # - page: Mailerlite- # path: tools/mailerlite.mdx- # - page: Maintainx- # path: tools/maintainx.mdx- # - page: Mboum- # path: tools/mboum.mdx- # - page: Mem0- # path: tools/mem0.mdx- # - page: Metaads- # path: tools/metaads.mdx- # - page: Metatextai- # path: tools/metatextai.mdx- # - page: Microsoft Clarity- # path: tools/microsoft_clarity.mdx- # - page: Microsoft Teams- # path: tools/microsoft_teams.mdx- # - page: Microsoft Tenant- # path: tools/microsoft_tenant.mdx- # - page: Miro- # path: tools/miro.mdx- # - page: Mixpanel- # path: tools/mixpanel.mdx- # - page: Mocean- # path: tools/mocean.mdx- # - page: Monday- # path: tools/monday.mdx- # - page: Mopinion- # path: tools/mopinion.mdx- # - page: More Trees- # path: tools/more_trees.mdx- # - page: Moxie- # path: tools/moxie.mdx- # - page: Moz- # path: tools/moz.mdx- # - page: Mural- # path: tools/mural.mdx- # - page: Ncscale- # path: tools/ncscale.mdx- # - page: Neon- # path: tools/neon.mdx- # - page: Netsuite- # path: tools/netsuite.mdx- # - page: Nextdns- # path: tools/nextdns.mdx- # - page: Ngrok- # path: tools/ngrok.mdx- # - page: Notion- # path: tools/notion.mdx- # - page: Oncehub- # path: tools/oncehub.mdx- # - page: One Drive- # path: tools/one_drive.mdx- # - page: Onepage- # path: tools/onepage.mdx- # - page: Open Sea- # path: tools/open_sea.mdx- # - page: Outlook- # path: tools/outlook.mdx- # - page: Pagerduty- # path: tools/pagerduty.mdx- # - page: Pandadoc- # path: tools/pandadoc.mdx- # - page: Peopledatalabs- # path: tools/peopledatalabs.mdx- # - page: Perplexityai- # path: tools/perplexityai.mdx- # - page: Piggy- # path: tools/piggy.mdx- # - page: Pipedrive- # path: tools/pipedrive.mdx- # - page: Placekey- # path: tools/placekey.mdx- # - page: Posthog- # path: tools/posthog.mdx- # - page: Precoro- # path: tools/precoro.mdx- # - page: Printnode- # path: tools/printnode.mdx- # - page: Process Street- # path: tools/process_street.mdx- # - page: Productboard- # path: tools/productboard.mdx- # - page: Qualaroo- # path: tools/qualaroo.mdx- # - page: Quickbooks- # path: tools/quickbooks.mdx- # - page: Rafflys- # path: tools/rafflys.mdx- # - page: Ragic- # path: tools/ragic.mdx- # - page: Ramp- # path: tools/ramp.mdx- # - page: Ravenseotools- # path: tools/ravenseotools.mdx- # - page: Recallai- # path: tools/recallai.mdx- # - page: Reddit- # path: tools/reddit.mdx- # - page: Resend- # path: tools/resend.mdx- # - page: Retellai- # path: tools/retellai.mdx- # - page: Ring Central- # path: tools/ring_central.mdx- # - page: Rippling- # path: tools/rippling.mdx- # - page: Rocket Reach- # path: tools/rocket_reach.mdx- # - page: Rocketlane- # path: tools/rocketlane.mdx- # - page: Rootly- # path: tools/rootly.mdx- # - page: Rosette Text Analytics- # path: tools/rosette_text_analytics.mdx- # - page: Sage- # path: tools/sage.mdx- # - page: Salesforce- # path: tools/salesforce.mdx- # - page: Scrape Do- # path: tools/scrape_do.mdx- # - page: Scrapingant- # path: tools/scrapingant.mdx- # - page: Screenshotone- # path: tools/screenshotone.mdx- # - page: Seismic- # path: tools/seismic.mdx- # - page: Semanticscholar- # path: tools/semanticscholar.mdx- # - page: Semrush- # path: tools/semrush.mdx- # - page: Sendgrid- # path: tools/sendgrid.mdx- # - page: Sentry- # path: tools/sentry.mdx- # - page: Serpapi- # path: tools/serpapi.mdx- # - page: Servicem8- # path: tools/servicem8.mdx- # - page: Servicenow- # path: tools/servicenow.mdx- # - page: Share Point- # path: tools/share_point.mdx- # - page: Shopify- # path: tools/shopify.mdx- # - page: Shortcut- # path: tools/shortcut.mdx- # - page: Simplesat- # path: tools/simplesat.mdx- # - page: Slack- # path: tools/slack.mdx- # - page: Slackbot- # path: tools/slackbot.mdx- # - page: Smartrecruiters- # path: tools/smartrecruiters.mdx- # - page: Smugmug- # path: tools/smugmug.mdx- # - page: Snowflake- # path: tools/snowflake.mdx- # - page: Square- # path: tools/square.mdx- # - page: Stack Exchange- # path: tools/stack_exchange.mdx- # - page: Starton- # path: tools/starton.mdx- # - page: Stripe- # path: tools/stripe.mdx- # - page: Supabase- # path: tools/supabase.mdx- # - page: Survey Monkey- # path: tools/survey_monkey.mdx- # - page: Tapform- # path: tools/tapform.mdx- # - page: Tavily- # path: tools/tavily.mdx- # - page: Terminus- # path: tools/terminus.mdx- # - page: Text To Pdf- # path: tools/text_to_pdf.mdx- # - page: Textrazor- # path: tools/textrazor.mdx- # - page: Timecamp- # path: tools/timecamp.mdx- # - page: Timekit- # path: tools/timekit.mdx- # - page: Timely- # path: tools/timely.mdx- # - page: Tinypng- # path: tools/tinypng.mdx- # - page: Tinyurl- # path: tools/tinyurl.mdx- # - page: Tisane- # path: tools/tisane.mdx- # - page: Todoist- # path: tools/todoist.mdx- # - page: Toneden- # path: tools/toneden.mdx- # - page: Tpscheck- # path: tools/tpscheck.mdx- # - page: Trello- # path: tools/trello.mdx- # - page: Twitch- # path: tools/twitch.mdx- # - page: Twitter- # path: tools/twitter.mdx- # - page: Twitter Media- # path: tools/twitter_media.mdx- # - page: Typefully- # path: tools/typefully.mdx- # - page: Venly- # path: tools/venly.mdx- # - page: Vero- # path: tools/vero.mdx- # - page: Visme- # path: tools/visme.mdx- # - page: Waboxapp- # path: tools/waboxapp.mdx- # - page: Wakatime- # path: tools/wakatime.mdx- # - page: Wave Accounting- # path: tools/wave_accounting.mdx- # - page: Weathermap- # path: tools/weathermap.mdx- # - page: Webex- # path: tools/webex.mdx- # - page: Webflow- # path: tools/webflow.mdx- # - page: Whatsapp- # path: tools/whatsapp.mdx- # - page: Wiz- # path: tools/wiz.mdx- # - page: Workiom- # path: tools/workiom.mdx- # - page: Wrike- # path: tools/wrike.mdx- # - page: Xero- # path: tools/xero.mdx- # - page: Yandex- # path: tools/yandex.mdx- # - page: Ynab- # path: tools/ynab.mdx- # - page: Yousearch- # path: tools/yousearch.mdx- # - page: Youtube- # path: tools/youtube.mdx- # - page: Zendesk- # path: tools/zendesk.mdx- # - page: Zenrows- # path: tools/zenrows.mdx- # - page: Zenserp- # path: tools/zenserp.mdx- # - page: Zoho- # path: tools/zoho.mdx- # - page: Zoho Bigin- # path: tools/zoho_bigin.mdx- # - page: Zoho Books- # path: tools/zoho_books.mdx- # - page: Zoho Desk- # path: tools/zoho_desk.mdx- # - page: Zoho Inventory- # path: tools/zoho_inventory.mdx- # - page: Zoho Invoice- # path: tools/zoho_invoice.mdx- # - page: Zoho Mail- # path: tools/zoho_mail.mdx- # - page: Zoom- # path: tools/zoom.mdx- # - page: Zoominfo- # path: tools/zoominfo.mdx+ - page: Ably+ path: tools/ably.mdx+ - page: Accelo+ path: tools/accelo.mdx+ - page: Acculynx+ path: tools/acculynx.mdx+ - page: Active Campaign+ path: tools/active_campaign.mdx+ - page: Adobe+ path: tools/adobe.mdx+ - page: Aero Workflow+ path: tools/aero_workflow.mdx+ - page: Affinity+ path: tools/affinity.mdx+ - page: Agencyzoom+ path: tools/agencyzoom.mdx+ - page: Ahrefs+ path: tools/ahrefs.mdx+ - page: Airtable+ path: tools/airtable.mdx+ - page: Alchemy+ path: tools/alchemy.mdx+ - page: Altoviz+ path: tools/altoviz.mdx+ - page: Amazon+ path: tools/amazon.mdx+ - page: Amcards+ path: tools/amcards.mdx+ - page: Amplitude+ path: tools/amplitude.mdx+ - page: Apaleo+ path: tools/apaleo.mdx+ - page: Apollo+ path: tools/apollo.mdx+ - page: Appdrag+ path: tools/appdrag.mdx+ - page: Appsflyer+ path: tools/appsflyer.mdx+ - page: Asana+ path: tools/asana.mdx+ - page: Ashby+ path: tools/ashby.mdx+ - page: Atlassian+ path: tools/atlassian.mdx+ - page: Attio+ path: tools/attio.mdx+ - page: Auth0+ path: tools/auth0.mdx+ - page: Axonaut+ path: tools/axonaut.mdx+ - page: Bamboohr+ path: tools/bamboohr.mdx+ - page: Bannerbear+ path: tools/bannerbear.mdx+ - page: Baserow+ path: tools/baserow.mdx+ - page: Battlenet+ path: tools/battlenet.mdx+ - page: Beeminder+ path: tools/beeminder.mdx+ - page: Bigmailer+ path: tools/bigmailer.mdx+ - page: Bitbucket+ path: tools/bitbucket.mdx+ - page: Bitwarden+ path: tools/bitwarden.mdx+ - page: Blackbaud+ path: tools/blackbaud.mdx+ - page: Blackboard+ path: tools/blackboard.mdx+ - page: Boldsign+ path: tools/boldsign.mdx+ - page: Bolna+ path: tools/bolna.mdx+ - page: Borneo+ path: tools/borneo.mdx+ - page: Botbaba+ path: tools/botbaba.mdx+ - page: Box+ path: tools/box.mdx+ - page: Braintree+ path: tools/braintree.mdx+ - page: Brandfetch+ path: tools/brandfetch.mdx+ - page: Breezy Hr+ path: tools/breezy_hr.mdx+ - page: Brevo+ path: tools/brevo.mdx+ - page: Brex+ path: tools/brex.mdx+ - page: Brex Staging+ path: tools/brex_staging.mdx+ - page: Brightpearl+ path: tools/brightpearl.mdx+ - page: Brilliant Directories+ path: tools/brilliant_directories.mdx+ - page: Browseai+ path: tools/browseai.mdx+ - page: Browserbase Tool+ path: tools/browserbase_tool.mdx+ - page: Browserhub+ path: tools/browserhub.mdx+ - page: Browserless+ path: tools/browserless.mdx+ - page: Bubble+ path: tools/bubble.mdx+ - page: Bugbug+ path: tools/bugbug.mdx+ - page: Cal+ path: tools/cal.mdx+ - page: Calendly+ path: tools/calendly.mdx+ - page: Canva+ path: tools/canva.mdx+ - page: Canvas+ path: tools/canvas.mdx+ - page: Chatwork+ path: tools/chatwork.mdx+ - page: Chmeetings+ path: tools/chmeetings.mdx+ - page: Clickup+ path: tools/clickup.mdx+ - page: Clockify+ path: tools/clockify.mdx+ - page: Close+ path: tools/close.mdx+ - page: Cloudflare+ path: tools/cloudflare.mdx+ - page: Coda+ path: tools/coda.mdx+ - page: Codeinterpreter+ path: tools/codeinterpreter.mdx+ - page: Coinbase+ path: tools/coinbase.mdx+ - page: Coinmarketcal+ path: tools/coinmarketcal.mdx+ - page: Composio+ path: tools/composio.mdx+ - page: Composio Search+ path: tools/composio_search.mdx+ - page: Confluence+ path: tools/confluence.mdx+ - page: Contentful+ path: tools/contentful.mdx+ - page: Crustdata+ path: tools/crustdata.mdx+ - page: Customer Io+ path: tools/customer_io.mdx+ - page: Cutt Ly+ path: tools/cutt_ly.mdx+ - page: D2Lbrightspace+ path: tools/d2lbrightspace.mdx+ - page: Dailybot+ path: tools/dailybot.mdx+ - page: Datadog+ path: tools/datadog.mdx+ - page: Datagma+ path: tools/datagma.mdx+ - page: Datarobot+ path: tools/datarobot.mdx+ - page: Deel+ path: tools/deel.mdx+ - page: Demio+ path: tools/demio.mdx+ - page: Dialpad+ path: tools/dialpad.mdx+ - page: Digicert+ path: tools/digicert.mdx+ - page: Discord+ path: tools/discord.mdx+ - page: Discordbot+ path: tools/discordbot.mdx+ - page: Docmosis+ path: tools/docmosis.mdx+ - page: Docusign+ path: tools/docusign.mdx+ - page: Dropbox+ path: tools/dropbox.mdx+ - page: Dropbox Sign+ path: tools/dropbox_sign.mdx+ - page: Dynamics365+ path: tools/dynamics365.mdx+ - page: Echtpost+ path: tools/echtpost.mdx+ - page: Elevenlabs+ path: tools/elevenlabs.mdx+ - page: Emailoctopus+ path: tools/emailoctopus.mdx+ - page: Enigma+ path: tools/enigma.mdx+ - page: Entelligence+ path: tools/entelligence.mdx+ - page: Epic Games+ path: tools/epic_games.mdx+ - page: Eventbrite+ path: tools/eventbrite.mdx+ - page: Exa+ path: tools/exa.mdx+ - page: Excel+ path: tools/excel.mdx+ - page: Exist+ path: tools/exist.mdx+ - page: Facebook+ path: tools/facebook.mdx+ - page: Factorial+ path: tools/factorial.mdx+ - page: Figma+ path: tools/figma.mdx+ - page: Finage+ path: tools/finage.mdx+ - page: Firecrawl+ path: tools/firecrawl.mdx+ - page: Fireflies+ path: tools/fireflies.mdx+ - page: Fitbit+ path: tools/fitbit.mdx+ - page: Flutterwave+ path: tools/flutterwave.mdx+ - page: Fomo+ path: tools/fomo.mdx+ - page: Formcarry+ path: tools/formcarry.mdx+ - page: Formsite+ path: tools/formsite.mdx+ - page: Foursquare+ path: tools/foursquare.mdx+ - page: Freshbooks+ path: tools/freshbooks.mdx+ - page: Freshdesk+ path: tools/freshdesk.mdx+ - page: Front+ path: tools/front.mdx+ - page: Github+ path: tools/github.mdx+ - page: Gmail+ path: tools/gmail.mdx+ - page: Go To Webinar+ path: tools/go_to_webinar.mdx+ - page: Gong+ path: tools/gong.mdx+ - page: Google Analytics+ path: tools/google_analytics.mdx+ - page: Google Maps+ path: tools/google_maps.mdx+ - page: Googleads+ path: tools/googleads.mdx+ - page: Googlebigquery+ path: tools/googlebigquery.mdx+ - page: Googlecalendar+ path: tools/googlecalendar.mdx+ - page: Googledocs+ path: tools/googledocs.mdx+ - page: Googledrive+ path: tools/googledrive.mdx+ - page: Googlemeet+ path: tools/googlemeet.mdx+ - page: Googlephotos+ path: tools/googlephotos.mdx+ - page: Googlesheets+ path: tools/googlesheets.mdx+ - page: Googleslides+ path: tools/googleslides.mdx+ - page: Googlesuper+ path: tools/googlesuper.mdx+ - page: Googletasks+ path: tools/googletasks.mdx+ - page: Gorgias+ path: tools/gorgias.mdx+ - page: Gumroad+ path: tools/gumroad.mdx+ - page: Guru+ path: tools/guru.mdx+ - page: Hackernews+ path: tools/hackernews.mdx+ - page: Hackerrank Work+ path: tools/hackerrank_work.mdx+ - page: Harvest+ path: tools/harvest.mdx+ - page: Helcim+ path: tools/helcim.mdx+ - page: Heygen+ path: tools/heygen.mdx+ - page: Highlevel+ path: tools/highlevel.mdx+ - page: Hubspot+ path: tools/hubspot.mdx+ - page: Humanloop+ path: tools/humanloop.mdx+ - page: Icims Talent Cloud+ path: tools/icims_talent_cloud.mdx+ - page: Idea Scale+ path: tools/idea_scale.mdx+ - page: Intercom+ path: tools/intercom.mdx+ - page: Interzoid+ path: tools/interzoid.mdx+ - page: Jira+ path: tools/jira.mdx+ - page: Junglescout+ path: tools/junglescout.mdx+ - page: Keap+ path: tools/keap.mdx+ - page: Klaviyo+ path: tools/klaviyo.mdx+ - page: Klipfolio+ path: tools/klipfolio.mdx+ - page: Kommo+ path: tools/kommo.mdx+ - page: Lastpass+ path: tools/lastpass.mdx+ - page: Launch Darkly+ path: tools/launch_darkly.mdx+ - page: Leadfeeder+ path: tools/leadfeeder.mdx+ - page: Leadoku+ path: tools/leadoku.mdx+ - page: Lever+ path: tools/lever.mdx+ - page: Lever Sandbox+ path: tools/lever_sandbox.mdx+ - page: Lexoffice+ path: tools/lexoffice.mdx+ - page: Linear+ path: tools/linear.mdx+ - page: Linkedin+ path: tools/linkedin.mdx+ - page: Linkhut+ path: tools/linkhut.mdx+ - page: Linkup+ path: tools/linkup.mdx+ - page: Listennotes+ path: tools/listennotes.mdx+ - page: Lmnt+ path: tools/lmnt.mdx+ - page: Lodgify+ path: tools/lodgify.mdx+ - page: Mailchimp+ path: tools/mailchimp.mdx+ - page: Mailerlite+ path: tools/mailerlite.mdx+ - page: Maintainx+ path: tools/maintainx.mdx+ - page: Mboum+ path: tools/mboum.mdx+ - page: Mem0+ path: tools/mem0.mdx+ - page: Metaads+ path: tools/metaads.mdx+ - page: Metatextai+ path: tools/metatextai.mdx+ - page: Microsoft Clarity+ path: tools/microsoft_clarity.mdx+ - page: Microsoft Teams+ path: tools/microsoft_teams.mdx+ - page: Microsoft Tenant+ path: tools/microsoft_tenant.mdx+ - page: Miro+ path: tools/miro.mdx+ - page: Mixpanel+ path: tools/mixpanel.mdx+ - page: Mocean+ path: tools/mocean.mdx+ - page: Monday+ path: tools/monday.mdx+ - page: Mopinion+ path: tools/mopinion.mdx+ - page: More Trees+ path: tools/more_trees.mdx+ - page: Moxie+ path: tools/moxie.mdx+ - page: Moz+ path: tools/moz.mdx+ - page: Mural+ path: tools/mural.mdx+ - page: Ncscale+ path: tools/ncscale.mdx+ - page: Neon+ path: tools/neon.mdx+ - page: Netsuite+ path: tools/netsuite.mdx+ - page: Nextdns+ path: tools/nextdns.mdx+ - page: Ngrok+ path: tools/ngrok.mdx+ - page: Notion+ path: tools/notion.mdx+ - page: Oncehub+ path: tools/oncehub.mdx+ - page: One Drive+ path: tools/one_drive.mdx+ - page: Onepage+ path: tools/onepage.mdx+ - page: Open Sea+ path: tools/open_sea.mdx+ - page: Outlook+ path: tools/outlook.mdx+ - page: Pagerduty+ path: tools/pagerduty.mdx+ - page: Pandadoc+ path: tools/pandadoc.mdx+ - page: Peopledatalabs+ path: tools/peopledatalabs.mdx+ - page: Perplexityai+ path: tools/perplexityai.mdx+ - page: Piggy+ path: tools/piggy.mdx+ - page: Pipedrive+ path: tools/pipedrive.mdx+ - page: Placekey+ path: tools/placekey.mdx+ - page: Posthog+ path: tools/posthog.mdx+ - page: Precoro+ path: tools/precoro.mdx+ - page: Printnode+ path: tools/printnode.mdx+ - page: Process Street+ path: tools/process_street.mdx+ - page: Productboard+ path: tools/productboard.mdx+ - page: Qualaroo+ path: tools/qualaroo.mdx+ - page: Quickbooks+ path: tools/quickbooks.mdx+ - page: Rafflys+ path: tools/rafflys.mdx+ - page: Ragic+ path: tools/ragic.mdx+ - page: Ramp+ path: tools/ramp.mdx+ - page: Ravenseotools+ path: tools/ravenseotools.mdx+ - page: Recallai+ path: tools/recallai.mdx+ - page: Reddit+ path: tools/reddit.mdx+ - page: Resend+ path: tools/resend.mdx+ - page: Retellai+ path: tools/retellai.mdx+ - page: Ring Central+ path: tools/ring_central.mdx+ - page: Rippling+ path: tools/rippling.mdx+ - page: Rocket Reach+ path: tools/rocket_reach.mdx+ - page: Rocketlane+ path: tools/rocketlane.mdx+ - page: Rootly+ path: tools/rootly.mdx+ - page: Rosette Text Analytics+ path: tools/rosette_text_analytics.mdx+ - page: Sage+ path: tools/sage.mdx+ - page: Salesforce+ path: tools/salesforce.mdx+ - page: Scrape Do+ path: tools/scrape_do.mdx+ - page: Scrapingant+ path: tools/scrapingant.mdx+ - page: Screenshotone+ path: tools/screenshotone.mdx+ - page: Seismic+ path: tools/seismic.mdx+ - page: Semanticscholar+ path: tools/semanticscholar.mdx+ - page: Semrush+ path: tools/semrush.mdx+ - page: Sendgrid+ path: tools/sendgrid.mdx+ - page: Sentry+ path: tools/sentry.mdx+ - page: Serpapi+ path: tools/serpapi.mdx+ - page: Servicem8+ path: tools/servicem8.mdx+ - page: Servicenow+ path: tools/servicenow.mdx+ - page: Share Point+ path: tools/share_point.mdx+ - page: Shopify+ path: tools/shopify.mdx+ - page: Shortcut+ path: tools/shortcut.mdx+ - page: Simplesat+ path: tools/simplesat.mdx+ - page: Slack+ path: tools/slack.mdx+ - page: Slackbot+ path: tools/slackbot.mdx+ - page: Smartrecruiters+ path: tools/smartrecruiters.mdx+ - page: Smugmug+ path: tools/smugmug.mdx+ - page: Snowflake+ path: tools/snowflake.mdx+ - page: Square+ path: tools/square.mdx+ - page: Stack Exchange+ path: tools/stack_exchange.mdx+ - page: Starton+ path: tools/starton.mdx+ - page: Stripe+ path: tools/stripe.mdx+ - page: Supabase+ path: tools/supabase.mdx+ - page: Survey Monkey+ path: tools/survey_monkey.mdx+ - page: Tapform+ path: tools/tapform.mdx+ - page: Tavily+ path: tools/tavily.mdx+ - page: Terminus+ path: tools/terminus.mdx+ - page: Text To Pdf+ path: tools/text_to_pdf.mdx+ - page: Textrazor+ path: tools/textrazor.mdx+ - page: Timecamp+ path: tools/timecamp.mdx+ - page: Timekit+ path: tools/timekit.mdx+ - page: Timely+ path: tools/timely.mdx+ - page: Tinypng+ path: tools/tinypng.mdx+ - page: Tinyurl+ path: tools/tinyurl.mdx+ - page: Tisane+ path: tools/tisane.mdx+ - page: Todoist+ path: tools/todoist.mdx+ - page: Toneden+ path: tools/toneden.mdx+ - page: Tpscheck+ path: tools/tpscheck.mdx+ - page: Trello+ path: tools/trello.mdx+ - page: Twitch+ path: tools/twitch.mdx+ - page: Twitter+ path: tools/twitter.mdx+ - page: Twitter Media+ path: tools/twitter_media.mdx+ - page: Typefully+ path: tools/typefully.mdx+ - page: Venly+ path: tools/venly.mdx+ - page: Vero+ path: tools/vero.mdx+ - page: Visme+ path: tools/visme.mdx+ - page: Waboxapp+ path: tools/waboxapp.mdx+ - page: Wakatime+ path: tools/wakatime.mdx+ - page: Wave Accounting+ path: tools/wave_accounting.mdx+ - page: Weathermap+ path: tools/weathermap.mdx+ - page: Webex+ path: tools/webex.mdx+ - page: Webflow+ path: tools/webflow.mdx+ - page: Whatsapp+ path: tools/whatsapp.mdx+ - page: Wiz+ path: tools/wiz.mdx+ - page: Workiom+ path: tools/workiom.mdx+ - page: Wrike+ path: tools/wrike.mdx+ - page: Xero+ path: tools/xero.mdx+ - page: Yandex+ path: tools/yandex.mdx+ - page: Ynab+ path: tools/ynab.mdx+ - page: Yousearch+ path: tools/yousearch.mdx+ - page: Youtube+ path: tools/youtube.mdx+ - page: Zendesk+ path: tools/zendesk.mdx+ - page: Zenrows+ path: tools/zenrows.mdx+ - page: Zenserp+ path: tools/zenserp.mdx+ - page: Zoho+ path: tools/zoho.mdx+ - page: Zoho Bigin+ path: tools/zoho_bigin.mdx+ - page: Zoho Books+ path: tools/zoho_books.mdx+ - page: Zoho Desk+ path: tools/zoho_desk.mdx+ - page: Zoho Inventory+ path: tools/zoho_inventory.mdx+ - page: Zoho Invoice+ path: tools/zoho_invoice.mdx+ - page: Zoho Mail+ path: tools/zoho_mail.mdx+ - page: Zoom+ path: tools/zoom.mdx+ - page: Zoominfo+ path: tools/zoominfo.mdx- tab: sdk-referencelayout:+ - section: Python+ icon: python+ contents:+ - page: Python SDK Reference+ path: pages/sdk/python/sdk-reference.md- section: TypeScripticon: typescriptcontents:diff --git a/fern/generators/python-sdk/__init__.py b/fern/generators/python-sdk/__init__.pynew file mode 100644index 000000000..a7887f4c3--- /dev/null+++ b/fern/generators/python-sdk/__init__.py@@ -0,0 +1,6 @@+"""+Python SDK documentation generator for Composio.++This module provides tools to generate SDK documentation from Python code+using autodoc markers in markdown files.+"""\ No newline at end of filediff --git a/fern/generators/python-sdk/autodoc_core/__init__.py b/fern/generators/python-sdk/autodoc_core/__init__.pynew file mode 100644index 000000000..f5501bcb2--- /dev/null+++ b/fern/generators/python-sdk/autodoc_core/__init__.py@@ -0,0 +1 @@+# Empty init file to make this a package\ No newline at end of filediff --git a/fern/generators/python-sdk/autodoc_core/autodoc.py b/fern/generators/python-sdk/autodoc_core/autodoc.pynew file mode 100644index 000000000..493e66a27--- /dev/null+++ b/fern/generators/python-sdk/autodoc_core/autodoc.py@@ -0,0 +1,650 @@+# coding=utf-8+# Copyright 2021 The HuggingFace Team. All rights reserved.+#+# Licensed under the Apache License, Version 2.0 (the "License");+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.++import importlib+import inspect+import json+import re++from .convert_md_to_mdx import convert_md_docstring_to_mdx+from .convert_rst_to_mdx import convert_rst_docstring_to_mdx, find_indent, is_empty_line+from .external import HUGGINFACE_LIBS, get_external_object_link+++def find_object_in_package(object_name, package):+ """+ Find an object from its name inside a given package.++ Args:+ - **object_name** (`str`) -- The name of the object to retrieve.+ - **package** (`types.ModuleType`) -- The package to look into.+ """+ path_splits = object_name.split(".")+ if path_splits[0] == package.__name__:+ path_splits = path_splits[1:]++ module = package+ for idx, split in enumerate(path_splits):+ submodule = getattr(module, split, None)+ if submodule is None:+ try:+ # Try importing at this level+ full_module_path = f"{module.__name__}.{split}"+ importlib.import_module(full_module_path)+ submodule = getattr(module, split, None)+ except ImportError:+ return None # Return None if the module cannot be found or imported+ module = submodule+ if module is None:+ return None++ return module+++def remove_example_tags(text):+ tags = ["<exampletitle>", "</exampletitle>", "<example>", "</example>"]+ for tag in tags:+ text = text.replace(tag, "")+ return text+++def get_shortest_path(obj, package):+ """+ Simplifies the path to `obj` to be the shortest possible, for instance if `obj` is in the main init of its+ package.+ """+ if isinstance(obj, property):+ # Properties have no __module__ or __name__ attributes, but their getter function does.+ obj = obj.fget++ if not hasattr(obj, "__module__") or obj.__module__ is None:+ return None+ long_path = obj.__module__+ # Sometimes methods are defined in another module from the class (flax.struct.dataclass)+ if not long_path.startswith(package.__name__):+ return None+ long_name = obj.__qualname__ if hasattr(obj, "__qualname__") else obj.__name__+ short_name = long_name.split(".")[0]+ path_splits = long_path.split(".")+ module = package+ idx = module.__name__.count(".")+ while idx + 1 < len(path_splits) and not hasattr(module, short_name):+ idx += 1+ module = getattr(module, path_splits[idx])+ return ".".join(path_splits[: idx + 1]) + "." + long_name+++def get_type_name(typ):+ """+ Returns the name of the type passed, properly dealing with type annotations.+ """+ if isinstance(typ, type):+ # If it's a class, use its name.+ return getattr(typ, "__qualname__", None) or getattr(typ, "__name__", None) or str(typ)+ return str(typ) # otherwise, trust its string representation+++def format_signature(obj):+ """+ Retrieves the signature of a class, function or method.+ Returns `List(Dict(str, str))` (i.e. [{'do_lower_case', ' = True'}, ...])+ where `key` of `Dict` is f'{param_name}' & `value` of `Dict` is f': {annotation} = {default}'+ """+ params = []+ if is_getset_descriptor(obj):+ return params+ try:+ signature = inspect.signature(obj)+ except ValueError:+ # TODO: This fails for ModelOutput. Check if this is normal.+ return ""++ for idx, param in enumerate(signature.parameters.values()):+ param_name = param.name+ if idx == 0 and param_name in ("self", "cls"):+ continue+ if param.kind == inspect._ParameterKind.VAR_POSITIONAL:+ param_name = f"*{param_name}"+ elif param.kind == inspect._ParameterKind.VAR_KEYWORD:+ param_name = f"**{param_name}"+ param_type_val = ""+ if param.annotation != inspect._empty:+ annotation = get_type_name(param.annotation)+ param_type_val += f": {annotation}"+ if param.default != inspect._empty:+ default = param.default+ default = repr(default)+ param_type_val += f" = {default}"+ params.append({"name": param_name, "val": param_type_val})+ return params+++_re_parameters = re.compile(r"<parameters>(.*)</parameters>", re.DOTALL)+_re_returns = re.compile(r"<returns>(.*)</returns>", re.DOTALL)+_re_returntype = re.compile(r"<returntype>(.*)</returntype>", re.DOTALL)+_re_yields = re.compile(r"<yields>(.*)</yields>", re.DOTALL)+_re_yieldtype = re.compile(r"<yieldtype>(.*)</yieldtype>", re.DOTALL)+_re_example_tags = re.compile(r"(<exampletitle>|<example>)")+_re_parameter_group = re.compile(r"^> (.*)$", re.MULTILINE)+_re_raises = re.compile(r"<raises>(.*)</raises>", re.DOTALL)+_re_raisederrors = re.compile(r"<raisederrors>(.*)</raisederrors>", re.DOTALL)+++def get_signature_component(name, anchor, signature, object_doc, source_link=None, is_getset_desc=False):+ """+ Returns the svelte `Docstring` component string.++ Args:+ - **name** (`str`) -- The name of the function or class to document.+ - **anchor** (`str`) -- The anchor name of the function or class that will be used for hash links.+ - **signature** (`List(Dict(str,str))`) -- The signature of the object.+ - **object_doc** (`str`) -- The docstring of the the object.+ - **source_link** (Union[`str`, `None`], *optional*, defaults to `None`) -- The github source link of the the object.+ - **is_getset_desc** (`bool`, *optional*, defaults to `False`) -- Whether the type of obj is `getset_descriptor`.+ """++ def inside_example_finder_closure(match, tag):+ """+ This closure find whether parameters and/or returns sections has example code block inside it+ """+ match_str = match.group(1)+ examples_inside = _re_example_tags.search(match_str)+ if examples_inside:+ example_tag = examples_inside.group(1)+ match_str = match_str.replace(example_tag, f"</{tag}>{example_tag}", 1)+ return f"<{tag}>{match_str}"+ return f"<{tag}>{match_str}</{tag}>"++ def regex_closure(object_doc, regex):+ """+ This closure matches given regex & removes the matched group from object_doc+ """+ re_match = regex.search(object_doc)+ object_doc = regex.sub("", object_doc)+ match = None+ if re_match:+ _match = re_match.group(1).strip()+ if len(_match):+ match = _match+ return object_doc, match++ object_doc = _re_returns.sub(lambda m: inside_example_finder_closure(m, "returns"), object_doc)+ object_doc = _re_parameters.sub(lambda m: inside_example_finder_closure(m, "parameters"), object_doc)++ object_doc, parameters = regex_closure(object_doc, _re_parameters)+ object_doc, return_description = regex_closure(object_doc, _re_returns)+ object_doc, returntype = regex_closure(object_doc, _re_returntype)+ object_doc, yield_description = regex_closure(object_doc, _re_yields)+ object_doc, yieldtype = regex_closure(object_doc, _re_yieldtype)+ object_doc, raise_description = regex_closure(object_doc, _re_raises)+ object_doc, raisederrors = regex_closure(object_doc, _re_raisederrors)+ object_doc = remove_example_tags(object_doc)+ object_doc = hashlink_example_codeblock(object_doc, anchor)++ svelte_str = "<docstring>"+ svelte_str += f"<name>{name}</name>"+ svelte_str += f"<anchor>{anchor}</anchor>"+ if source_link:+ svelte_str += f"<source>{source_link}</source>"+ svelte_str += f"<parameters>{json.dumps(signature)}</parameters>"+ if is_getset_desc:+ svelte_str += "<isgetsetdescriptor>"++ if parameters is not None:+ parameters_str = ""+ groups = _re_parameter_group.split(parameters)+ group_default = groups.pop(0)+ parameters_str += f"<paramsdesc>{group_default}</paramsdesc>"+ n_groups = len(groups) // 2+ for idx in range(n_groups):+ id = idx + 1+ title, group = groups[2 * idx], groups[2 * idx + 1]+ parameters_str += f"<paramsdesc{id}title>{title}</paramsdesc{id}title>"+ parameters_str += f"<paramsdesc{id}>{group}</paramsdesc{id}>"++ svelte_str += parameters_str+ svelte_str += f"<paramgroups>{n_groups}</paramgroups>"++ if returntype is not None:+ svelte_str += f"<rettype>{returntype}</rettype>"+ if return_description is not None:+ svelte_str += f"<retdesc>{return_description}</retdesc>"++ if yieldtype is not None:+ svelte_str += f"<yieldtype>{yieldtype}</yieldtype>"+ if yield_description is not None:+ svelte_str += f"<yielddesc>{yield_description}</yielddesc>"++ if raise_description is not None:+ svelte_str += f"<raises>{raise_description}</raises>"+ if raisederrors is not None:+ svelte_str += f"<raisederrors>{raisederrors}</raisederrors>"++ svelte_str += "</docstring>"++ return svelte_str + f"\n{object_doc}\n"+++# Re pattern to catch :obj:`xx`, :class:`xx`, :func:`xx` or :meth:`xx`.+_re_rst_special_words = re.compile(r":(?:obj|func|class|meth):`([^`]+)`")+# Re pattern to catch things between double backquotes.+_re_double_backquotes = re.compile(r"(^|[^`])``([^`]+)``([^`]|$)")+# Re pattern to catch example introduction.+_re_rst_example = re.compile(r"^\s*Example.*::\s*$", flags=re.MULTILINE)+++def is_rst_docstring(docstring):+ """+ Returns `True` if `docstring` is written in rst.+ """+ if _re_rst_special_words.search(docstring) is not None:+ return True+ if _re_double_backquotes.search(docstring) is not None:+ return True+ if _re_rst_example.search(docstring) is not None:+ return True+ return False+++# Re pattern to catch example introduction & example code block.+_re_example_codeblock = re.compile(r"((.*:\s+)?^```((?!```)(.|\n))*```)", re.MULTILINE)+++def hashlink_example_codeblock(object_doc, object_anchor):+ """+ Returns the svelte `ExampleCodeBlock` component string.++ Args:+ - **object_doc** (`str`) -- The docstring of the the object.+ - **anchor** (`str`) -- The anchor name of the function or class that will be used for hash links.+ """++ example_id = 0++ def add_example_svelte_blocks(match):+ """+ This closure matches `_re_example_codeblock` regex & creates `ExampleCodeBlock` svelte component+ """+ nonlocal example_id++ example_id += 1+ id_str = "" if example_id == 1 else f"-{example_id}"+ example_anchor = f"{object_anchor}.example{id_str}"+ return f'<ExampleCodeBlock anchor="{example_anchor}">\n\n{match.group(1)}\n\n</ExampleCodeBlock>'++ object_doc = _re_example_codeblock.sub(add_example_svelte_blocks, object_doc)+ return object_doc+++# Re pattern to numpystyle docstring (e.g Parameter -------).+_re_numpydocstring = re.compile(r"(Parameter|Raise|Return|Yield)s?\n\s*----+\n")+++def is_numpy_docstring(docstring):+ """+ Returns `True` if `docstring` is written in numpystyle.+ """+ return _re_numpydocstring.search(docstring)+++def is_dataclass_autodoc(obj):+ """+ Returns boolean whether object's doc was generated automatically by `dataclass`.+ """+ if is_getset_descriptor(obj):+ return False+ try:+ signature = str(inspect.signature(obj))+ except ValueError:+ # object doesn't have signature+ return False+ doc = obj.__doc__+ doc_generated = obj.__name__ + signature+ is_generated = doc in doc_generated+ return is_generated+++def is_getset_descriptor(obj):+ """+ Returns boolean whether object is `getset_descriptor`.+ """+ # used by tokenizers @property bindings+ obj_repr = str(type(obj))+ return "getset_descriptor" in obj_repr+++def get_source_link(obj, page_info, version_tag_suffix="src/"):+ """+ Returns the link to the source code of an object on GitHub.+ """+ # Repo name defaults to package_name, but if provided in page_info, it will be used instead.+ repo_name = page_info.get("repo_name", page_info.get("package_name"))+ version_tag = page_info.get("version_tag", "main")+ repo_owner = page_info.get("repo_owner", "huggingface")+ base_link = f"https://github.com/{repo_owner}/{repo_name}/blob/{version_tag}/{version_tag_suffix}"+ module = obj.__module__.replace(".", "/")+ line_number = inspect.getsourcelines(obj)[1]+ source_file = inspect.getsourcefile(obj)+ if source_file.endswith("__init__.py"):+ return f"{base_link}{module}/__init__.py#L{line_number}"+ return f"{base_link}{module}.py#L{line_number}"+++def get_source_path(object_name, package):+ """+ Find a path to file in which given object was defined.++ Args:+ - object_name (`str`): The name of the object to retrieve.+ - package (`types.ModuleType`): The package to look into.+ """+ obj = obj = find_object_in_package(object_name=object_name, package=package)+ obj_path = inspect.getfile(obj)+ return obj_path+++def document_object(object_name, package, page_info, full_name=True, anchor_name=None, version_tag_suffix="src/"):+ """+ Writes the document of a function, class or method.++ Args:+ object_name (`str`): The name of the object to document.+ package (`types.ModuleType`): The package of the object.+ full_name (`bool`, *optional*, defaults to `True`): Whether to write the full name of the object or not.+ anchor_name (`str`, *optional*): The name to give to the anchor for this object.+ version_tag_suffix (`str`, *optional*, defaults to `"src/"`):+ Suffix to add after the version tag (e.g. 1.3.0 or main) in the documentation links.+ For example, the default `"src/"` suffix will result in a base link as `https://github.com/{repo_owner}/{package_name}/blob/{version_tag}/src/`.+ For example, `version_tag_suffix=""` will result in a base link as `https://github.com/{repo_owner}/{package_name}/blob/{version_tag}/`.+ """+ if page_info is None:+ page_info = {}+ if "package_name" not in page_info:+ page_info["package_name"] = package.__name__+ obj = find_object_in_package(object_name=object_name, package=package)+ if obj is None:+ raise ValueError(+ f"Unable to find {object_name} in {package.__name__}. Make sure the path to that object is correct."+ )+ if isinstance(obj, property):+ # Propreties have no __module__ or __name__ attributes, but their getter function does.+ obj = obj.fget++ if anchor_name is None:+ anchor_name = get_shortest_path(obj, package)+ if full_name and anchor_name is not None:+ name = anchor_name+ else:+ name = obj.__name__++ prefix = "class " if isinstance(obj, type) else ""+ object_doc = ""+ signature_name = prefix + name+ signature = format_signature(obj)+ check = None+ if getattr(obj, "__doc__", None) is not None and len(obj.__doc__) > 0:+ object_doc = obj.__doc__+ if is_dataclass_autodoc(obj):+ object_doc = ""+ elif is_rst_docstring(object_doc):+ object_doc = convert_rst_docstring_to_mdx(obj.__doc__, page_info)+ else:+ check = quality_check_docstring(object_doc, object_name=object_name)+ object_doc = convert_md_docstring_to_mdx(obj.__doc__, page_info)++ try:+ source_link = get_source_link(obj, page_info, version_tag_suffix)+ except (AttributeError, OSError, TypeError):+ # tokenizers obj do NOT have `__module__` attribute & can NOT be used with inspect.getsourcelines+ source_link = None+ is_getset_desc = is_getset_descriptor(obj)+ component = get_signature_component(+ signature_name, anchor_name, signature, object_doc, source_link, is_getset_desc+ )+ documentation = "\n" + component + "\n"+ return documentation, check+++def find_documented_methods(clas):+ """+ Find all the public methods of a given class that have a nonempty documentation, filtering the methods documented+ the exact same way in a superclass.+ """+ public_attrs = {a: getattr(clas, a) for a in dir(clas) if not a.startswith("_")}+ public_methods = {a: m for a, m in public_attrs.items() if callable(m) and not isinstance(m, type)}+ documented_methods = {+ a: m for a, m in public_methods.items() if getattr(m, "__doc__", None) is not None and len(m.__doc__) > 0+ }++ superclasses = clas.mro()[1:]+ for superclass in superclasses:+ superclass_methods = {a: getattr(superclass, a) for a in documented_methods.keys() if hasattr(superclass, a)}+ documented_methods = {+ a: m+ for a, m in documented_methods.items()+ if (+ a not in superclass_methods+ or getattr(superclass_methods[a], "__doc__", None) is None+ or m.__doc__ != superclass_methods[a].__doc__+ )+ }+ return list(documented_methods.keys())+++docstring_css_classes = "docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"+++def autodoc(object_name, package, methods=None, return_anchors=False, page_info=None, version_tag_suffix="src/"):+ """+ Generates the documentation of an object, with a potential filtering on the methods for a class.++ Args:+ object_name (`str`): The name of the function or class to document.+ package (`types.ModuleType`): The package of the object.+ methods (`List[str]`, *optional*):+ A list of methods to document if `obj` is a class. If nothing is passed, all public methods with a new+ docstring compared to the superclasses are documented. If a list of methods is passed and ou want to add+ all those methods, the key "all" will add them.+ return_anchors (`bool`, *optional*, defaults to `False`):+ Whether or not to return the list of anchors generated.+ page_info (`Dict[str, str]`, *optional*): Some information about the page.+ version_tag_suffix (`str`, *optional*, defaults to `"src/"`):+ Suffix to add after the version tag (e.g. 1.3.0 or main) in the documentation links.+ For example, the default `"src/"` suffix will result in a base link as `https://github.com/{repo_owner}/{package_name}/blob/{version_tag}/src/`.+ For example, `version_tag_suffix=""` will result in a base link as `https://github.com/{repo_owner}/{package_name}/blob/{version_tag}/`.+ """+ if page_info is None:+ page_info = {}+ if "package_name" not in page_info:+ page_info["package_name"] = package.__name__++ errors = []+ obj = find_object_in_package(object_name=object_name, package=package)+ documentation, check = document_object(+ object_name=object_name, package=package, page_info=page_info, version_tag_suffix=version_tag_suffix+ )+ if check is not None:+ errors.append(check)++ if return_anchors:+ anchors = [get_shortest_path(obj, package)]+ if isinstance(obj, type):+ documentation, check = document_object(+ object_name=object_name, package=package, page_info=page_info, version_tag_suffix=version_tag_suffix+ )+ if check is not None:+ errors.append(check)+ if methods is None:+ methods = find_documented_methods(obj)+ elif "all" in methods:+ methods.remove("all")+ methods_to_add = find_documented_methods(obj)+ methods.extend([m for m in methods_to_add if m not in methods])+ elif "none" in methods:+ methods = []+ for method in methods:+ anchor_name = f"{anchors[0]}.{method}"+ method_doc, check = document_object(+ object_name=f"{object_name}.{method}",+ package=package,+ page_info=page_info,+ full_name=False,+ anchor_name=anchor_name,+ version_tag_suffix=version_tag_suffix,+ )+ if check is not None:+ errors.append(check)+ documentation += f'\n<div class="{docstring_css_classes}">\n\n' + method_doc + "</div>"+ if return_anchors:+ # The anchor name of the method might be different from its+ method = find_object_in_package(f"{anchors[0]}.{method}", package=package)+ method_name = get_shortest_path(method, package=package)+ if anchor_name == method_name or method_name is None:+ anchors.append(anchor_name)+ else:+ anchors.append((anchor_name, method_name))+ documentation = f'<div class="{docstring_css_classes}">\n\n' + documentation + "</div>\n"++ return (documentation, anchors, errors) if return_anchors else documentation+++def resolve_links_in_text(text, package, mapping, page_info):+ """+ Resolve links of the form [`SomeClass`] to the link in the documentation to `SomeClass`.++ Args:+ text (`str`): The text in which to convert the links.+ package (`types.ModuleType`): The package in which to search objects for.+ mapping (`Dict[str, str]`): The map from anchor names of objects to their page in the documentation.+ page_info (`Dict[str, str]`): Some information about the page.+ """+ package_name = page_info.get("package_name", package.__name__)+ version = page_info.get("version", "main")+ language = page_info.get("language", "en")++ prefix = f"/docs/{package_name}/{version}/{language}/"++ def _resolve_link(search):+ object_or_param_name, last_char = search.groups()+ # Deal with external libs first.+ lib_name = object_or_param_name.split(".")[0]+ if lib_name.startswith("~"):+ lib_name = lib_name[1:]+ if lib_name in HUGGINFACE_LIBS and lib_name != package_name:+ link = get_external_object_link(object_or_param_name, page_info)+ return f"{link}{last_char}"+ object_name, param_name = None, None+ # If `#` is in the name, assume it's a link to the function/method parameter.+ if "#" in object_or_param_name:+ object_name_for_param = object_or_param_name.split("#", 1)[0]+ # Strip preceding `~` if it's there.+ object_name_for_param = (+ object_name_for_param[1:] if object_name_for_param.startswith("~") else object_name_for_param+ )+ obj = find_object_in_package(object_name_for_param, package)+ param_name = object_or_param_name.split("#", 1)[-1]+ # If the name begins with `~`, we shortcut to the last part.+ elif object_or_param_name.startswith("~"):+ obj = find_object_in_package(object_or_param_name[1:], package)+ object_name = object_or_param_name.split(".")[-1]+ else:+ obj = find_object_in_package(object_or_param_name, package)+ object_name = object_or_param_name+ # Object not found, return the original link text.+ if obj is None:+ return f"`{object_or_param_name}`{last_char}"++ link_name = object_name if param_name is None else param_name++ # If the link points to an object and the object is not a class, we add ()+ if param_name is None and not isinstance(obj, (type, property)):+ link_name = f"{link_name}()"++ # Link to the anchor+ anchor = get_shortest_path(obj, package)+ if anchor not in mapping:+ return f"`{link_name}`{last_char}"+ page = f"{prefix}{mapping[anchor]}"+ if param_name:+ anchor = f"{anchor}.{param_name}"+ if "#" in page:+ return f"[{link_name}]({page}){last_char}"+ else:+ return f"[{link_name}]({page}#{anchor}){last_char}"++ return re.sub(r"\[`([^`]+)`\]([^\(])", _resolve_link, text)+++# Re pattern that catches the start of a block code with potential indent.+_re_start_code_block = re.compile(r"^\s*```.*$", flags=re.MULTILINE)+# Re pattern that catches return blocks of the form `Return:`.+_re_returns_block = re.compile(r"^\s*Returns?:\s*$")+++def quality_check_docstring(docstring, object_name=None):+ """+ Check if a docstring is not going to generate a common error on moon-landing, by asserting it does not have:++ - an empty Return block+ - two (or more) Return blocks+ - a code sample not properly closed.++ This function only returns an error message and does not raise an exception, as we will raise one single exception+ with all the problems at the end.++ Args:+ docstring (`str`): The docstring to check.+ obejct_name (`str`, *optional*): The name of the object being documented.+ Will be added to the error message if passed.++ Returns:+ Optional `str`: Returns `None` if the docstring is correct and an error message otherwise.+ """++ lines = docstring.split("\n")+ in_code = False+ code_indent = 0+ return_blocks = 0+ error_message = ""++ for idx, line in enumerate(lines):+ if not in_code and _re_start_code_block.search(line) is not None:+ in_code = True+ code_indent = find_indent(line)+ elif in_code and line.rstrip() == " " * code_indent + "```":+ in_code = False+ elif _re_returns_block.search(line) is not None:+ next_line_idx = idx + 1+ while next_line_idx < len(lines) and is_empty_line(lines[next_line_idx]):+ next_line_idx += 1+ if next_line_idx >= len(lines) or find_indent(lines[next_line_idx]) <= find_indent(line):+ error_message += "- The return block is empty.\n"+ else:+ return_blocks += 1++ if in_code:+ error_message += "- A code block has been opened but is not closed.\n"+ if return_blocks >= 2:+ error_message += f"- There are {return_blocks} Returns block. Only one max is supported.\n"++ if len(error_message) == 0:+ return++ if object_name is not None:+ error_message = (+ f"The docstring of {object_name} comports the following issue(s) and needs fixing:\n" + error_message+ )++ return error_messagediff --git a/fern/generators/python-sdk/autodoc_core/convert_md_to_mdx.py b/fern/generators/python-sdk/autodoc_core/convert_md_to_mdx.pynew file mode 100644index 000000000..870def983--- /dev/null+++ b/fern/generators/python-sdk/autodoc_core/convert_md_to_mdx.py@@ -0,0 +1,241 @@+# coding=utf-8+# Copyright 2021 The HuggingFace Team. All rights reserved.+#+# Licensed under the Apache License, Version 2.0 (the "License");+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+++import json+import re+import tempfile++from .convert_rst_to_mdx import parse_rst_docstring, remove_indent+++_re_doctest_flags = re.compile(r"^(>>>.*\S)(\s+)# doctest:\s+\+[A-Z_]+\s*$", flags=re.MULTILINE)+++def convert_md_to_mdx(md_text, page_info):+ """+ Convert a document written in md to mdx.+ """+ return (+ """<script lang="ts">+import {onMount} from "svelte";+import Tip from "$lib/Tip.svelte";+import Youtube from "$lib/Youtube.svelte";+import Docstring from "$lib/Docstring.svelte";+import CodeBlock from "$lib/CodeBlock.svelte";+import CodeBlockFw from "$lib/CodeBlockFw.svelte";+import DocNotebookDropdown from "$lib/DocNotebookDropdown.svelte";+import CourseFloatingBanner from "$lib/CourseFloatingBanner.svelte";+import IconCopyLink from "$lib/IconCopyLink.svelte";+import FrameworkContent from "$lib/FrameworkContent.svelte";+import Markdown from "$lib/Markdown.svelte";+import Question from "$lib/Question.svelte";+import FrameworkSwitchCourse from "$lib/FrameworkSwitchCourse.svelte";+import InferenceApi from "$lib/InferenceApi.svelte";+import TokenizersLanguageContent from "$lib/TokenizersLanguageContent.svelte";+import ExampleCodeBlock from "$lib/ExampleCodeBlock.svelte";+import Added from "$lib/Added.svelte";+import Changed from "$lib/Changed.svelte";+import Deprecated from "$lib/Deprecated.svelte";+import PipelineIcon from "$lib/PipelineIcon.svelte";+import PipelineTag from "$lib/PipelineTag.svelte";+import Heading from "$lib/Heading.svelte";+import HfOptions from "$lib/HfOptions.svelte";+import HfOption from "$lib/HfOption.svelte";+import EditOnGithub from "$lib/EditOnGithub.svelte";+import InferenceSnippet from "$lib/InferenceSnippet/InferenceSnippet.svelte";+let fw: "pt" | "tf" = "pt";+onMount(() => {+ const urlParams = new URLSearchParams(window.location.search);+ fw = urlParams.get("fw") || "pt";+});+</script>+<svelte:head>+ <meta name="hf:doc:metadata" content={metadata} >+</svelte:head>++<!--HF DOCBUILD BODY START-->++HF_DOC_BODY_START++"""+ + process_md(md_text, page_info)+ + edit_on_github(page_info)+ + """++<!--HF DOCBUILD BODY END-->++HF_DOC_BODY_END++"""+ )+++def edit_on_github(page_info):+ """+ Svelte component string that adds "Update on Github" btn.+ """+ if "path" not in page_info or "repo_name" not in page_info:+ return ""+ path = str(page_info["path"])+ package_name = page_info["repo_name"]+ idx = path.find(package_name)+ if idx == -1:+ return ""+ relative_path = path[idx + len(package_name) :]+ if relative_path.startswith("/"):+ relative_path = relative_path[1:]+ source = f'https://github.com/{page_info["repo_owner"]}/{page_info["repo_name"]}/blob/main/{relative_path}'+ return f'\n\n<EditOnGithub source="{source}" />\n\n'+++def convert_img_links(text, page_info):+ """+ Convert image links to correct URL paths.+ """+ if "package_name" not in page_info:+ raise ValueError("`page_info` must contain at least the package_name.")+ package_name = page_info["package_name"]+ version = page_info.get("version", "main")+ language = page_info.get("language", "en")++ _re_img_link = re.compile(r"(src=\"|\()/imgs/")+ while _re_img_link.search(text):+ text = _re_img_link.sub(rf"\1/docs/{package_name}/{version}/{language}/imgs/", text)+ return text+++_re_md_img_tag_alt = re.compile(r"!\[([^\]]+)\]", re.I)+_re_html_img_tag_alt = re.compile(r"<img [^>]*?alt=([\"'])([^\1]*?)\1[^>]*?>", re.I)+++def escape_img_alt_description(text):+ """+ Escapes ` with ' inside <img> alt description since it causes svelte/mdsvex compiler error.+ """++ def replace_md_alt_content(match):+ alt_content = match.group(1)+ new_alt_content = alt_content.replace("`", "'")+ return match.group(0).replace(alt_content, new_alt_content)++ def replace_html_alt_content(match):+ alt_content = match.group(2) # group(2) contains the alt text for the HTML regex+ new_alt_content = alt_content.replace("`", "'")+ return match.group(0).replace(alt_content, new_alt_content)++ # Replace markdown style image alt text+ if _re_md_img_tag_alt.search(text):+ text = _re_md_img_tag_alt.sub(replace_md_alt_content, text)++ # Replace HTML style image alt text+ if _re_html_img_tag_alt.search(text):+ text = _re_html_img_tag_alt.sub(replace_html_alt_content, text)++ return text+++def fix_img_links(text, page_info):+ text = convert_img_links(text, page_info)+ text = escape_img_alt_description(text)+ return text+++def clean_doctest_syntax(text):+ """+ Clean the doctest artifacts in a given content.+ """+ text = text.replace(">>> # ===PT-TF-SPLIT===", "===PT-TF-SPLIT===")+ text = _re_doctest_flags.sub(r"\1", text)+ return text+++_re_include_template = r"([ \t]*)<{include_name}>(((?!<{include_name}>).)*)<\/{include_name}>"+_re_include = re.compile(_re_include_template.format(include_name="include"), re.DOTALL)+_re_literalinclude = re.compile(_re_include_template.format(include_name="literalinclude"), re.DOTALL)+++def convert_file_include_helper(match, page_info, is_code=True):+ """+ Convert an `include` or `literalinclude` regex match into markdown blocks or markdown code blocks,+ by opening a file and copying specified start-end section into markdown block.++ If `is_code` is True, the block will be rendered as a code block, otherwise it will be rendered+ as a markdown block.+ """+ include_info = json.loads(match[2].strip())+ indent = match[1]+ include_name = "literalinclude" if is_code else "include"+ if tempfile.gettempdir() in str(page_info["path"]):+ return f"\n`Please restart doc-builder preview commands to see {include_name} rendered`\n"+ file = page_info["path"].parent / include_info["path"]+ with open(file, "r", encoding="utf-8-sig") as reader:+ lines = reader.readlines()+ include = lines # defaults to entire file+ if "start-after" in include_info or "end-before" in include_info:+ start_after, end_before = -1, -1+ for idx, line in enumerate(lines):+ line = line.strip()+ line = re.sub(r"\W+$", "", line)+ if line.endswith(include_info["start-after"]):+ start_after = idx + 1+ if line.endswith(include_info["end-before"]):+ end_before = idx+ if start_after == -1 or end_before == -1:+ raise ValueError(f"The following '{include_name}' does NOT exist:\n{match[0]}")+ include = lines[start_after:end_before]+ include = [indent + line[include_info.get("dedent", 0) :] for line in include]+ include = "".join(include).rstrip()+ return f"""{indent}```{include_info.get('language', '')}\n{include}\n{indent}```""" if is_code else include+++def convert_include(text, page_info):+ """+ Convert an `include` into markdown.+ """+ text = _re_include.sub(lambda m: convert_file_include_helper(m, page_info, is_code=False), text)+ return text+++def convert_literalinclude(text, page_info):+ """+ Convert a `literalinclude` into markdown code blocks.+ """+ text = _re_literalinclude.sub(lambda m: convert_file_include_helper(m, page_info, is_code=True), text)+ return text+++def convert_md_docstring_to_mdx(docstring, page_info):+ """+ Convert a docstring written in Markdown to mdx.+ """+ text = parse_rst_docstring(docstring)+ text = remove_indent(text)+ return process_md(text, page_info)+++def process_md(text, page_info):+ """+ Processes markdown by:+ 1. Convert include+ 2. Convert literalinclude+ 3. Clean doctest syntax+ 4. Fix image links+ """+ text = convert_include(text, page_info)+ text = convert_literalinclude(text, page_info)+ text = clean_doctest_syntax(text)+ text = fix_img_links(text, page_info)+ return textdiff --git a/fern/generators/python-sdk/autodoc_core/convert_rst_to_mdx.py b/fern/generators/python-sdk/autodoc_core/convert_rst_to_mdx.pynew file mode 100644index 000000000..67379c2f1--- /dev/null+++ b/fern/generators/python-sdk/autodoc_core/convert_rst_to_mdx.py@@ -0,0 +1,705 @@+# coding=utf-8+# Copyright 2021 The HuggingFace Team. All rights reserved.+#+# Licensed under the Apache License, Version 2.0 (the "License");+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+++import re+++# Re pattern to catch things inside ` ` in :obj:`thing`.+_re_obj = re.compile(r":obj:`([^`]+)`")+# Re pattern to catch things inside ` ` in :math:`thing`.+_re_math = re.compile(r":math:`([^`]+)`")+# Re pattern to catch things between single backquotes.+_re_single_backquotes = re.compile(r"(^|[^`])`([^`]+)`([^`]|$)")+# Re pattern to catch things between double backquotes.+_re_double_backquotes = re.compile(r"(^|[^`])``([^`]+)``([^`]|$)")+# Re pattern to catch things inside ` ` in :func/class/meth:`thing`.+_re_func_class = re.compile(r":(?:func|class|meth):`([^`]+)`")+++def convert_rst_formatting(text):+ """+ Convert rst syntax for formatting to markdown in a given text.+ """+ # Remove :class:, :func: and :meth: markers. To code-links and put double backquotes+ # (to not be caught by the italic conversion).+ text = _re_func_class.sub(r"[``\1``]", text)+ # Remove :obj: markers. What's after is in a single backquotes so we put in double backquotes+ # (to not be caught by the italic conversion).+ text = _re_obj.sub(r"``\1``", text)+ # Remove :math: markers.+ text = _re_math.sub(r"\\\\(\1\\\\)", text)+ # Convert content in single backquotes to italic.+ text = _re_single_backquotes.sub(r"\1*\2*\3", text)+ # Convert content in double backquotes to single backquotes.+ text = _re_double_backquotes.sub(r"\1`\2`\3", text)+ # Remove remaining ::+ text = re.sub(r"::\n", "", text)++ # Remove new lines inside blocks in backsticks as they will be kept.+ lines = text.split("\n")+ in_code = False+ text = None+ for line in lines:+ if in_code:+ splits = line.split("`")+ in_code = len(splits) > 1 and len(splits) % 2 == 1+ if len(splits) == 1:+ # Some forgotten lone backstick+ text += "\n" + line+ else:+ text += " " + line.lstrip()+ else:+ if text is not None:+ text += "\n" + line+ else:+ text = line+ splits = line.split("`")+ in_code = len(splits) % 2 == 0+ return text+++# Re pattern to catch description and url in links of the form `description <url>`_.+_re_links = re.compile(r"`([^`]+\S)\s+</*([^/][^>`]*)>`_+")+# Re pattern to catch description and url in links of the form :prefix_link:`description <url>`_.+_re_prefix_links = re.compile(r":prefix_link:`([^`]+\S)\s+</*([^/][^>`]*)>`")+# Re pattern to catch reference in links of the form :doc:`reference`.+_re_simple_doc = re.compile(r":doc:`([^`<]*)`")+# Re pattern to catch description and reference in links of the form :doc:`description <reference>`.+_re_doc_with_description = re.compile(r":doc:`([^`<]+\S)\s+</*([^/][^>`]*)>`")+# Re pattern to catch reference in links of the form :ref:`reference`.+_re_simple_ref = re.compile(r":ref:`([^`<]*)`")+# Re pattern to catch description and reference in links of the form :ref:`description <reference>`.+_re_ref_with_description = re.compile(r":ref:`([^`<]+\S)\s+<([^>]*)>`")+++def convert_rst_links(text, page_info):+ """+ Convert the rst links in text to markdown.+ """+ if "package_name" not in page_info:+ raise ValueError("`page_info` must contain at least the package_name.")+ package_name = page_info["package_name"]+ version = page_info.get("version", "main")+ language = page_info.get("language", "en")+ no_prefix = page_info.get("no_prefix", False)++ prefix = "" if no_prefix else f"/docs/{package_name}/{version}/{language}/"+ # Links of the form :doc:`page`+ text = _re_simple_doc.sub(rf"[\1]({prefix}\1)", text)+ # Links of the form :doc:`text <page>`+ text = _re_doc_with_description.sub(rf"[\1]({prefix}\2)", text)++ if "page" in page_info and not no_prefix:+ page = str(page_info["page"])+ if page.endswith(".html"):+ page = page[:-5]+ prefix = f"{prefix}{page}"+ else:+ prefix = ""+ # Refs of the form :ref:`page`+ text = _re_simple_ref.sub(rf"[\1]({prefix}#\1)", text)+ # Refs of the form :ref:`text <page>`+ text = _re_ref_with_description.sub(rf"[\1]({prefix}#\2)", text)++ # Links with a prefix+ # TODO: when it exists, use the API to deal with prefix links properly.+ prefix = f"https://github.com/huggingface/{package_name}/tree/main/"+ text = _re_prefix_links.sub(rf"[\1]({prefix}\2)", text)+ # Other links+ text = _re_links.sub(r"[\1](\2)", text)+ # Relative links or Transformers links need to remove the .html+ if "(https://https://huggingface.co/" in text or re.search(r"\(\.+/", text) is not None:+ text = text.replace(".html", "")+ return text+++# Re pattern that catches examples blocks of the form `Example::`.+_re_example = re.compile(r"^\s*(\S.*)::\s*$")+# Re pattern that catches rst blocks of the form `.. block_name::`.+_re_block = re.compile(r"^\s*\.\.\s+(\S+)::")+# Re pattern that catches what's after the :: in rst blocks of the form `.. block_name:: something`.+_re_block_info = re.compile(r"^\s*\.\.\s+\S+::\s*(\S.*)$")+++def is_empty_line(line):+ return len(line) == 0 or line.isspace()+++def find_indent(line):+ """+ Returns the number of spaces that start a line indent.+ """+ search = re.search(r"^(\s*)(?:\S|$)", line)+ if search is None:+ return 0+ return len(search.groups()[0])+++_re_rst_option = re.compile(r"^\s*:(\S+):(.*)$")+++def convert_special_chars(text):+ """+ Converts { and < that have special meanings in MDX.+ """+ text = text.replace("{", "&lcub;")+ # We don't want to replace those by the HTML code, so we temporarily set them at LTHTML+ text = re.sub(r"<(img|br|hr|Youtube)", r"LTHTML\1", text) # html void elements with no closing counterpart+ _re_lt_html = re.compile(r"<(\S+)([^>]*>)(((?!</\1>).)*)<(/\1>)", re.DOTALL)+ while _re_lt_html.search(text):+ text = _re_lt_html.sub(r"LTHTML\1\2\3LTHTML\5", text)+ text = re.sub(r"(^|[^<])<([^<]|$)", r"\1&lt;\2", text)+ text = text.replace("LTHTML", "<")+ return text+++def parse_options(block_content):+ """+ Parses the option in some rst block content.+ """+ block_lines = block_content.split("\n")+ block_indent = find_indent(block_lines[0])+ current_option = None+ result = {}+ for line in block_lines:+ if _re_rst_option.search(line) is not None:+ current_option, value = _re_rst_option.search(line).groups()+ result[current_option] = value.lstrip()+ elif find_indent(line) > block_indent:+ result[current_option] += " " + line.lstrip()++ return result+++def apply_min_indent(text, min_indent):+ """+ Make sure all lines in a text are have a minimum indentation.++ Args:+ text (`str`): The text to treat.+ min_indent (`int`): The minimal indentation.++ Returns:+ `str`: The processed text.+ """+ lines = text.split("\n")+ idx = 0+ while idx < len(lines):+ if is_empty_line(lines[idx]):+ idx += 1+ continue+ indent = find_indent(lines[idx])+ if indent < min_indent:+ while idx < len(lines) and (find_indent(lines[idx]) >= indent or is_empty_line(lines[idx])):+ if not is_empty_line(lines[idx]):+ lines[idx] = " " * (min_indent - indent) + lines[idx]+ idx += 1+ else:+ idx += 1++ return "\n".join(lines)+++def convert_rst_blocks(text, page_info):+ """+ Converts rst special blocks (examples, notes) into MDX.+ """+ if "package_name" not in page_info:+ raise ValueError("`page_info` must contain at least the package_name.")+ package_name = page_info["package_name"]+ version = page_info.get("version", "main")+ language = page_info.get("language", "en")++ lines = text.split("\n")+ idx = 0+ new_lines = []+ while idx < len(lines):+ block_type = None+ block_info = None+ if _re_block.search(lines[idx]) is not None:+ block_type = _re_block.search(lines[idx]).groups()[0]+ if _re_block_info.search(lines[idx]) is not None:+ block_info = _re_block_info.search(lines[idx]).groups()[0]+ elif _re_example.search(lines[idx]) is not None:+ block_type = "code-block-example"+ block_info = "python"+ example_name = _re_example.search(lines[idx]).groups()[0]+ new_lines.append(f"<exampletitle>{example_name}:</exampletitle>\n")+ elif lines[idx].strip() == "..":+ block_type = "comment"+ elif lines[idx].strip() == "::":+ block_type = "code-block"++ if block_type is not None:+ block_indent = find_indent(lines[idx])+ # Find the next nonempty line+ idx += 1+ while idx < len(lines) and is_empty_line(lines[idx]):+ idx += 1+ # Grab the indent of the return line, this block will stop when we unindent under it (or has already)+ example_indent = find_indent(lines[idx]) if idx < len(lines) else block_indent++ if example_indent == block_indent:+ block_content = ""+ else:+ block_lines = []+ while idx < len(lines) and (is_empty_line(lines[idx]) or find_indent(lines[idx]) >= example_indent):+ block_lines.append(lines[idx][example_indent:])+ idx += 1+ block_content = "\n".join(block_lines)++ if block_type in ["code", "code-block"]:+ prefix = "```" if block_info is None else f"```{block_info}"+ new_lines.append(f"{prefix}\n{block_content.strip()}\n```\n")+ elif block_type == "code-block-example":+ prefix = f"<example>```{block_info}"+ new_lines.append(f"{prefix}\n{block_content.strip()}\n```\n</example>")+ elif block_type == "note":+ new_lines.append(apply_min_indent(f"<Tip>\n\n{block_content.strip()}\n\n</Tip>\n", block_indent))+ elif block_type == "warning":+ new_lines.append(+ apply_min_indent("<Tip warning={true}>\n\n" + f"{block_content.strip()}\n\n</Tip>\n", block_indent)+ )+ elif block_type == "raw":+ new_lines.append(block_content.strip() + "\n")+ elif block_type == "math":+ new_lines.append(f"$${block_content.strip()}$$\n")+ elif block_type == "comment":+ new_lines.append(f"<!--{block_content.strip()}\n-->\n")+ elif block_type == "autofunction":+ if block_info is not None:+ new_lines.append(f"[[autodoc]] {block_info}\n")+ elif block_type == "autoclass":+ if block_info is not None:+ block = f"[[autodoc]] {block_info}\n"+ options = parse_options(block_content)+ if "special-members" in options:+ special_members = options["special-members"].split(", ")+ for special_member in special_members:+ block += f" - {special_member}\n"+ if "members" in options:+ members = options["members"]+ if len(members) == 0:+ block += " - all\n"+ else:+ for member in members.split(", "):+ block += f" - {member}\n"+ new_lines.append(block)+ elif block_type == "image":+ options = parse_options(block_content)+ target = options.pop("target", None)+ if block_info is not None:+ options["src"] = block_info+ else:+ if target is None:+ raise ValueError("Image source not defined.")+ options["src"] = target+ # Adapt path+ options["src"] = options["src"].replace("/imgs/", f"/docs/{package_name}/{version}/{language}/imgs/")+ html_code = " ".join([f'{key}="{value}"' for key, value in options.items()])+ new_lines.append(f"<img {html_code}/>\n")++ else:+ new_lines.append(f"{block_type},{block_info}\n{block_content.rstrip()}\n")++ else:+ new_lines.append(lines[idx])+ idx += 1++ return "\n".join(new_lines)+++# Re pattern that catches rst args blocks of the form `Parameters:`.+_re_args = re.compile(r"^\s*(Args?|Arguments?|Attributes?|Params?|Parameters?):\s*$")+# Re pattern that catches return blocks of the form `Return:`.+_re_returns = re.compile(r"^\s*(Return|Yield|Raise)s?:\s*$")+++def split_return_line(line):+ """+ Split the return line with format `type: some doc`. Type may contain colons in the form of :obj: or :class:.+ """+ splits_on_colon = line.split(":")+ idx = 1+ while idx < len(splits_on_colon) and splits_on_colon[idx] in ["obj", "class"]:+ idx += 2+ if idx >= len(splits_on_colon):+ if len(splits_on_colon) % 2 == 1 and re.search(r"`\w+`$", line.rstrip()):+ return line, ""+ return None, line+ return ":".join(splits_on_colon[:idx]), ":".join(splits_on_colon[idx:])+++def split_raise_line(line):+ """+ Split the raise line with format `SomeError some doc`.+ """+ splits_on_colon = line.strip().split(" ")+ error_type, doc = splits_on_colon[0], " ".join(splits_on_colon[1:])+ if error_type and error_type[-1] == ":":+ error_type = error_type[:-1]+ return error_type, doc+++def split_arg_line(line):+ """+ Split the return line with format `type: some doc`. Type may contain colons in the form of :obj: or :class:.+ """+ splits_on_colon = line.split(":")+ idx = 1+ while idx < len(splits_on_colon) and splits_on_colon[idx] in ["obj", "class"]:+ idx += 2+ if idx >= len(splits_on_colon):+ return line, ""+ return ":".join(splits_on_colon[:idx]), ":".join(splits_on_colon[idx:])+++class InvalidRstDocstringError(ValueError):+ pass+++_re_parameters = re.compile(r"<parameters>(((?!<parameters>).)*)</parameters>", re.DOTALL)+_re_md_link = re.compile(r"\[(.+)\]\(.+\)", re.DOTALL)+++def parse_rst_docstring(docstring):+ """+ Parses a docstring written in rst, in particular the list of arguments and the return type.+ """+ lines = docstring.split("\n")+ idx = 0+ while idx < len(lines):+ # Parameters section+ if _re_args.search(lines[idx]) is not None:+ # Title of the section.+ lines[idx] = "<parameters>\n"+ # Find the next nonempty line+ idx += 1+ while is_empty_line(lines[idx]):+ idx += 1+ # Grab the indent of the list of parameters, this block will stop when we unindent under it or we see the+ # Returns or Raises block.+ param_indent = find_indent(lines[idx])+ while (+ idx < len(lines) and find_indent(lines[idx]) == param_indent and _re_returns.search(lines[idx]) is None+ ):+ intro, doc = split_arg_line(lines[idx])+ # Line starting with a > after indent indicate a "section title" in the parameters.+ if intro.lstrip().startswith(">"):+ lines[idx] = intro.lstrip()+ else:+ lines[idx] = re.sub(r"^\s*(\S+)(\s)?", r"- **\1**\2", intro) + " --" + doc+ idx += 1+ while idx < len(lines) and (is_empty_line(lines[idx]) or find_indent(lines[idx]) > param_indent):+ idx += 1+ lines.insert(idx, "</parameters>\n")+ idx += 1++ # Returns section+ elif _re_returns.search(lines[idx]) is not None:+ # tag is either `return` or `yield`+ tag = _re_returns.match(lines[idx]).group(1).lower()+ # Title of the section.+ lines[idx] = f"<{tag}s>\n"+ # Find the next nonempty line+ idx += 1+ while is_empty_line(lines[idx]):+ idx += 1++ # Grab the indent of the return line, this block will stop when we unindent under it.+ return_indent = find_indent(lines[idx])+ raised_errors = []+ # The line may contain the return type.+ if tag in ["return", "yield"]:+ return_type, return_description = split_return_line(lines[idx])+ lines[idx] = return_description+ idx += 1+ while idx < len(lines) and (is_empty_line(lines[idx]) or find_indent(lines[idx]) >= return_indent):+ idx += 1+ else:+ while idx < len(lines) and find_indent(lines[idx]) == return_indent:+ return_type, return_description = split_raise_line(lines[idx])+ raised_error = re.sub(r"^\s*`?([\w\.]*)`?$", r"``\1``", return_type)+ lines[idx] = "- " + raised_error + " -- " + return_description+ md_link = _re_md_link.match(raised_error)+ if md_link:+ raised_error = md_link[1]+ raised_error = re.sub(r"^\s*`?([\w\.]*)`?$", r"``\1``", raised_error)+ if raised_error not in raised_errors:+ raised_errors.append(raised_error)+ idx += 1+ while idx < len(lines) and (is_empty_line(lines[idx]) or find_indent(lines[idx]) > return_indent):+ idx += 1++ lines.insert(idx, f"</{tag}s>\n")+ idx += 1++ # Return block finished, we insert the return type if one was specified+ if tag in ["return", "yield"] and return_type is not None:+ lines[idx - 1] += f"\n<{tag}type>{return_type}</{tag}type>\n"+ elif len(raised_errors) > 0:+ # raised errors+ lines[idx - 1] += f"\n<raisederrors>{' or '.join(raised_errors)}</raisederrors>\n"++ else:+ idx += 1++ result = "\n".join(lines)++ # combine multiple <parameters> blocks into one block+ if result.count("<parameters>") > 1:+ parameters_blocks = _re_parameters.findall(result)+ parameters_blocks = [pb[0].strip() for pb in parameters_blocks]+ parameters_str = "\n".join(parameters_blocks)+ result = _re_parameters.sub("", result)+ result += f"\n<parameters>{parameters_str}</parameters>\n"++ return result+++_re_list = re.compile(r"^\s*(-|\*|\d+\.)\s")+_re_autodoc = re.compile(r"^\s*\[\[autodoc\]\]\s+(\S+)\s*$")+++def remove_indent(text):+ """+ Remove indents in text, except the one linked to lists (or sublists).+ """+ lines = text.split("\n")+ # List of indents to remember for nested lists+ current_indents = []+ # List of new indents to remember for nested lists+ new_indents = []+ is_inside_code = False+ code_indent = 0+ for idx, line in enumerate(lines):+ # Line is an item in a list.+ if _re_list.search(line) is not None:+ indent = find_indent(line)+ # Is it a new list / new level of nestedness?+ if len(current_indents) == 0 or indent > current_indents[-1]:+ current_indents.append(indent)+ new_indent = 0 if len(new_indents) == 0 else new_indents[-1]+ lines[idx] = " " * new_indent + line[indent:]+ new_indent += len(_re_list.search(line).groups()[0]) + 1+ new_indents.append(new_indent)+ # Otherwise it's an existing level of list (current one, or previous one)+ else:+ # Let's find the proper level of indentation+ level = len(current_indents) - 1+ while level >= 0 and current_indents[level] != indent:+ level -= 1+ current_indents = current_indents[: level + 1]+ new_indents = new_indents[:level]+ new_indent = 0 if len(new_indents) == 0 else new_indents[-1]+ lines[idx] = " " * new_indent + line[indent:]+ new_indent += len(_re_list.search(line).groups()[0]) + 1+ new_indents.append(new_indent)++ # Line is an autodoc, we keep the indent for the list just after if there is one.+ elif _re_autodoc.search(line) is not None:+ indent = find_indent(line)+ current_indents = [indent]+ new_indents = [4]+ lines[idx] = line.strip()++ # Deal with empty lines separately+ elif is_empty_line(line):+ lines[idx] = ""++ # Code blocks+ elif line.lstrip().startswith("```"):+ is_inside_code = not is_inside_code+ if is_inside_code:+ code_indent = find_indent(line)+ lines[idx] = line[code_indent:]+ elif is_inside_code:+ lines[idx] = line[code_indent:]++ else:+ indent = find_indent(line)+ if len(current_indents) > 0 and indent > current_indents[-1]:+ lines[idx] = " " * new_indents[-1] + line[indent:]+ elif len(current_indents) > 0:+ # Let's find the proper level of indentation+ level = len(current_indents) - 1+ while level >= 0 and current_indents[level] > indent:+ level -= 1+ current_indents = current_indents[: level + 1]+ if level >= 0:+ if current_indents[level] < indent:+ new_indents = new_indents[: level + 1]+ else:+ new_indents = new_indents[:level]+ new_indent = 0 if len(new_indents) == 0 else new_indents[-1]+ lines[idx] = " " * new_indent + line[indent:]+ new_indents.append(new_indent)+ else:+ new_indents = []+ lines[idx] = line[indent:]+ else:+ lines[idx] = line[indent:]++ return "\n".join(lines)+++def base_rst_to_mdx(text, page_info, unindent=True):+ """+ Convert a text from rst to mdx, with the base operations necessary for both docstrings and rst docs.+ """+ text = convert_rst_links(text, page_info)+ text = convert_special_chars(text)+ text = convert_rst_blocks(text, page_info)+ # Convert * in lists to - to avoid the formatting conversion treat them as bold.+ text = re.sub(r"^(\s*)\*(\s)", r"\1-\2", text, flags=re.MULTILINE)+ text = convert_rst_formatting(text)+ return remove_indent(text) if unindent else text+++def convert_rst_docstring_to_mdx(docstring, page_info):+ """+ Convert a docstring written in rst to mdx.+ """+ text = parse_rst_docstring(docstring)+ return base_rst_to_mdx(text, page_info)+++def process_titles(lines):+ """Converts rst titles to markdown titles."""+ title_chars = """= - ` : ' " ~ ^ _ * + # < >""".split(" ")+ title_levels = {}+ new_lines = []+ for line in lines:+ if (+ len(new_lines) > 0+ and len(line) >= len(new_lines[-1])+ and len(set(line)) == 1+ and line[0] in title_chars+ and line != "::"+ ):+ char = line[0]+ level = title_levels.get(char, len(title_levels) + 1)+ if level not in title_levels:+ title_levels[char] = level+ new_lines[-1] = f"{'#' * level} {new_lines[-1]}"+ else:+ new_lines.append(line)+ return new_lines+++# Matches lines with a pattern of a table new line in rst.+_re_ignore_line_table = re.compile(r"^(\+[\-\s]+)+\+\s*$")+# Matches lines with a pattern of a table new line in rst, with a first column empty.+_re_ignore_line_table1 = re.compile(r"^\|\s+(\+[\-\s]+)+\+\s*$")+# Matches lines with a pattern of a first table line in rst.+_re_sep_line_table = re.compile(r"^(\+[=\s]+)+\+\s*$")+# Re pattern that catches anchors of the type .. reference:+_re_anchor_section = re.compile(r"^\.\.\s+_(\S+):")+++def split_pt_tf_code_blocks(text):+ """+ Split PyTorch and TensorFlow specific block codes.+ """+ lines = text.split("\n")+ new_lines = []+ idx = 0+ while idx < len(lines):+ if lines[idx].startswith("```"):+ code_lines = {"common": [lines[idx]], "pytorch": [], "tensorflow": []}+ is_pytorch = False+ is_tensorflow = False+ idx += 1+ while idx < len(lines) and lines[idx].strip() != "```":+ if "## PYTORCH CODE" in lines[idx]:+ is_pytorch = True+ is_tensorflow = False+ elif "## TENSORFLOW CODE" in lines[idx]:+ is_tensorflow = True+ is_pytorch = False+ elif is_pytorch:+ code_lines["pytorch"].append(lines[idx])+ elif is_tensorflow:+ code_lines["tensorflow"].append(lines[idx])+ else:+ code_lines["common"].append(lines[idx])+ idx += 1+ if len(code_lines["pytorch"]) > 0 or len(code_lines["tensorflow"]) > 0:+ block_lines = ["<frameworkcontent>", "<pt>"]+ block_lines.extend(code_lines["common"].copy() + code_lines["pytorch"])+ block_lines.extend(["```", "</pt>", "<tf>"])+ block_lines.extend(code_lines["common"].copy() + code_lines["tensorflow"])+ block_lines.extend(["```", "</tf>", "</frameworkcontent>"])+ new_lines.extend(block_lines)+ else:+ block_lines = code_lines["common"] + ["```"]+ new_lines.extend(block_lines)+ idx += 1+ else:+ new_lines.append(lines[idx])+ idx += 1+ return "\n".join(new_lines)+++def convert_rst_to_mdx(rst_text, page_info, add_imports=True):+ """+ Convert a document written in rst to mdx.+ """+ lines = rst_text.split("\n")+ lines = process_titles(lines)+ if add_imports:+ new_lines = [+ '<script lang="ts">',+ ' import Tip from "$lib/Tip.svelte";',+ ' import Youtube from "$lib/Youtube.svelte";',+ ' import Docstring from "$lib/Docstring.svelte";',+ ' import CodeBlock from "$lib/CodeBlock.svelte";',+ ' import CodeBlockFw from "$lib/CodeBlockFw.svelte";',+ ' import DocNotebookDropdown from "$lib/DocNotebookDropdown.svelte";',+ ' import CourseFloatingBanner from "$lib/CourseFloatingBanner.svelte";',+ ' import IconCopyLink from "$lib/IconCopyLink.svelte";',+ ' import FrameworkContent from "$lib/FrameworkContent.svelte";',+ ' import Markdown from "$lib/Markdown.svelte";',+ ' import ExampleCodeBlock from "$lib/ExampleCodeBlock.svelte";',+ ' import Added from "$lib/Added.svelte";',+ ' import Changed from "$lib/Changed.svelte";',+ ' import Deprecated from "$lib/Deprecated.svelte";',+ ' import PipelineIcon from "$lib/PipelineIcon.svelte";',+ ' import PipelineTag from "$lib/PipelineTag.svelte";',+ " ",+ ' export let fw: "pt" | "tf"',+ "</script>",+ "<svelte:head>",+ '<meta name="hf:doc:metadata" content={JSON.stringify(metadata)} >',+ "</svelte:head>",+ "",+ ]+ else:+ new_lines = []+ for line in lines:+ if _re_ignore_line_table.search(line) is not None:+ continue+ elif _re_ignore_line_table1.search(line) is not None:+ continue+ elif _re_sep_line_table.search(line) is not None:+ line = line.replace("=", "-").replace("+", "|")+ elif _re_anchor_section.search(line) is not None:+ anchor_name = _re_anchor_section.search(line).groups()[0]+ line = f"<a id='{anchor_name}'></a>"+ new_lines.append(line)+ text = "\n".join(new_lines)++ return split_pt_tf_code_blocks(base_rst_to_mdx(text, page_info))diff --git a/fern/generators/python-sdk/autodoc_core/external.py b/fern/generators/python-sdk/autodoc_core/external.pynew file mode 100644index 000000000..c533769f8--- /dev/null+++ b/fern/generators/python-sdk/autodoc_core/external.py@@ -0,0 +1,153 @@+# coding=utf-8+# Copyright 2022 The HuggingFace Team. All rights reserved.+#+# Licensed under the Apache License, Version 2.0 (the "License");+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+# http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.++import os+import re+import tempfile+import zlib++import git+import requests+++HF_DOC_PREFIX = "https://huggingface.co/docs/"+EXTERNAL_DOC_OBJECTS_CACHE = {}+HUGGINFACE_LIBS = [+ "accelerate",+ "datasets",+ "evaluate",+ "huggingface_hub",+ "optimum",+ "tokenizers",+ "transformers",+ "trl",+]+++def post_process_objects_inv(object_data, doc_url):+ """+ Post-processes the data in sphinx-like format to get a dictionary object_name: link in doc.++ Args:+ object_data (`str`): The data in the `objects.inv` object (except the first 4 lines).+ doc_url (`str`): The documentation url of the package.+ """+ links = {}+ for line in object_data:+ if len(line) == 0:+ continue+ name, typ, _, link = line.split(" ")[:4]+ if typ in ["py:class", "py:function", "py:method"]:+ link = link.replace("$", name)+ links[name] = f"{doc_url}/{link}"+ return links+++def get_stable_version(package_name, repo_owner="huggingface", repo_name=None):+ """+ Gets the version of the last release of a package.++ Args:+ package_name (`str`): The name of the package.+ repo_owner (`str`): The owner of the GitHub repo.+ repo_name (`str`, *optional*, defaults to `package_name`):+ The name of the GitHub repo. If not provided, will be the same as the package name.+ """+ repo_name = repo_name if repo_name is not None else package_name+ github_url = f"https://github.com/{repo_owner}/{repo_name}"+ try:+ # Get the version tags from the GitHub repo in decreasing order (that's what '-v:refname' means)+ result = git.cmd.Git().ls_remote(github_url, sort="-v:refname", tags=True)+ except git.GitCommandError:+ return "main"++ # One line per tag+ for line in result.split("\n"):+ # Lines returned are {sha}\trefs/tags/{tag}^{}, we grab the tag+ candidate = line.split("/")[-1].replace("^", "").replace("{}", "")+ # Some tags are not versions (looking at your VERSION and delete tags Datasets)+ if re.search(r"v?\d+\.\d+\.\d+", candidate):+ # Add the v is missing (looking at you Datasets :-p)+ return candidate if candidate.startswith("v") else f"v{candidate}"++ return "main"+++def get_objects_map(package_name, version="main", language="en", repo_owner="huggingface", repo_name=None):+ """+ Downloads the `objects.inv` for a package and post-processes it to get a nice dictionary.++ Args:+ package_name (`str`): The name of the external package.+ version (`str`, *optional*, defaults to `"main"`): The version of the package for which documentation is built.+ language (`str`, *optional*, defaults to `"en"`): The language of the documentation being built.+ repo_owner (`str`, *optional*, defaults to `"huggingface"`): The owner of the GitHub repo.+ repo_name (`str`, *optional*, defaults to `package_name`):+ The name of the GitHub repo. If not provided, it will be the same as the package name.+ """+ repo_name = repo_name if repo_name is not None else package_name+ # We link to main in `package_name` from the main doc (or PR docs) but to the last stable release otherwise.+ if version in ["main", "master"] or version.startswith("pr_"):+ package_version = "main"+ else:+ package_version = get_stable_version(package_name, repo_owner, repo_name)++ doc_url = f"{HF_DOC_PREFIX}{package_name}/{package_version}/{language}"+ url = f"{doc_url}/objects.inv"+ try:+ request = requests.get(url, stream=True)+ request.raise_for_status()+ with tempfile.TemporaryDirectory() as tmp_dir:+ tmp_file = os.path.join(tmp_dir, "objects.inv")+ with open(tmp_file, "ab") as writer:+ for chunk in request.iter_content(chunk_size=1024):+ if chunk: # filter out keep-alive new chunks+ writer.write(chunk)++ with open(tmp_file, "rb") as reader:+ object_lines = reader.readlines()[4:]+ object_data = zlib.decompress(b"".join(object_lines)).decode().split("\n")+ return post_process_objects_inv(object_data, doc_url)+ except Exception:+ return {}+++def get_external_object_link(object_name, page_info):+ if object_name.startswith("~"):+ object_name = object_name[1:]+ link_name = object_name.split(".")[-1]+ else:+ link_name = object_name++ version = page_info.get("version", "main")+ language = page_info.get("language", "en")+ if language != "en":+ # No resolving for other languages then English as we don't translate API doc pages/docstrings for now.+ return f"`{link_name}`"++ package_name = object_name.split(".")[0]+ if package_name not in HUGGINFACE_LIBS:+ # No resolving for non-HF libs for now.+ return f"`{link_name}`"++ if package_name not in EXTERNAL_DOC_OBJECTS_CACHE:+ EXTERNAL_DOC_OBJECTS_CACHE[package_name] = get_objects_map(package_name, version=version, language=language)+ object_url = EXTERNAL_DOC_OBJECTS_CACHE[package_name].get(object_name, None)++ if object_url is None:+ # Object not found in the lib+ return f"`{link_name}`"+ else:+ return f"[{link_name}]({object_url})"diff --git a/fern/generators/python-sdk/generate_docs.py b/fern/generators/python-sdk/generate_docs.pynew file mode 100644index 000000000..675270a1a--- /dev/null+++ b/fern/generators/python-sdk/generate_docs.py@@ -0,0 +1,48 @@+#!/usr/bin/env python+"""+Generate SDK documentation for Composio Python SDK.++Usage:+ uv run python generators/python-sdk/generate_docs.py+"""+import sys+from pathlib import Path++# Add current directory to path+sys.path.insert(0, str(Path(__file__).parent))++from process_sdk_docs import build_sdk_docs+++def main():+ """Generate SDK documentation."""+ fern_dir = Path(__file__).parent.parent.parent+ source_dir = fern_dir / "generators" / "python-sdk" / "templates"+ output_dir = fern_dir / "docs" / "sdk" / "python"++ print("Generating Composio Python SDK documentation...")+ print(f"Source: {source_dir}")+ print(f"Output: {output_dir}")++ try:+ anchors = build_sdk_docs(+ source_dir=source_dir,+ output_dir=output_dir,+ package_name="composio",+ version="main",+ repo_owner="composio",+ clean=False # Don't clean to preserve other files+ )++ print(f"\n✓ Successfully generated documentation with {len(anchors)} anchors")+ print(f"✓ Output written to: {output_dir}")++ except Exception as e:+ print(f"\n✗ Error generating documentation: {e}")+ import traceback+ traceback.print_exc()+ sys.exit(1)+++if __name__ == "__main__":+ main()\ No newline at end of filediff --git a/fern/generators/python-sdk/markdown_formatter.py b/fern/generators/python-sdk/markdown_formatter.pynew file mode 100644index 000000000..667a42b5e--- /dev/null+++ b/fern/generators/python-sdk/markdown_formatter.py@@ -0,0 +1,286 @@+"""+Custom markdown formatter for autodoc output+"""+import json+import re+from typing import List, Dict, Optional, Tuple++def format_signature_markdown(name: str, anchor: str, signature: List[Dict[str, str]],+ object_doc: str, source_link: Optional[str] = None,+ is_getset_desc: bool = False) -> str:+ """+ Generate markdown documentation instead of XML/Svelte components.++ This replaces get_signature_component() to output clean Markdown.+ """+ output = []++ # Extract structured data from the docstring+ doc_data = parse_structured_docstring(object_doc)++ # Add the main heading with an invisible anchor+ # Determine heading level based on whether it's a class or method+ if name.startswith('class '):+ class_name = name.replace('class ', '')+ heading = f'<a id="{anchor}"></a>\n\n### `{class_name}`\n'+ elif '.' in anchor and not name.startswith('class'):+ # This is a method - use h4+ heading = f'<a id="{anchor}"></a>\n\n#### `{name}`\n'+ else:+ heading = f'<a id="{anchor}"></a>\n\n### `{name}`\n'+ output.append(heading)++ # Add source link if available+ if source_link:+ output.append(f"[View source]({source_link})\n")++ # Add signature+ if signature and not is_getset_desc:+ params = []+ for param in signature:+ param_str = param["name"] + param["val"]+ params.append(param_str)++ # Format signature in a code block+ if name.startswith("class "):+ class_name = name.replace("class ", "")+ output.append(f"```python\n{class_name}({', '.join(params)})\n```\n")+ else:+ output.append(f"```python\n{name}({', '.join(params)})\n```\n")++ # Add the main description+ if doc_data['description']:+ output.append(doc_data['description'] + "\n")++ # Add parameters section+ if doc_data['parameters']:+ # Format parameters as a table+ table = format_parameters_table(doc_data['parameters'])+ output.append(table + "\n")++ # Add returns section+ if doc_data['returns']:+ # Parse the return description+ return_desc = parse_return_line(doc_data['returns'])+ if not return_desc:+ # If not in :return: format, use the raw text+ return_desc = doc_data['returns']++ # Format the return value+ if doc_data['return_type']:+ output.append(f"**Returns:** `{doc_data['return_type']}` — {return_desc}\n")+ else:+ output.append(f"**Returns:** {return_desc}\n")++ # Add raises section+ if doc_data['raises']:+ output.append("**Raises:**\n")+ output.append(doc_data['raises'] + "\n")++ # Add examples+ if doc_data['examples']:+ for example in doc_data['examples']:+ output.append(example + "\n")++ return "\n".join(output)+++def parse_param_line(line: str) -> Tuple[Optional[str], Optional[str]]:+ """+ Parse a parameter line like ":param name: description" into (name, description).+ """+ match = re.match(r':param\s+(\w+):\s*(.+)', line.strip())+ if match:+ return match.group(1), match.group(2)+ return None, None+++def parse_return_line(line: str) -> Optional[str]:+ """+ Parse a return line like ":return: description" into description.+ """+ match = re.match(r':return:\s*(.+)', line.strip())+ if match:+ return match.group(1)+ return None+++def format_parameters_table(params_text: str) -> str:+ """+ Convert parameter text into a markdown table.+ """+ lines = params_text.strip().split('\n')+ params = []++ for line in lines:+ name, desc = parse_param_line(line)+ if name and desc:+ params.append((name, desc))++ if not params:+ return params_text # Return original if no params found++ # Build markdown table+ table = ["| Parameter | Description |", "| --- | --- |"]+ for name, desc in params:+ # Clean up the description - remove trailing period if present+ desc = desc.rstrip('.')+ table.append(f"| `{name}` | {desc} |")++ return "\n".join(table)+++def parse_structured_docstring(docstring: str) -> Dict[str, any]:+ """+ Parse the structured docstring that contains XML tags and extract the data.+ Also handles RST-style parameter documentation.+ """+ data = {+ 'description': '',+ 'parameters': None,+ 'returns': None,+ 'return_type': None,+ 'raises': None,+ 'examples': []+ }++ # First, check for XML-wrapped sections+ # Parameters+ params_match = re.search(r'<parameters>(.*?)</parameters>', docstring, re.DOTALL)+ if params_match:+ data['parameters'] = params_match.group(1).strip()+ docstring = docstring.replace(params_match.group(0), '')++ # Returns+ returns_match = re.search(r'<returns>(.*?)</returns>', docstring, re.DOTALL)+ if returns_match:+ data['returns'] = returns_match.group(1).strip()+ docstring = docstring.replace(returns_match.group(0), '')++ # Return type+ rettype_match = re.search(r'<returntype>(.*?)</returntype>', docstring, re.DOTALL)+ if rettype_match:+ data['return_type'] = rettype_match.group(1).strip()+ docstring = docstring.replace(rettype_match.group(0), '')++ # Raises+ raises_match = re.search(r'<raises>(.*?)</raises>', docstring, re.DOTALL)+ if raises_match:+ data['raises'] = raises_match.group(1).strip()+ docstring = docstring.replace(raises_match.group(0), '')++ # Examples+ example_matches = re.findall(r'<ExampleCodeBlock[^>]*>(.*?)</ExampleCodeBlock>', docstring, re.DOTALL)+ for match in example_matches:+ data['examples'].append(match.strip())+ docstring = docstring.replace(match, '')++ # If no XML parameters found, look for RST-style parameters+ if not data['parameters']:+ lines = docstring.split('\n')+ param_lines = []+ return_lines = []+ description_lines = []+ in_params = False+ in_return = False++ for line in lines:+ if line.strip().startswith(':param '):+ in_params = True+ in_return = False+ param_lines.append(line)+ elif line.strip().startswith(':return:'):+ in_params = False+ in_return = True+ return_lines.append(line)+ elif line.strip().startswith(':raises:') or line.strip().startswith(':rtype:'):+ in_params = False+ in_return = False+ # Handle other RST fields if needed+ elif in_params and line.strip():+ param_lines.append(line)+ elif in_return and line.strip():+ return_lines.append(line)+ elif not in_params and not in_return and not line.strip().startswith(':'):+ description_lines.append(line)++ if param_lines:+ data['parameters'] = '\n'.join(param_lines)+ if return_lines:+ data['returns'] = '\n'.join(return_lines)++ # Clean up description+ data['description'] = '\n'.join(description_lines).strip()+ else:+ # The remaining docstring is the description+ data['description'] = docstring.strip()++ return data+++def create_custom_autodoc(original_autodoc):+ """+ Wrapper that modifies autodoc to use markdown formatting.+ """+ def markdown_autodoc(object_name, package, methods=None, return_anchors=False,+ page_info=None, version_tag_suffix="src/"):+ # Get the original result+ result = original_autodoc(object_name, package, methods=methods,+ return_anchors=return_anchors, page_info=page_info,+ version_tag_suffix=version_tag_suffix)++ if return_anchors:+ doc, anchors, errors = result+ # Convert the XML documentation to markdown+ doc = convert_xml_to_markdown(doc)+ return doc, anchors, errors+ else:+ # Convert the XML documentation to markdown+ return convert_xml_to_markdown(result)++ return markdown_autodoc+++def convert_xml_to_markdown(xml_doc: str) -> str:+ """+ Convert the XML/Svelte component output to clean Markdown.+ """+ output_parts = []++ # Remove all wrapping divs+ xml_doc = re.sub(r'<div class="[^"]*">\s*', '', xml_doc, flags=re.DOTALL)+ xml_doc = re.sub(r'</div>\s*', '', xml_doc, flags=re.DOTALL)++ # Find all docstring components (main class + methods)+ docstring_pattern = r'<docstring>(.*?)</docstring>(.*?)(?=<docstring>|$)'+ matches = re.findall(docstring_pattern, xml_doc, re.DOTALL)++ if not matches:+ # No docstring components found, return as-is+ return xml_doc++ for docstring_content, remaining_doc in matches:+ # Parse each docstring component+ name_match = re.search(r'<name>(.*?)</name>', docstring_content)+ anchor_match = re.search(r'<anchor>(.*?)</anchor>', docstring_content)+ source_match = re.search(r'<source>(.*?)</source>', docstring_content)+ params_match = re.search(r'<parameters>(.*?)</parameters>', docstring_content)++ name = name_match.group(1) if name_match else ""+ anchor = anchor_match.group(1) if anchor_match else ""+ source = source_match.group(1) if source_match else None++ # Parse parameters+ signature = []+ if params_match:+ try:+ signature = json.loads(params_match.group(1))+ except:+ pass++ # Format this component+ formatted = format_signature_markdown(name, anchor, signature, remaining_doc.strip(), source)+ output_parts.append(formatted)++ # Join all parts with appropriate spacing+ return "\n\n".join(output_parts)\ No newline at end of filediff --git a/fern/generators/python-sdk/process_sdk_docs.py b/fern/generators/python-sdk/process_sdk_docs.pynew file mode 100644index 000000000..00c3d301b--- /dev/null+++ b/fern/generators/python-sdk/process_sdk_docs.py@@ -0,0 +1,208 @@+#!/usr/bin/env python+"""+Process SDK documentation files with autodoc markers.++This is a simplified version that doesn't require toctree validation.+"""+import os+import re+import importlib+import logging+from pathlib import Path+from typing import Dict, Optional, Tuple+from tqdm import tqdm++from autodoc_core.autodoc import autodoc, resolve_links_in_text+from markdown_formatter import convert_xml_to_markdown++# Pattern to find [[autodoc]] markers+_re_autodoc = re.compile(r"^\s*\[\[autodoc\]\]\s+(\S+)\s*$")++# Setup logging+logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')+logger = logging.getLogger(__name__)+++def process_autodoc_file(+ file_path: Path,+ package,+ page_info: Dict[str, str],+ version_tag_suffix: str = "src/"+) -> Tuple[str, Dict[str, str]]:+ """+ Process a single file containing autodoc markers.++ Args:+ file_path: Path to the markdown file+ package: The Python package to document+ page_info: Information about the documentation page+ version_tag_suffix: Suffix for version tags in links++ Returns:+ Tuple of (processed content, anchor mapping)+ """+ with open(file_path, 'r', encoding='utf-8') as f:+ lines = f.read().split('\n')++ new_lines = []+ idx = 0+ anchors = {}++ while idx < len(lines):+ if _re_autodoc.search(lines[idx]) is not None:+ object_name = _re_autodoc.search(lines[idx]).groups()[0]+ logger.info(f"Processing autodoc: {object_name}")++ try:+ result = autodoc(+ object_name,+ package,+ return_anchors=True,+ page_info=page_info,+ version_tag_suffix=version_tag_suffix+ )++ doc, new_anchors, errors = result+ doc = convert_xml_to_markdown(doc)++ # Collect anchors+ page_name = file_path.stem+ for anchor in new_anchors:+ if isinstance(anchor, tuple):+ for a in anchor:+ anchors[a] = page_name+ else:+ anchors[anchor] = page_name++ if errors:+ logger.warning(f"Autodoc warnings for {object_name}: {errors}")++ new_lines.append(doc.strip())++ except Exception as e:+ logger.error(f"Error processing {object_name}: {e}")+ new_lines.append(lines[idx])+ else:+ new_lines.append(lines[idx])++ idx += 1++ content = '\n'.join(new_lines)+ return content, anchors+++def build_sdk_docs(+ source_dir: Path,+ output_dir: Path,+ package_name: str,+ version: str = "main",+ repo_owner: str = "composio",+ repo_name: Optional[str] = None,+ clean: bool = False+):+ """+ Build SDK documentation from markdown files with autodoc markers.++ Args:+ source_dir: Directory containing source markdown files+ output_dir: Directory where processed files will be written+ package_name: Name of the Python package to document+ version: Version of the documentation+ repo_owner: Owner of the GitHub repository+ repo_name: Name of the GitHub repository (defaults to package_name)+ clean: Whether to clean the output directory before building+ """+ source_dir = Path(source_dir)+ output_dir = Path(output_dir)++ if not source_dir.exists():+ raise ValueError(f"Source directory {source_dir} does not exist")++ # Clean output directory if requested+ if clean and output_dir.exists():+ import shutil+ shutil.rmtree(output_dir)++ output_dir.mkdir(parents=True, exist_ok=True)++ # Import the package+ try:+ package = importlib.import_module(package_name)+ except ImportError as e:+ raise ImportError(f"Failed to import package {package_name}: {e}")++ # Page info for documentation+ page_info = {+ "version": version,+ "version_tag": version,+ "language": "en",+ "package_name": package_name,+ "repo_owner": repo_owner,+ "repo_name": repo_name or package_name,+ }++ # Phase 1: Process all files and collect anchors+ logger.info("Phase 1: Processing autodoc markers and collecting anchors")+ all_anchors = {}+ file_contents = {}++ markdown_files = list(source_dir.glob("**/*.md")) + list(source_dir.glob("**/*.mdx"))++ for file_path in tqdm(markdown_files, desc="Processing files"):+ if file_path.is_file():+ logger.info(f"Processing: {file_path}")+ content, anchors = process_autodoc_file(file_path, package, page_info)++ # Store content and anchors+ relative_path = file_path.relative_to(source_dir)+ file_contents[relative_path] = content+ all_anchors.update(anchors)++ logger.info(f"Collected {len(all_anchors)} anchors")++ # Phase 2: Resolve cross-references+ logger.info("Phase 2: Resolving cross-references")++ for relative_path, content in tqdm(file_contents.items(), desc="Resolving links"):+ # Resolve cross-references+ resolved_content = resolve_links_in_text(content, package, all_anchors, page_info)++ # Write output file+ output_path = output_dir / relative_path+ output_path.parent.mkdir(parents=True, exist_ok=True)++ with open(output_path, 'w', encoding='utf-8') as f:+ f.write(resolved_content)++ logger.info(f"Documentation built successfully in {output_dir}")+ return all_anchors+++def main():+ """CLI entry point for SDK documentation builder."""+ import argparse++ parser = argparse.ArgumentParser(description="Build SDK documentation with autodoc markers")+ parser.add_argument("source", help="Source directory containing markdown files")+ parser.add_argument("output", help="Output directory for processed files")+ parser.add_argument("--package", required=True, help="Python package name to document")+ parser.add_argument("--version", default="main", help="Documentation version")+ parser.add_argument("--repo-owner", default="composio", help="GitHub repository owner")+ parser.add_argument("--repo-name", help="GitHub repository name (defaults to package name)")+ parser.add_argument("--no-clean", action="store_true", help="Don't clean output directory")++ args = parser.parse_args()++ build_sdk_docs(+ source_dir=Path(args.source),+ output_dir=Path(args.output),+ package_name=args.package,+ version=args.version,+ repo_owner=args.repo_owner,+ repo_name=args.repo_name,+ clean=not args.no_clean+ )+++if __name__ == "__main__":+ main()\ No newline at end of filediff --git a/fern/generators/python-sdk/templates/index.mdx b/fern/generators/python-sdk/templates/index.mdxnew file mode 100644index 000000000..e69de29bbdiff --git a/fern/generators/python-sdk/templates/sdk-reference.md b/fern/generators/python-sdk/templates/sdk-reference.mdnew file mode 100644index 000000000..f0564260d--- /dev/null+++ b/fern/generators/python-sdk/templates/sdk-reference.md@@ -0,0 +1,55 @@+# Composio Python SDK Reference++This is the comprehensive SDK reference for the Composio Python SDK.++## Main SDK Class++The main entry point for the Composio SDK.++[[autodoc]] composio.Composio++## Core Models++### Tools++[[autodoc]] composio.core.models.Tools++### Toolkits++[[autodoc]] composio.core.models.Toolkits++### Connected Accounts++[[autodoc]] composio.core.models.ConnectedAccounts++### Auth Configs++[[autodoc]] composio.core.models.AuthConfigs++### Triggers++[[autodoc]] composio.core.models.Triggers++## Decorators++### before_execute++[[autodoc]] composio.before_execute++### after_execute++[[autodoc]] composio.after_execute++### schema_modifier++[[autodoc]] composio.schema_modifier++## Cross References++The [`Composio`] class is the main entry point for all SDK operations. It provides access to:+- [`Tools`] for tool management and execution+- [`Toolkits`] for toolkit operations+- [`ConnectedAccounts`] for managing authentication+- [`Triggers`] for webhook and event handling++When you call [`Tools.execute`], it can use the [`before_execute`] and [`after_execute`] decorators to modify behavior.\ No newline at end of filediff --git a/fern/generators/python-sdk/test_generator.py b/fern/generators/python-sdk/test_generator.pynew file mode 100644index 000000000..f5f67104e--- /dev/null+++ b/fern/generators/python-sdk/test_generator.py@@ -0,0 +1,83 @@+#!/usr/bin/env python+"""+Test the SDK documentation generator+"""+import sys+from pathlib import Path+import tempfile+import shutil++# Add current directory to path+sys.path.insert(0, str(Path(__file__).parent))++from process_sdk_docs import build_sdk_docs+++def test_generator():+ """Test the documentation generator with a simple example."""++ # Use the actual fern directory structure+ fern_dir = Path(__file__).parent.parent.parent+ source_dir = fern_dir / "generators" / "python-sdk" / "templates"+ output_dir = fern_dir / "docs" / "sdk" / "python"++ # Create source directory if it doesn't exist+ source_dir.mkdir(parents=True, exist_ok=True)++ # Create a test markdown file+ test_file = source_dir / "sdk-reference.md"+ if not test_file.exists():+ test_file.write_text("""# Composio SDK Reference++## Main Class++[[autodoc]] composio.Composio++## Tools++[[autodoc]] composio.core.models.Tools++## Cross References++The [`Composio`] class is the main entry point.+""")++ print(f"Created test file: {test_file}")+ print("Running documentation generator...")++ try:+ # Run the generator+ anchors = build_sdk_docs(+ source_dir=source_dir,+ output_dir=output_dir,+ package_name="composio",+ version="test",+ repo_owner="composio"+ )++ print(f"\nGenerated {len(anchors)} anchors")+ print("\nOutput files:")+ for file in output_dir.rglob("*"):+ if file.is_file():+ print(f" - {file.relative_to(output_dir)}")+ print(f" Size: {file.stat().st_size} bytes")++ # Read and display the output+ output_file = output_dir / "sdk-reference.md"+ if output_file.exists():+ print("\nGenerated content preview:")+ print("-" * 50)+ content = output_file.read_text()+ print(content[:500] + "..." if len(content) > 500 else content)+ print("-" * 50)++ print("\nTest completed successfully!")++ except Exception as e:+ print(f"\nError during test: {e}")+ import traceback+ traceback.print_exc()+++if __name__ == "__main__":+ test_generator()\ No newline at end of filediff --git a/fern/package.json b/fern/package.jsonindex bd6d6e494..2ec17e522 100644--- a/fern/package.json+++ b/fern/package.json@@ -11,7 +11,9 @@"tools:generate": "uv run generators/tool_doc_generator/main.py --workers 10","tools:comment": "uv run python scripts/manage-tool-docs.py comment","tools:uncomment": "uv run python scripts/manage-tool-docs.py uncomment",- "sdkdocs": "pnpm exec typedoc",+ "sdkdocs": "pnpm run sdkdocs:ts && pnpm run sdkdocs:python",+ "sdkdocs:ts": "pnpm exec typedoc",+ "sdkdocs:python": "uv run python generators/python-sdk/generate_docs.py","api:pull": "bash scripts/pull-openapi-spec.sh","snippets:build": "bun run scripts/build-snippets.ts","snippets:dev": "bun run scripts/build-snippets.ts --watch",diff --git a/fern/pyproject.toml b/fern/pyproject.tomlindex 3a82a5b64..7a067df30 100644--- a/fern/pyproject.toml+++ b/fern/pyproject.toml@@ -12,8 +12,14 @@ dependencies = ["typing-extensions>=4.13.0","composio-client==0.1.0a11","openai>=1.79.0",- "composio-anthropic",- "composio",+ "composio==1.0.0rc1",+ # Dependencies for SDK doc generation+ "tqdm>=4.62.0",+ "pyyaml>=6.0",+ "GitPython>=3.1.0",+ "packaging>=20.0",+ "nbformat>=5.0.0",+ "composio-langchain==1.0.0rc2",][tool.ruff]@@ -24,17 +30,12 @@ target-version = "py312"line-length = 100target-version = ["py312"]-[tool.uv.sources]-composio-langchain = { git = "ssh://[email protected]/composiohq/py-sdk-v3", subdirectory = "providers/langchain" }-composio-anthropic = { git = "ssh://[email protected]/composiohq/py-sdk-v3", subdirectory = "providers/anthropic" }-composio = { git = "ssh://[email protected]/composiohq/py-sdk-v3" }[tool.uv.workspace]members = ["snippets/migration"]+[tool.setuptools.packages.find]+include = ["generators*"]+[dependency-groups]-dev = [- "composio",- "composio-langchain",- "langchain>=0.3.25",-]+dev = ["composio", "composio-langchain", "langchain>=0.3.25"]diff --git a/fern/scripts/build-snippets.ts b/fern/scripts/build-snippets.tsindex e84025dc8..5e64d488f 100644--- a/fern/scripts/build-snippets.ts+++ b/fern/scripts/build-snippets.ts@@ -24,7 +24,7 @@ function ensureDistDir() {fs.rmSync(PAGES_DIR, { recursive: true, force: true });console.log('🧹 Cleaned existing pages directory');}-+// Create fresh pages directoryfs.mkdirSync(PAGES_DIR, { recursive: true });}@@ -174,8 +174,12 @@ function processFile(srcPath: string, distPath: string) {}}+function isMarkdownFile(filename: string): boolean {+ return filename.endsWith('.mdx') || filename.endsWith('.md');+}+function processAllFiles() {- console.log('🔄 Processing all .mdx files...');+ console.log('🔄 Processing all .mdx and .md files...');function processDirectory(srcDir: string) {const entries = fs.readdirSync(srcDir, { withFileTypes: true });@@ -187,18 +191,18 @@ function processAllFiles() {// Skip dist directory to avoid infinite loopsif (entry.name === 'dist') continue;processDirectory(srcPath);- } else if (entry.isFile() && entry.name.endsWith('.mdx')) {+ } else if (entry.isFile() && isMarkdownFile(entry.name)) {// Calculate the relative path from the source directoryconst relativePath = path.relative(DOCS_SRC_DIR, srcPath);-+// Check if this file is in the SDK directoryconst isInSDK = relativePath.startsWith('sdk/') || relativePath.startsWith('sdk\\');-+// If in SDK, preserve directory structure; otherwise flatten- const distPath = isInSDK+ const distPath = isInSDK? path.join(PAGES_DIR, relativePath): path.join(PAGES_DIR, entry.name);-+processFile(srcPath, distPath);}}@@ -214,15 +218,15 @@ function startWatchMode() {const watcher = watch(DOCS_SRC_DIR, { recursive: true }, (eventType, filename) => {if (!filename) return;- if (!filename.endsWith('.mdx')) return;+ if (!isMarkdownFile(filename)) return;const srcPath = path.join(DOCS_SRC_DIR, filename);-+// Check if this file is in the SDK directoryconst isInSDK = filename.startsWith('sdk/') || filename.startsWith('sdk\\');-+// If in SDK, preserve directory structure; otherwise flatten- const distPath = isInSDK+ const distPath = isInSDK? path.join(PAGES_DIR, filename): path.join(PAGES_DIR, path.basename(filename));@@ -240,12 +244,12 @@ function startWatchMode() {if (filename.includes('fern/pages')) return; // Skip pages (output) filesif (filename.includes('fern/scripts')) return; // Skip the script itself- // If a source file changes, reprocess all .mdx files since we don't know which ones reference it+ // If a source file changes, reprocess all .mdx and .md files since we don't know which ones reference itif (eventType === 'change' &&(filename.endsWith('.ts') || filename.endsWith('.js') || filename.endsWith('.py'))) {- console.log(`🔄 Source file changed: ${filename}, reprocessing all .mdx files...`);+ console.log(`🔄 Source file changed: ${filename}, reprocessing all .mdx and .md files...`);processAllFiles();}});diff --git a/fern/turbo.json b/fern/turbo.jsonindex 0a2eb0a66..2896baef3 100644--- a/fern/turbo.json+++ b/fern/turbo.json@@ -9,7 +9,7 @@},"dev": {- "dependsOn": ["api:pull", "sdkdocs","tools:comment", "snippets:build"],+ "dependsOn": ["api:pull", "sdkdocs", "tools:comment", "snippets:build"],"persistent": true,"cache": false},@@ -58,12 +58,25 @@},"sdkdocs": {- "dependsOn": ["^build"],+ "dependsOn": ["^build", "sdkdocs:ts", "sdkdocs:python"],"outputs": ["docs/sdk/**"],+ "cache": true+ },++ "sdkdocs:ts": {+ "dependsOn": ["^build"],+ "outputs": ["docs/sdk/typescript/**"],"inputs": ["../ts/packages/core/**/*.ts", "../ts/packages/providers/**/*.ts", "typedoc.json"],"cache": true},+ "sdkdocs:python": {+ "dependsOn": ["^build"],+ "outputs": ["docs/sdk/python/**"],+ "inputs": ["generators/python-sdk/templates/**/*.md", "generators/python-sdk/**/*.py"],+ "cache": true+ },+"check": {"dependsOn": ["tools:comment", "snippets:build"],"cache": falsediff --git a/fern/uv.lock b/fern/uv.lockindex 81d9071a8..8e027432d 100644--- a/fern/uv.lock+++ b/fern/uv.lock@@ -20,24 +20,6 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643 },]-[[package]]-name = "anthropic"-version = "0.54.0"-source = { registry = "https://pypi.org/simple" }-dependencies = [- { name = "anyio" },- { name = "distro" },- { name = "httpx" },- { name = "jiter" },- { name = "pydantic" },- { name = "sniffio" },- { name = "typing-extensions" },-]-sdist = { url = "https://files.pythonhosted.org/packages/89/28/80cb9bb6e7ce77d404145b51da4257455805c17f0a6be528ff3286e3882f/anthropic-0.54.0.tar.gz", hash = "sha256:5e6f997d97ce8e70eac603c3ec2e7f23addeff953fbbb76b19430562bb6ba815", size = 312376 }-wheels = [- { url = "https://files.pythonhosted.org/packages/de/b9/6ffb48e82c5e97b03cecee872d134a6b6666c2767b2d32ed709f3a60a8fe/anthropic-0.54.0-py3-none-any.whl", hash = "sha256:c1062a0a905daeec17ca9c06c401e4b3f24cb0495841d29d752568a1d4018d56", size = 288774 },-]-[[package]]name = "anyio"version = "4.9.0"@@ -52,6 +34,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/a1/ee/48ca1a7c89ffec8b6a0c5d02b89c305671d5ffd8d3c94acf8b8c408575bb/anyio-4.9.0-py3-none-any.whl", hash = "sha256:9f76d541cad6e36af7beb62e978876f3b41e3e04f2c1fbf0884604c0a9c4d93c", size = 100916 },]+[[package]]+name = "attrs"+version = "25.3.0"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/5a/b0/1367933a8532ee6ff8d63537de4f1177af4bff9f3e829baf7331f595bb24/attrs-25.3.0.tar.gz", hash = "sha256:75d7cefc7fb576747b2c81b4442d4d4a1ce0900973527c011d1030fd3bf4af1b", size = 812032 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/77/06/bb80f5f86020c4551da315d78b3ab75e8228f89f0162f2c3a819e407941a/attrs-25.3.0-py3-none-any.whl", hash = "sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3", size = 63815 },+]+[[package]]name = "certifi"version = "2025.4.26"@@ -162,14 +153,6 @@ dependencies = [{ name = "typing-extensions" },]-[[package]]-name = "composio-anthropic"-version = "1.0.0rc1"-source = { git = "ssh://[email protected]/composiohq/py-sdk-v3?subdirectory=providers%2Fanthropic#f9914d35690455bb9901e8fed5c07657ef3385f5" }-dependencies = [- { name = "anthropic" },-]-[[package]]name = "composio-client"version = "0.1.0a11"@@ -189,11 +172,15 @@ wheels = [[[package]]name = "composio-langchain"-version = "1.0.0rc1"-source = { git = "ssh://[email protected]/composiohq/py-sdk-v3?subdirectory=providers%2Flangchain#f9914d35690455bb9901e8fed5c07657ef3385f5" }+version = "1.0.0rc2"+source = { registry = "https://pypi.org/simple" }dependencies = [{ name = "langchain" },]+sdist = { url = "https://files.pythonhosted.org/packages/06/53/cbaf8ff590ac45400a6419a8594f354276f528c60025dd567163803cf618/composio_langchain-1.0.0rc2.tar.gz", hash = "sha256:b5bbf8ada343e7e0d055a4a99676ee593ca3d4b659115770c675dd191bd294bf", size = 2402 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/e5/66/c474ca5dd71ac8cf9aa10479686cf9f6c974d41148b303a56ee963d374e7/composio_langchain-1.0.0rc2-py3-none-any.whl", hash = "sha256:e6cdc66bc5dec3f74dea0cf3111d0cbf7338265455b093154186b8c2c47bde16", size = 2762 },+][[package]]name = "distro"@@ -204,6 +191,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/12/b3/231ffd4ab1fc9d679809f356cebee130ac7daa00d6d6f3206dd4fd137e9e/distro-1.9.0-py3-none-any.whl", hash = "sha256:7bffd925d65168f85027d8da9af6bddab658135b840670a223589bc0c8ef02b2", size = 20277 },]+[[package]]+name = "fastjsonschema"+version = "2.21.1"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/8b/50/4b769ce1ac4071a1ef6d86b1a3fb56cdc3a37615e8c5519e1af96cdac366/fastjsonschema-2.21.1.tar.gz", hash = "sha256:794d4f0a58f848961ba16af7b9c85a3e88cd360df008c59aac6fc5ae9323b5d4", size = 373939 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/90/2b/0817a2b257fe88725c25589d89aec060581aabf668707a8d03b2e9e0cb2a/fastjsonschema-2.21.1-py3-none-any.whl", hash = "sha256:c9e5b7e908310918cf494a434eeb31384dd84a98b57a30bcb1f535015b554667", size = 23924 },+]+[[package]]name = "fern"version = "0.1.0"@@ -211,12 +207,17 @@ source = { virtual = "." }dependencies = [{ name = "click" },{ name = "composio" },- { name = "composio-anthropic" },{ name = "composio-client" },+ { name = "composio-langchain" },+ { name = "gitpython" },{ name = "inflection" },+ { name = "nbformat" },{ name = "openai" },+ { name = "packaging" },{ name = "python-dotenv" },+ { name = "pyyaml" },{ name = "ruamel-yaml" },+ { name = "tqdm" },{ name = "typing-extensions" },]@@ -230,23 +231,52 @@ dev = [[package.metadata]requires-dist = [{ name = "click", specifier = ">=8.1.7" },- { name = "composio", git = "ssh://[email protected]/composiohq/py-sdk-v3" },- { name = "composio-anthropic", git = "ssh://[email protected]/composiohq/py-sdk-v3?subdirectory=providers%2Fanthropic" },+ { name = "composio", specifier = "==1.0.0rc1" },{ name = "composio-client", specifier = "==0.1.0a11" },+ { name = "composio-langchain", specifier = "==1.0.0rc2" },+ { name = "gitpython", specifier = ">=3.1.0" },{ name = "inflection", specifier = ">=0.5.1" },+ { name = "nbformat", specifier = ">=5.0.0" },{ name = "openai", specifier = ">=1.79.0" },+ { name = "packaging", specifier = ">=20.0" },{ name = "python-dotenv", specifier = ">=1.1.0" },+ { name = "pyyaml", specifier = ">=6.0" },{ name = "ruamel-yaml", specifier = ">=0.18.10" },+ { name = "tqdm", specifier = ">=4.62.0" },{ name = "typing-extensions", specifier = ">=4.13.0" },][package.metadata.requires-dev]dev = [- { name = "composio", git = "ssh://[email protected]/composiohq/py-sdk-v3" },- { name = "composio-langchain", git = "ssh://[email protected]/composiohq/py-sdk-v3?subdirectory=providers%2Flangchain" },+ { name = "composio" },+ { name = "composio-langchain" },{ name = "langchain", specifier = ">=0.3.25" },]+[[package]]+name = "gitdb"+version = "4.0.12"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "smmap" },+]+sdist = { url = "https://files.pythonhosted.org/packages/72/94/63b0fc47eb32792c7ba1fe1b694daec9a63620db1e313033d18140c2320a/gitdb-4.0.12.tar.gz", hash = "sha256:5ef71f855d191a3326fcfbc0d5da835f26b13fbcba60c32c21091c349ffdb571", size = 394684 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/a0/61/5c78b91c3143ed5c14207f463aecfc8f9dbb5092fb2869baf37c273b2705/gitdb-4.0.12-py3-none-any.whl", hash = "sha256:67073e15955400952c6565cc3e707c554a4eea2e428946f7a4c162fab9bd9bcf", size = 62794 },+]++[[package]]+name = "gitpython"+version = "3.1.44"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "gitdb" },+]+sdist = { url = "https://files.pythonhosted.org/packages/c0/89/37df0b71473153574a5cdef8f242de422a0f5d26d7a9e231e6f169b4ad14/gitpython-3.1.44.tar.gz", hash = "sha256:c87e30b26253bf5418b01b0660f818967f3c503193838337fe5e573331249269", size = 214196 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/1d/9a/4114a9057db2f1462d5c8f8390ab7383925fe1ac012eaa42402ad65c2963/GitPython-3.1.44-py3-none-any.whl", hash = "sha256:9e0e10cda9bed1ee64bc9a6de50e7e38a9c9943241cd7f585f6df3ed28011110", size = 207599 },+]+[[package]]name = "greenlet"version = "3.2.3"@@ -404,6 +434,47 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/71/92/5e77f98553e9e75130c78900d000368476aed74276eb8ae8796f65f00918/jsonpointer-3.0.0-py2.py3-none-any.whl", hash = "sha256:13e088adc14fca8b6aa8177c044e12701e6ad4b28ff10e65f2267a90109c9942", size = 7595 },]+[[package]]+name = "jsonschema"+version = "4.24.0"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "attrs" },+ { name = "jsonschema-specifications" },+ { name = "referencing" },+ { name = "rpds-py" },+]+sdist = { url = "https://files.pythonhosted.org/packages/bf/d3/1cf5326b923a53515d8f3a2cd442e6d7e94fcc444716e879ea70a0ce3177/jsonschema-4.24.0.tar.gz", hash = "sha256:0b4e8069eb12aedfa881333004bccaec24ecef5a8a6a4b6df142b2cc9599d196", size = 353480 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/a2/3d/023389198f69c722d039351050738d6755376c8fd343e91dc493ea485905/jsonschema-4.24.0-py3-none-any.whl", hash = "sha256:a462455f19f5faf404a7902952b6f0e3ce868f3ee09a359b05eca6673bd8412d", size = 88709 },+]++[[package]]+name = "jsonschema-specifications"+version = "2025.4.1"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "referencing" },+]+sdist = { url = "https://files.pythonhosted.org/packages/bf/ce/46fbd9c8119cfc3581ee5643ea49464d168028cfb5caff5fc0596d0cf914/jsonschema_specifications-2025.4.1.tar.gz", hash = "sha256:630159c9f4dbea161a6a2205c3011cc4f18ff381b189fff48bb39b9bf26ae608", size = 15513 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/01/0e/b27cdbaccf30b890c40ed1da9fd4a3593a5cf94dae54fb34f8a4b74fcd3f/jsonschema_specifications-2025.4.1-py3-none-any.whl", hash = "sha256:4653bffbd6584f7de83a67e0d620ef16900b390ddc7939d56684d6c81e33f1af", size = 18437 },+]++[[package]]+name = "jupyter-core"+version = "5.8.1"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "platformdirs" },+ { name = "pywin32", marker = "platform_python_implementation != 'PyPy' and sys_platform == 'win32'" },+ { name = "traitlets" },+]+sdist = { url = "https://files.pythonhosted.org/packages/99/1b/72906d554acfeb588332eaaa6f61577705e9ec752ddb486f302dafa292d9/jupyter_core-5.8.1.tar.gz", hash = "sha256:0a5f9706f70e64786b75acba995988915ebd4601c8a52e534a40b51c95f59941", size = 88923 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/2f/57/6bffd4b20b88da3800c5d691e0337761576ee688eb01299eae865689d2df/jupyter_core-5.8.1-py3-none-any.whl", hash = "sha256:c28d268fc90fb53f1338ded2eb410704c5449a358406e8a948b75706e24863d0", size = 28880 },+]+[[package]]name = "langchain"version = "0.3.25"@@ -481,6 +552,21 @@ dependencies = [[package.metadata]requires-dist = [{ name = "composio", git = "ssh://[email protected]/composiohq/py-sdk-v3" }]+[[package]]+name = "nbformat"+version = "5.10.4"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "fastjsonschema" },+ { name = "jsonschema" },+ { name = "jupyter-core" },+ { name = "traitlets" },+]+sdist = { url = "https://files.pythonhosted.org/packages/6d/fd/91545e604bc3dad7dca9ed03284086039b294c6b3d75c0d2fa45f9e9caf3/nbformat-5.10.4.tar.gz", hash = "sha256:322168b14f937a5d11362988ecac2a4952d3d8e3a2cbeb2319584631226d5b3a", size = 142749 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/a9/82/0340caa499416c78e5d8f5f05947ae4bc3cba53c9f038ab6e9ed964e22f1/nbformat-5.10.4-py3-none-any.whl", hash = "sha256:3b48d6c8fbca4b299bf3982ea7db1af21580e4fec269ad087b9e81588891200b", size = 78454 },+]+[[package]]name = "openai"version = "1.79.0"@@ -547,6 +633,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/88/ef/eb23f262cca3c0c4eb7ab1933c3b1f03d021f2c48f54763065b6f0e321be/packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", size = 65451 },]+[[package]]+name = "platformdirs"+version = "4.3.8"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/fe/8b/3c73abc9c759ecd3f1f7ceff6685840859e8070c4d947c93fae71f6a0bf2/platformdirs-4.3.8.tar.gz", hash = "sha256:3d512d96e16bcb959a814c9f348431070822a6496326a4be0911c40b5a74c2bc", size = 21362 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/fe/39/979e8e21520d4e47a0bbe349e2713c0aac6f3d853d0e5b34d76206c439aa/platformdirs-4.3.8-py3-none-any.whl", hash = "sha256:ff7059bb7eb1179e2685604f4aaf157cfd9535242bd23742eadc3c13542139b4", size = 18567 },+]+[[package]]name = "pycparser"version = "2.22"@@ -632,6 +727,19 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/1e/18/98a99ad95133c6a6e2005fe89faedf294a748bd5dc803008059409ac9b1e/python_dotenv-1.1.0-py3-none-any.whl", hash = "sha256:d7c01d9e2293916c18baf562d95698754b0dbbb5e74d457c45d4f6561fb9d55d", size = 20256 },]+[[package]]+name = "pywin32"+version = "310"+source = { registry = "https://pypi.org/simple" }+wheels = [+ { url = "https://files.pythonhosted.org/packages/6b/ec/4fdbe47932f671d6e348474ea35ed94227fb5df56a7c30cbbb42cd396ed0/pywin32-310-cp312-cp312-win32.whl", hash = "sha256:8a75a5cc3893e83a108c05d82198880704c44bbaee4d06e442e471d3c9ea4f3d", size = 8796239 },+ { url = "https://files.pythonhosted.org/packages/e3/e5/b0627f8bb84e06991bea89ad8153a9e50ace40b2e1195d68e9dff6b03d0f/pywin32-310-cp312-cp312-win_amd64.whl", hash = "sha256:bf5c397c9a9a19a6f62f3fb821fbf36cac08f03770056711f765ec1503972060", size = 9503839 },+ { url = "https://files.pythonhosted.org/packages/1f/32/9ccf53748df72301a89713936645a664ec001abd35ecc8578beda593d37d/pywin32-310-cp312-cp312-win_arm64.whl", hash = "sha256:2349cc906eae872d0663d4d6290d13b90621eaf78964bb1578632ff20e152966", size = 8459470 },+ { url = "https://files.pythonhosted.org/packages/1c/09/9c1b978ffc4ae53999e89c19c77ba882d9fce476729f23ef55211ea1c034/pywin32-310-cp313-cp313-win32.whl", hash = "sha256:5d241a659c496ada3253cd01cfaa779b048e90ce4b2b38cd44168ad555ce74ab", size = 8794384 },+ { url = "https://files.pythonhosted.org/packages/45/3c/b4640f740ffebadd5d34df35fecba0e1cfef8fde9f3e594df91c28ad9b50/pywin32-310-cp313-cp313-win_amd64.whl", hash = "sha256:667827eb3a90208ddbdcc9e860c81bde63a135710e21e4cb3348968e4bd5249e", size = 9503039 },+ { url = "https://files.pythonhosted.org/packages/b4/f4/f785020090fb050e7fb6d34b780f2231f302609dc964672f72bfaeb59a28/pywin32-310-cp313-cp313-win_arm64.whl", hash = "sha256:e308f831de771482b7cf692a1f308f8fca701b2d8f9dde6cc440c7da17e47b33", size = 8458152 },+]+[[package]]name = "pyyaml"version = "6.0.2"@@ -658,6 +766,20 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/fa/de/02b54f42487e3d3c6efb3f89428677074ca7bf43aae402517bc7cca949f3/PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563", size = 156446 },]+[[package]]+name = "referencing"+version = "0.36.2"+source = { registry = "https://pypi.org/simple" }+dependencies = [+ { name = "attrs" },+ { name = "rpds-py" },+ { name = "typing-extensions", marker = "python_full_version < '3.13'" },+]+sdist = { url = "https://files.pythonhosted.org/packages/2f/db/98b5c277be99dd18bfd91dd04e1b759cad18d1a338188c936e92f921c7e2/referencing-0.36.2.tar.gz", hash = "sha256:df2e89862cd09deabbdba16944cc3f10feb6b3e6f18e902f7cc25609a34775aa", size = 74744 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/c1/b1/3baf80dc6d2b7bc27a95a67752d0208e410351e3feb4eb78de5f77454d8d/referencing-0.36.2-py3-none-any.whl", hash = "sha256:e8699adbbf8b5c7de96d8ffa0eb5c158b3beafce084968e2ea8bb08c6794dcd0", size = 26775 },+]+[[package]]name = "requests"version = "2.32.3"@@ -685,6 +807,55 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/3f/51/d4db610ef29373b879047326cbf6fa98b6c1969d6f6dc423279de2b1be2c/requests_toolbelt-1.0.0-py2.py3-none-any.whl", hash = "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06", size = 54481 },]+[[package]]+name = "rpds-py"+version = "0.25.1"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/8c/a6/60184b7fc00dd3ca80ac635dd5b8577d444c57e8e8742cecabfacb829921/rpds_py-0.25.1.tar.gz", hash = "sha256:8960b6dac09b62dac26e75d7e2c4a22efb835d827a7278c34f72b2b84fa160e3", size = 27304 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/7f/81/28ab0408391b1dc57393653b6a0cf2014cc282cc2909e4615e63e58262be/rpds_py-0.25.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:b5ffe453cde61f73fea9430223c81d29e2fbf412a6073951102146c84e19e34c", size = 364647 },+ { url = "https://files.pythonhosted.org/packages/2c/9a/7797f04cad0d5e56310e1238434f71fc6939d0bc517192a18bb99a72a95f/rpds_py-0.25.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:115874ae5e2fdcfc16b2aedc95b5eef4aebe91b28e7e21951eda8a5dc0d3461b", size = 350454 },+ { url = "https://files.pythonhosted.org/packages/69/3c/93d2ef941b04898011e5d6eaa56a1acf46a3b4c9f4b3ad1bbcbafa0bee1f/rpds_py-0.25.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a714bf6e5e81b0e570d01f56e0c89c6375101b8463999ead3a93a5d2a4af91fa", size = 389665 },+ { url = "https://files.pythonhosted.org/packages/c1/57/ad0e31e928751dde8903a11102559628d24173428a0f85e25e187defb2c1/rpds_py-0.25.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:35634369325906bcd01577da4c19e3b9541a15e99f31e91a02d010816b49bfda", size = 403873 },+ { url = "https://files.pythonhosted.org/packages/16/ad/c0c652fa9bba778b4f54980a02962748479dc09632e1fd34e5282cf2556c/rpds_py-0.25.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d4cb2b3ddc16710548801c6fcc0cfcdeeff9dafbc983f77265877793f2660309", size = 525866 },+ { url = "https://files.pythonhosted.org/packages/2a/39/3e1839bc527e6fcf48d5fec4770070f872cdee6c6fbc9b259932f4e88a38/rpds_py-0.25.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9ceca1cf097ed77e1a51f1dbc8d174d10cb5931c188a4505ff9f3e119dfe519b", size = 416886 },+ { url = "https://files.pythonhosted.org/packages/7a/95/dd6b91cd4560da41df9d7030a038298a67d24f8ca38e150562644c829c48/rpds_py-0.25.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2c2cd1a4b0c2b8c5e31ffff50d09f39906fe351389ba143c195566056c13a7ea", size = 390666 },+ { url = "https://files.pythonhosted.org/packages/64/48/1be88a820e7494ce0a15c2d390ccb7c52212370badabf128e6a7bb4cb802/rpds_py-0.25.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1de336a4b164c9188cb23f3703adb74a7623ab32d20090d0e9bf499a2203ad65", size = 425109 },+ { url = "https://files.pythonhosted.org/packages/cf/07/3e2a17927ef6d7720b9949ec1b37d1e963b829ad0387f7af18d923d5cfa5/rpds_py-0.25.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9fca84a15333e925dd59ce01da0ffe2ffe0d6e5d29a9eeba2148916d1824948c", size = 567244 },+ { url = "https://files.pythonhosted.org/packages/d2/e5/76cf010998deccc4f95305d827847e2eae9c568099c06b405cf96384762b/rpds_py-0.25.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:88ec04afe0c59fa64e2f6ea0dd9657e04fc83e38de90f6de201954b4d4eb59bd", size = 596023 },+ { url = "https://files.pythonhosted.org/packages/52/9a/df55efd84403736ba37a5a6377b70aad0fd1cb469a9109ee8a1e21299a1c/rpds_py-0.25.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a8bd2f19e312ce3e1d2c635618e8a8d8132892bb746a7cf74780a489f0f6cdcb", size = 561634 },+ { url = "https://files.pythonhosted.org/packages/ab/aa/dc3620dd8db84454aaf9374bd318f1aa02578bba5e567f5bf6b79492aca4/rpds_py-0.25.1-cp312-cp312-win32.whl", hash = "sha256:e5e2f7280d8d0d3ef06f3ec1b4fd598d386cc6f0721e54f09109a8132182fbfe", size = 222713 },+ { url = "https://files.pythonhosted.org/packages/a3/7f/7cef485269a50ed5b4e9bae145f512d2a111ca638ae70cc101f661b4defd/rpds_py-0.25.1-cp312-cp312-win_amd64.whl", hash = "sha256:db58483f71c5db67d643857404da360dce3573031586034b7d59f245144cc192", size = 235280 },+ { url = "https://files.pythonhosted.org/packages/99/f2/c2d64f6564f32af913bf5f3f7ae41c7c263c5ae4c4e8f1a17af8af66cd46/rpds_py-0.25.1-cp312-cp312-win_arm64.whl", hash = "sha256:6d50841c425d16faf3206ddbba44c21aa3310a0cebc3c1cdfc3e3f4f9f6f5728", size = 225399 },+ { url = "https://files.pythonhosted.org/packages/2b/da/323848a2b62abe6a0fec16ebe199dc6889c5d0a332458da8985b2980dffe/rpds_py-0.25.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:659d87430a8c8c704d52d094f5ba6fa72ef13b4d385b7e542a08fc240cb4a559", size = 364498 },+ { url = "https://files.pythonhosted.org/packages/1f/b4/4d3820f731c80fd0cd823b3e95b9963fec681ae45ba35b5281a42382c67d/rpds_py-0.25.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:68f6f060f0bbdfb0245267da014d3a6da9be127fe3e8cc4a68c6f833f8a23bb1", size = 350083 },+ { url = "https://files.pythonhosted.org/packages/d5/b1/3a8ee1c9d480e8493619a437dec685d005f706b69253286f50f498cbdbcf/rpds_py-0.25.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:083a9513a33e0b92cf6e7a6366036c6bb43ea595332c1ab5c8ae329e4bcc0a9c", size = 389023 },+ { url = "https://files.pythonhosted.org/packages/3b/31/17293edcfc934dc62c3bf74a0cb449ecd549531f956b72287203e6880b87/rpds_py-0.25.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:816568614ecb22b18a010c7a12559c19f6fe993526af88e95a76d5a60b8b75fb", size = 403283 },+ { url = "https://files.pythonhosted.org/packages/d1/ca/e0f0bc1a75a8925024f343258c8ecbd8828f8997ea2ac71e02f67b6f5299/rpds_py-0.25.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3c6564c0947a7f52e4792983f8e6cf9bac140438ebf81f527a21d944f2fd0a40", size = 524634 },+ { url = "https://files.pythonhosted.org/packages/3e/03/5d0be919037178fff33a6672ffc0afa04ea1cfcb61afd4119d1b5280ff0f/rpds_py-0.25.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5c4a128527fe415d73cf1f70a9a688d06130d5810be69f3b553bf7b45e8acf79", size = 416233 },+ { url = "https://files.pythonhosted.org/packages/05/7c/8abb70f9017a231c6c961a8941403ed6557664c0913e1bf413cbdc039e75/rpds_py-0.25.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a49e1d7a4978ed554f095430b89ecc23f42014a50ac385eb0c4d163ce213c325", size = 390375 },+ { url = "https://files.pythonhosted.org/packages/7a/ac/a87f339f0e066b9535074a9f403b9313fd3892d4a164d5d5f5875ac9f29f/rpds_py-0.25.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d74ec9bc0e2feb81d3f16946b005748119c0f52a153f6db6a29e8cd68636f295", size = 424537 },+ { url = "https://files.pythonhosted.org/packages/1f/8f/8d5c1567eaf8c8afe98a838dd24de5013ce6e8f53a01bd47fe8bb06b5533/rpds_py-0.25.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:3af5b4cc10fa41e5bc64e5c198a1b2d2864337f8fcbb9a67e747e34002ce812b", size = 566425 },+ { url = "https://files.pythonhosted.org/packages/95/33/03016a6be5663b389c8ab0bbbcca68d9e96af14faeff0a04affcb587e776/rpds_py-0.25.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:79dc317a5f1c51fd9c6a0c4f48209c6b8526d0524a6904fc1076476e79b00f98", size = 595197 },+ { url = "https://files.pythonhosted.org/packages/33/8d/da9f4d3e208c82fda311bff0cf0a19579afceb77cf456e46c559a1c075ba/rpds_py-0.25.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1521031351865e0181bc585147624d66b3b00a84109b57fcb7a779c3ec3772cd", size = 561244 },+ { url = "https://files.pythonhosted.org/packages/e2/b3/39d5dcf7c5f742ecd6dbc88f6f84ae54184b92f5f387a4053be2107b17f1/rpds_py-0.25.1-cp313-cp313-win32.whl", hash = "sha256:5d473be2b13600b93a5675d78f59e63b51b1ba2d0476893415dfbb5477e65b31", size = 222254 },+ { url = "https://files.pythonhosted.org/packages/5f/19/2d6772c8eeb8302c5f834e6d0dfd83935a884e7c5ce16340c7eaf89ce925/rpds_py-0.25.1-cp313-cp313-win_amd64.whl", hash = "sha256:a7b74e92a3b212390bdce1d93da9f6488c3878c1d434c5e751cbc202c5e09500", size = 234741 },+ { url = "https://files.pythonhosted.org/packages/5b/5a/145ada26cfaf86018d0eb304fe55eafdd4f0b6b84530246bb4a7c4fb5c4b/rpds_py-0.25.1-cp313-cp313-win_arm64.whl", hash = "sha256:dd326a81afe332ede08eb39ab75b301d5676802cdffd3a8f287a5f0b694dc3f5", size = 224830 },+ { url = "https://files.pythonhosted.org/packages/4b/ca/d435844829c384fd2c22754ff65889c5c556a675d2ed9eb0e148435c6690/rpds_py-0.25.1-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:a58d1ed49a94d4183483a3ce0af22f20318d4a1434acee255d683ad90bf78129", size = 359668 },+ { url = "https://files.pythonhosted.org/packages/1f/01/b056f21db3a09f89410d493d2f6614d87bb162499f98b649d1dbd2a81988/rpds_py-0.25.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:f251bf23deb8332823aef1da169d5d89fa84c89f67bdfb566c49dea1fccfd50d", size = 345649 },+ { url = "https://files.pythonhosted.org/packages/e0/0f/e0d00dc991e3d40e03ca36383b44995126c36b3eafa0ccbbd19664709c88/rpds_py-0.25.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8dbd586bfa270c1103ece2109314dd423df1fa3d9719928b5d09e4840cec0d72", size = 384776 },+ { url = "https://files.pythonhosted.org/packages/9f/a2/59374837f105f2ca79bde3c3cd1065b2f8c01678900924949f6392eab66d/rpds_py-0.25.1-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6d273f136e912aa101a9274c3145dcbddbe4bac560e77e6d5b3c9f6e0ed06d34", size = 395131 },+ { url = "https://files.pythonhosted.org/packages/9c/dc/48e8d84887627a0fe0bac53f0b4631e90976fd5d35fff8be66b8e4f3916b/rpds_py-0.25.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:666fa7b1bd0a3810a7f18f6d3a25ccd8866291fbbc3c9b912b917a6715874bb9", size = 520942 },+ { url = "https://files.pythonhosted.org/packages/7c/f5/ee056966aeae401913d37befeeab57a4a43a4f00099e0a20297f17b8f00c/rpds_py-0.25.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:921954d7fbf3fccc7de8f717799304b14b6d9a45bbeec5a8d7408ccbf531faf5", size = 411330 },+ { url = "https://files.pythonhosted.org/packages/ab/74/b2cffb46a097cefe5d17f94ede7a174184b9d158a0aeb195f39f2c0361e8/rpds_py-0.25.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f3d86373ff19ca0441ebeb696ef64cb58b8b5cbacffcda5a0ec2f3911732a194", size = 387339 },+ { url = "https://files.pythonhosted.org/packages/7f/9a/0ff0b375dcb5161c2b7054e7d0b7575f1680127505945f5cabaac890bc07/rpds_py-0.25.1-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c8980cde3bb8575e7c956a530f2c217c1d6aac453474bf3ea0f9c89868b531b6", size = 418077 },+ { url = "https://files.pythonhosted.org/packages/0d/a1/fda629bf20d6b698ae84c7c840cfb0e9e4200f664fc96e1f456f00e4ad6e/rpds_py-0.25.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:8eb8c84ecea987a2523e057c0d950bcb3f789696c0499290b8d7b3107a719d78", size = 562441 },+ { url = "https://files.pythonhosted.org/packages/20/15/ce4b5257f654132f326f4acd87268e1006cc071e2c59794c5bdf4bebbb51/rpds_py-0.25.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:e43a005671a9ed5a650f3bc39e4dbccd6d4326b24fb5ea8be5f3a43a6f576c72", size = 590750 },+ { url = "https://files.pythonhosted.org/packages/fb/ab/e04bf58a8d375aeedb5268edcc835c6a660ebf79d4384d8e0889439448b0/rpds_py-0.25.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:58f77c60956501a4a627749a6dcb78dac522f249dd96b5c9f1c6af29bfacfb66", size = 558891 },+ { url = "https://files.pythonhosted.org/packages/90/82/cb8c6028a6ef6cd2b7991e2e4ced01c854b6236ecf51e81b64b569c43d73/rpds_py-0.25.1-cp313-cp313t-win32.whl", hash = "sha256:2cb9e5b5e26fc02c8a4345048cd9998c2aca7c2712bd1b36da0c72ee969a3523", size = 218718 },+ { url = "https://files.pythonhosted.org/packages/b6/97/5a4b59697111c89477d20ba8a44df9ca16b41e737fa569d5ae8bff99e650/rpds_py-0.25.1-cp313-cp313t-win_amd64.whl", hash = "sha256:401ca1c4a20cc0510d3435d89c069fe0a9ae2ee6495135ac46bdd49ec0495763", size = 232218 },+]+[[package]]name = "ruamel-yaml"version = "0.18.10"@@ -723,6 +894,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/b0/85/e8e751d8791564dd333d5d9a4eab0a7a115f7e349595417fd50ecae3395c/ruamel.yaml.clib-0.2.12-cp313-cp313-win_amd64.whl", hash = "sha256:e5b8daf27af0b90da7bb903a876477a9e6d7270be6146906b276605997c7e9a3", size = 115190 },]+[[package]]+name = "smmap"+version = "5.0.2"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/44/cd/a040c4b3119bbe532e5b0732286f805445375489fceaec1f48306068ee3b/smmap-5.0.2.tar.gz", hash = "sha256:26ea65a03958fa0c8a1c7e8c7a58fdc77221b8910f6be2131affade476898ad5", size = 22329 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/04/be/d09147ad1ec7934636ad912901c5fd7667e1c858e19d355237db0d0cd5e4/smmap-5.0.2-py3-none-any.whl", hash = "sha256:b30115f0def7d7531d22a0fb6502488d879e75b260a9db4d0819cfb25403af5e", size = 24303 },+]+[[package]]name = "sniffio"version = "1.3.1"@@ -782,6 +962,15 @@ wheels = [{ url = "https://files.pythonhosted.org/packages/d0/30/dc54f88dd4a2b5dc8a0279bdd7270e735851848b762aeb1c1184ed1f6b14/tqdm-4.67.1-py3-none-any.whl", hash = "sha256:26445eca388f82e72884e0d580d5464cd801a3ea01e63e5601bdff9ba6a48de2", size = 78540 },]+[[package]]+name = "traitlets"+version = "5.14.3"+source = { registry = "https://pypi.org/simple" }+sdist = { url = "https://files.pythonhosted.org/packages/eb/79/72064e6a701c2183016abbbfedaba506d81e30e232a68c9f0d6f6fcd1574/traitlets-5.14.3.tar.gz", hash = "sha256:9ed0579d3502c94b4b3732ac120375cda96f923114522847de4b3bb98b96b6b7", size = 161621 }+wheels = [+ { url = "https://files.pythonhosted.org/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl", hash = "sha256:b74e89e397b1ed28cc831db7aea759ba6640cb3de13090ca145426688ff1ac4f", size = 85359 },+]+[[package]]name = "typing-extensions"version = "4.13.2"