Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Techdocs really started as a passion project due to our indolent nature towards documenting our own codebases. We are currently working as core backend-microservice developers for an open-source organization - Heritians at our University.
Here is our story about how Techdocs was born:
OUR LAZINESS IS THE SOLE MOTIVATION FOR TECHDOCS
Techdocs is a PyPI package capable of automatically generating documentation for Python codebases via CLI. Techdocs generate the docstrings in place by analyzing the structure, logic, and functionality of code by leveraging Abstract Syntax Tree (AST) for .py
files. It leverages the power and efficiency of Large Language Models (LLMs) along with carefully crafted API design to accomplish the task.
Techdocs can be broadly classified into 3 major components:
Backend/API: This API is where all the magic happens. It acts as a brain for our product. Developed using FastAPI, our API is catered to achieve minimum user-perceived latency. Our API hosts WizardLM-70B - a fine-tuned version of the Llama-2 model for downstream tasks like Code Understanding, and Code Generation.
.yml
workflow. It then uses the power of DOCKER to containerize the API module, hosting it on Hugginface's servers. This way, our public endpoints are exposed and our CLI tool can use them however the user intends.Deployed API Link: https://caffeinecrew-techdocs.hf.space/docs
CLI/PyPI Package:
This is the main interface with which users can interact with our product. The tool is a PyPI package which makes it easier to install and use in any Python project. To prepare the package tools like build
, twine
, setuptools
, and argparse
have been used. Here are a few things you can do with the CLI tool.
$ techdocs
>👋 Hi there! Welcome to techdocs. Here are some cool things you can do:
💫 try out a demo with our new GUI 🚀 and explore how to use the CLI:
➡️ https://techdocs.streamlit.app/
💫 signup here to get an API key 👤:
$ techdocs signup -u <username> -p <password> -e <email>
💫 use the line below to issue a new API key 🗝️:
$ techdocs apikey -u <username> -p <password>
💫 use the CLI to generate documentation for your project 📚:
$ techdocs generate -k <api_key> -u <username> -p <password> -d <directory>
PyPI package: https://pypi.org/project/techdocs/
Web App:
Note that the web app is only intended as a demo. To unleash the full power of Techdocs, please refer to the CLI usage.
We used Streamlit to create a user-friendly web app that allows users to upload their code block and get the documentation in a proper format. We have mentioned clear instructions on the instructions page. The home page of our app has all the details of our Techdocs projects along with its Architecture.
API Deployment Issues:
WizardLM-70B
model locally on Huggingface's servers. However, the size of the model exceeded the free tier available there. Furthermore, inferencing from a model available on a local disk was extremely time-consuming. To get docstrings of a single function it would take a few minutes..yml
workflow and then deploy the API there by using our DOCKERFILE
. Without the docker support from Huggingface Spaces, we could not have deployed our API anywhere! Docker was our saviour.CLI development:
click
package for building CLIs, the package we used argparse
, does not provide a built-in way to create subcommands. Adding subcommands by adding sub-parsers and binding appropriate function definitions was a nightmare. But we aced it eventually!Clarifai
package for hosting our LLM. This creates a big question about user code integrity and privacy.
FAQs
Code documentation generation CLI App
We found that techdocs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.