Does Swagger support to convert existing python api code to api-doc or .yml?

1,021 views
Skip to first unread message

Poppy Lei

unread,
Apr 16, 2015, 2:09:46 AM4/16/15
to swagger-sw...@googlegroups.com
Hi, I am very new to Swagger.
I had a existing python api code, and was trying to use swagger to automaticlly generate api-doc. I found some information from stackoverflow that If I already have an existing API with code, I can use any of the existing libraries (https://github.com/swagger-api/swagger-spec#additional-libraries) to integrate into my code and generate documentation at run time. But I am not sure how to achieve that using thoes existing libraries. Or there is not a library supports python. 

Is there a way to convert  python api code to api-doc using swagger? Do I need to write a json or yaml file to generate the doc even though I have a python api code?

Thanks a lot.

Poppy

Ron Ratovsky

unread,
Apr 16, 2015, 2:17:28 AM4/16/15
to swagger-sw...@googlegroups.com
Hi Poppy,

Welcome to the Swagger world.

Swagger itself is the specification of what such API descriptions should look like. It's not a specific tool or library and as such doesn't have any technical capabilities of producing such documentations or taking existing code and converting it.

The link you shared there contains a list of libraries per language, including Python, that allow you to generate such documentation directly from your code. How each one works differs from one l library to another and they should all provide some form of documentation on how to integrate them with your code. Since all the Python libraries are community contributions, we cannot really recommend one over the other. I'd suggest you take some time to check these libraries, see how they work and pick the one that fits your personal needs and preference.

Ron

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------

Poppy Lei

unread,
Apr 16, 2015, 2:45:07 AM4/16/15
to swagger-sw...@googlegroups.com
Hi Ron,

Thank you for the quick reply. For those python libraries, django-rest-swagger I think is used to generate doc. But I am not using django, so that's not the one I need.
As you said Swagger is a specification not a tool, how does Swagger enable client and documentation systems to update at the same pace as the server.?

Do you know if Raml can do that? 

Thanks,
Poppy

On Wednesday, April 15, 2015 at 11:17:28 PM UTC-7, Ron wrote:
Hi Poppy,

Welcome to the Swagger world.

Swagger itself is the specification of what such API descriptions should look like. It's not a specific tool or library and as such doesn't have any technical capabilities of producing such documentations or taking existing code and converting it.

The link you shared there contains a list of libraries per language, including Python, that allow you to generate such documentation directly from your code. How each one works differs from one l library to another and they should all provide some form of documentation on how to integrate them with your code. Since all the Python libraries are community contributions, we cannot really recommend one over the other. I'd suggest you take some time to check these libraries, see how they work and pick the one that fits your personal needs and preference.

Ron
On Thu, Apr 16, 2015 at 9:09 AM, Poppy Lei <poppy...@gmail.com> wrote:
Hi, I am very new to Swagger.
I had a existing python api code, and was trying to use swagger to automaticlly generate api-doc. I found some information from stackoverflow that If I already have an existing API with code, I can use any of the existing libraries (https://github.com/swagger-api/swagger-spec#additional-libraries) to integrate into my code and generate documentation at run time. But I am not sure how to achieve that using thoes existing libraries. Or there is not a library supports python. 

Is there a way to convert  python api code to api-doc using swagger? Do I need to write a json or yaml file to generate the doc even though I have a python api code?

Thanks a lot.

Poppy

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ron Ratovsky

unread,
Apr 16, 2015, 2:52:10 AM4/16/15
to swagger-sw...@googlegroups.com
All the libraries under https://github.com/swagger-api/swagger-spec#python are able to generate docs. Some are for django, some for tastypie, some for flask and others. I don't know which framework you use, but there should be fairly good coverage there.
Since Raml is not really within our scope, I can't comment on that.


To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Poppy Lei

unread,
Apr 16, 2015, 2:55:58 AM4/16/15
to swagger-sw...@googlegroups.com
Ok, I will look into those libraries to find one fits my needs. Thanks for you help.


On Wednesday, April 15, 2015 at 11:52:10 PM UTC-7, Ron wrote:
All the libraries under https://github.com/swagger-api/swagger-spec#python are able to generate docs. Some are for django, some for tastypie, some for flask and others. I don't know which framework you use, but there should be fairly good coverage there.
Since Raml is not really within our scope, I can't comment on that.

On Thu, Apr 16, 2015 at 9:45 AM, Poppy Lei <poppy...@gmail.com> wrote:
Hi Ron,

Thank you for the quick reply. For those python libraries, django-rest-swagger I think is used to generate doc. But I am not using django, so that's not the one I need.
As you said Swagger is a specification not a tool, how does Swagger enable client and documentation systems to update at the same pace as the server.?

Do you know if Raml can do that? 

Thanks,
Poppy

On Wednesday, April 15, 2015 at 11:17:28 PM UTC-7, Ron wrote:
Hi Poppy,

Welcome to the Swagger world.

Swagger itself is the specification of what such API descriptions should look like. It's not a specific tool or library and as such doesn't have any technical capabilities of producing such documentations or taking existing code and converting it.

The link you shared there contains a list of libraries per language, including Python, that allow you to generate such documentation directly from your code. How each one works differs from one l library to another and they should all provide some form of documentation on how to integrate them with your code. Since all the Python libraries are community contributions, we cannot really recommend one over the other. I'd suggest you take some time to check these libraries, see how they work and pick the one that fits your personal needs and preference.

Ron
On Thu, Apr 16, 2015 at 9:09 AM, Poppy Lei <poppy...@gmail.com> wrote:
Hi, I am very new to Swagger.
I had a existing python api code, and was trying to use swagger to automaticlly generate api-doc. I found some information from stackoverflow that If I already have an existing API with code, I can use any of the existing libraries (https://github.com/swagger-api/swagger-spec#additional-libraries) to integrate into my code and generate documentation at run time. But I am not sure how to achieve that using thoes existing libraries. Or there is not a library supports python. 

Is there a way to convert  python api code to api-doc using swagger? Do I need to write a json or yaml file to generate the doc even though I have a python api code?

Thanks a lot.

Poppy

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsubscri...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages