mdapi
A simple and fast API for serving the metadata from the RPM repositories
Installation
For development
- Install Python 3, Virtualenv and Poetry on your Fedora Linux installation.
$ sudo dnf install python3 python3-virtualenv poetry - Clone the repository to your local storage and make it your present working directory.
$ git clone git@github.com:fedora-infra/mdapi.git $ cd mdapi - Set up and activate a virtual environment within the directory of the cloned repository.
$ virtualenv venv $ source venv/bin/activate - Check the validity of the project configuration and install the project dependencies from the lockfile.
$ (venv) poetry check $ (venv) poetry install
For container image
- Install Podman on your Fedora Linux installation.
$ sudo dnf install podman - Ensure that
- The project directory is the present working directory.
- The virtual environment with the project is activated, following the instructions provided in the development installation section.
- The project configuration is modified according to needs in
myconfig.pyfile, following the instructions provided in the configuration setup section.
- Execute the following command to build the container image.
$ (venv) podman build -t "mdapi:$(poetry version -s)" .
Usage
In development
Viewing the help message and version
- Ensure that
- The project directory is the present working directory.
- The virtual environment with the project is activated, following the instructions provided in the development installation section.
- Execute the following command to view the help message.
Output$ (venv) mdapi --helpUsage: mdapi [OPTIONS] COMMAND [ARGS]... A simple API for serving the metadata from the RPM repositories Options: -c, --conffile PATH Read configuration from the specified Python file --version Show the version and exit. --help Show this message and exit. Commands: database Fetch SQLite databases from all active Fedora Linux and EPEL... serveapp Start the API server for querying repository metadata - Execute the following command to view the project version.
Output$ (venv) mdapi --versionmdapi, version 3.0.0
Testing the project
- Ensure that
- The project directory is the present working directory.
- The virtual environment with the project is activated, following the instructions provided in the development installation section.
- The storage partition on which test database directory is located has at least 1.5 GiB of free space.
- Execute the following command to run the code quality checks and testcases.
$ (venv) tox
Setting up the configuration
- Ensure that
- The project directory is the present working directory.
- Make a copy of the default configuration on your local storage.
$ cp mdapi/confdata/standard.py mdapi/confdata/myconfig.py - Make changes to the copied configuration file to suit the requirements.
$ nano confdata/myconfig.py
Fetching the databases
- Ensure that
- The project directory is the present working directory.
- The virtual environment with the project is activated, following the instructions provided in the development installation section.
- The storage partition on which database directory is located has at least 6 GiB of free space.
- Execute the following command to start fetching the database, while referencing to the modified configuration file.
$ (venv) mdapi --conffile myconfig.py database - Note that the first run of the database fetching command will take a long time, depending on the internet connection.
Serving the application
- Ensure that
- The project directory is the present working directory.
- The virtual environment with the project is activated, following the instructions provided in the development installation section.
- Execute the following command to start serving the application, while referencing to the modified configuration file.
$ (venv) mdapi --conffile myconfig.py serveapp - When done with serving the application, press
Ctrl+Cto raise aKeyboardInterruptand exit out of the program.
In container or pod
Serving the application
- Ensure that
- The project directory is the present working directory.
- The virtual environment with the project is activated, following the instructions provided in the development installation section.
- The container image is built and available locally.
- The databases are downloaded to the database directory, following the instructions provided in the database fetching section.
- Execute the following command to start the serving the application.
This command assumes that the database directory is$ (venv) podman run -v /var/tmp:/var/tmp -p 8080:8080 -ti mdapi:$(poetry version -s)/var/tmp(which is the default) and the service port is8080(which is the default).
Metadata
Release files for mdapi 3.1.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mdapi-3.1.7.tar.gz | 28.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mdapi-3.1.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 65.4 kB
Release files / mdapi-3.1.7.tar.gz
| Download URL | mdapi-3.1.7.tar.gz |
|---|---|
| Size | 28.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
644d92599e7c69f1d499651a7ed426d319bff5e6f86fb6693462e0c61cf2e681
|
|
BLAKE2b-256 checksum How to use checksums |
ccd4d608401b1afdaffee6598348067342451ef7cf1f4a22b6b2026350f86349
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.2 Linux/6.14.0-0.rc4.20250226gitac9c34d1e45a.38.fc43.x86_64
|
Release files / mdapi-3.1.7-py3-none-any.whl
| Download URL | mdapi-3.1.7-py3-none-any.whl |
|---|---|
| Size | 37.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02d8116ed8995eb754f9c7aaf1ceb1bda6335a46c7c1032260c4015de91aecb0
|
|
BLAKE2b-256 checksum How to use checksums |
0be91571bee4a5a0e78fb3e6bf231bf2a36f116e9696895a8f90aa9068e1b306
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.1 CPython/3.13.2 Linux/6.14.0-0.rc4.20250226gitac9c34d1e45a.38.fc43.x86_64
|