Swing Server
Swing Server is an open-source Swing Chart repository written in Python language.
Installation
The application can be installed from the PyPI repository using the next command.
pip install swing-server
Requirements
To run the application, you have to provide a connection to the PostgreSQL database and some folder, where uploaded archives will be stored. You also need to install the Flask framework from the PyPI repository.
pip install flask
Configuration
You can configure the application using environment variables.
SECRET_KEYSecret token for storing of the user's session. (required)DATABASE_URIPostgreSQL database URI. (required)PUBLIC_URLPublic address where the application will be accessible. (default: http://localhost:5000)STORAGE_TYPEThere is currently only single type of the storage. (default: local)STORAGE_LOCAL_DIRDirectory where uploaded charts will be stored. (required)INIT_USER_EMAILE-mail of the initial user that will be created after server start-up. (default: none)INIT_USER_PASSWORDPassword of the initial user. (required)
Server Startup
The application can be started as a Flask server using the next command.
FLASK_APP=swing_server flask run
Server API
- GET
/statusReturn current server status, and a number of created charts. - GET
/chart?query=<keyword>Return list of all charts. If the query is specified, then filter charts by their name or description. - GET
/release?chart=<chart_name>Return list of all releases for the specific chart. Releases are ordered by the version. - GET
/release/<chart_name>-<version>.zipDownload specific release of the chart. The filename can be for exampleredis-1.0.0.zip. - POST
/releaseUpload a new release of the chart. If the chart does not exist, then a new one is created. The archive has to be sent as a multipart form under thechartkey with theContent-Typeheader set tomultipart/form-data. - DELETE
/chart/<chart_name>?version=<version>Remove chart both from the database and from local storage. If the version is specified, then remove only the specific release. - POST
/loginLogin user using encoded credentials sent in theAuthorizationheader of the request. It is used theBasictype of authorization in this format<username>:<password>. - POST
/logoutLog out currently logged user.
Project Requirements
Functional Requirements
- List all uploaded charts.
- Get the detail and releases of the chart.
- Download a specific version of the chart.
- Upload a new version of the chart.
- Retrieve server status information.
Nonfunctional Requirements
- Charts should be stored in the server filesystem.
- The server can be configurable using environment variables.
- Editing of charts has to be secured by user authentication.
- New chart storage should be easily implementable.
Metadata
Release files for swing-server 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swing_server-0.2.tar.gz | 13.8 kB | Details |
Release files / swing_server-0.2.tar.gz
| Download URL | swing_server-0.2.tar.gz |
|---|---|
| Size | 13.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
696971ed913ef6a0056ee617d06da359e8d2e973c265e6feb67b6ef211f3ea09
|
|
BLAKE2b-256 checksum How to use checksums |
b1073ce76cd8e856f182bdadd43c1b32106de2d3069576871b7fb856e65a65af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.2.post20201201 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.7.9
|