Skip to main content

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_KEY Secret token for storing of the user's session. (required)
  • DATABASE_URI PostgreSQL database URI. (required)
  • PUBLIC_URL Public address where the application will be accessible. (default: http://localhost:5000)
  • STORAGE_TYPE There is currently only single type of the storage. (default: local)
  • STORAGE_LOCAL_DIR Directory where uploaded charts will be stored. (required)
  • INIT_USER_EMAIL E-mail of the initial user that will be created after server start-up. (default: none)
  • INIT_USER_PASSWORD Password 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 /status Return 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>.zip Download specific release of the chart. The filename can be for example redis-1.0.0.zip.
  • POST /release Upload 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 the chart key with the Content-Type header set to multipart/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 /login Login user using encoded credentials sent in the Authorization header of the request. It is used the Basic type of authorization in this format <username>:<password>.
  • POST /logout Log 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)

Source distribution for swing-server 0.2
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

Release history Release notifications | RSS feed

This release

0.2 This release

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page