cheshire-cat-ai / plugins-backend Goto Github PK
View Code? Open in Web Editor NEWThe backend of The Cheshire Cat plugin directory
License: GNU General Public License v3.0
The backend of The Cheshire Cat plugin directory
License: GNU General Public License v3.0
Could be useful to have an analytics endpoint to get some data and optionally a plot.
Here is the code to make a plot out of analytics.json
import pandas as pd
import plotly.express as px
json = pd.read_json("analytics.json", typ="series")
df = pd.DataFrame({
"plugin": json.index.values,
"downloads": json.values,
})
df = df.sort_values("downloads", ascending=True)
df["plugin"] = df["plugin"].map(lambda p: p.split("/")[-1])
px.bar(df, y="plugin", x="downloads") # could be saved as file or sent as binary/base64/whatever
We are giving community a recommended way of creating a plugin, with this template that handles releases creating a ready made zip to download via Github public api.
Since method Endpoints.download_plugin_zip
is already dealing with the creation of the zip, covering all non-template use cases, I propose to:
Endpoints.download_plugin_zip
if there is a release zip via Github public api (as done here)Maybe @valentimarco is interested at working on this (also @nicola-corbellini )
plugins-backend
)docker-compose.yml
We can count single plugin total downloads.
ATM all the logs and debug are printed server side and are hard to extract and analyzed. We must create a more robust logging system for the registry.
Cat admin shows plugins from the registry in two use cases:
How do we sort them?
When we cache the plugin data (once a day) we have to add analytics.json
data to the plugins' object
Since we are sure github repos' URLs are unique, I suggest using them as plugin id to get the .zip
file from the /download
endpoint
{
"plugin_url": "https://github.com/..."
}
Currently, the /plugins
endpoint serves as the main controller for the cache system. This presents an issue with pagination, as making an initial paginated call results in an incomplete cached list.
To address this, we need to decouple the caching functionality from the specific endpoint. Additionally, some code refactoring is required to utilize only the cache retrieval function and the validity-check mechanism, triggering cache invalidation if the predetermined time interval has passed.
In order to avoid breaking JSON we have to validate the format of the list with a GitHub action.
A plugin submission in which the repo url was ending with a /
made the registry give 500 Internal Server Error
For sure we can enforce no ending slash in plugins
repo in file plugins.json
, but a final slash should not cause such a problem.
Currently, the fields from various plugin.json
files are all taken and included in the response of the different endpoints. This behavior, besides being risky, also leaves room for unintended errors on the part of developers.
We need to devise a method to validate the fields of the various plugins and only display those that are valid. Moreover, we should also consider returning only the plugins that have all the necessary minimal fields (name
, description
, url
, author
, tags
, thumb
, and version
).
A mechanism should also be designed to notify any validation errors, perhaps by saving and making a log available through a designated endpoint. In this regard, we could also provide an endpoint to assist plugin authors in automatically validating their plugin.json
files through actions (e.g., /validate
or /validation
).
Currently, the readme file is the sole source of knowledge regarding the project's endpoints. Therefore, a more elegant and clear way of organizing and displaying the endpoints along with their respective parameters needs to be found.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.