Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7866281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:20:47+00:00 2026-06-03T00:20:47+00:00

I have a large number of python file and I would like to generate

  • 0

I have a large number of python file and I would like to generate public API documentation for my project. All the functions that are part of the api I have decorated with a decorator.

for example:

@api
def post_comment(comment)"
    """ Posts a coment
    """
    pass

There are other public methods in the same classes. The API is spread among several files each file defining classes with methods and some methods have this @api decorator. How can I tell Sphinx to generate docs just for the public API?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:20:51+00:00Added an answer on June 3, 2026 at 12:20 am

    I’m answering my own question… After some more had searching I found this:

    https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#skipping-members

    Basically you can define a function in your conf.py file can look at each member and skip
    all that don’t have the right decorator.

    Here is a little example at the end of my conf.py file (this is the config file for sphinx):

    def my_doc_skip(app, what, name, obj, skip, options):
        if what != "method":
            return True
    
        # if obj is decorated with @api
        #     return True
        # return False
    
    def setup(app):
        app.connect('autodoc-process-docstring', my_process_docstring)
        app.connect('autodoc-skip-member', my_doc_skip)
    

    You can also process the docstring with a function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large number of csv files that look like this below: xxxxxxxx
I have a large collection of my personal scripts that I would like to
I have a Python script that needs to process a large number of files.
I have a large number of instances of a C structure like this: struct
We have a large number of programmers on different platforms all using CVS. We
I have a large number of C# WCF services that are being called by
I am using spring+struts2 and I have a large number of action classes that
I have a large tar.gz file to analyze using a python script. The tar.gz
I am currently writing an app in python that needs to generate large amount
I have a large binary file of ieee 32bit floating point numbers. In python

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.