Skip to main content

logo_image logo_text

EMhub is a web application for data management at scientific core facilities, specially designed for operations of middle-size CryoEM centers. It allows the creation of users and resources (e.g. microscopes or other instruments). It also coordinates access to resources through applications and bookings, providing full traceability and reporting of usage.

Additionally, a REST API is exposed that permits the writing of external scripts to communicate with the application. This feature allows to write “workers” that can monitor new data collection sessions and handle different tasks such as data transfer or on-the-fly processing.

For more detailed information check the documentation at:

https://3dem.github.io/emdocs/emhub/

Development

Basic Installation

conda create --name=emhub python=3.8
conda activate emhub

git clone https://github.com/3dem/emhub.git
# OR
git clone git@github.com:3dem/emhub.git
cd emhub

# If you want to use the development branch, then do:
# git checkout devel

pip install -e .

# Generate some test data
emh-data --create_instance

export FLASK_APP=emhub
export EMHUB_INSTANCE=~/.emhub/instances/test

# Now launch the built-in Flask development server:
flask run --debug

# or with gunicorn:
gunicorn -k gevent --workers=2 'emhub:create_app()' --bind 0.0.0.0:5000

# Then launch a web browser at http://127.0.0.1:5000/
# user: admin, password: admin

Publishing the package to PyPI

In order to make the emhub available to install with pip install emhub, we need to:

python install twine restructuredtext-lint
cd emhub

# It might be a good idea to check the README.rst before uploading:
rst-lint README.rst

python setup.py sdist
twine upload dist/emhub-0.0.1a3.tar.gz

Creating a Docker image

A Dockerfile has been include to create Docker images.

cd emhub
docker build . -t emhub
docker run --rm -p 8080:8080 --name=emhub -v $PWD/instance:/instance

Upgrading Database model with Alembic

If we modify the database models, then an update/migration is required.

# Do changes in the model (data_models.py)

alembic revision --autogenerate

# Review the generated script

alembic upgrade head  # or use first the --sql option to see the commands

Generating Documentation with Sphinx

A Python environment with Sphinx and other dependencies is required to build the documentation.

# Install environment

conda create -y --name=emhub-docs python=3.8
conda activate emhub-docs
conda install nodejs=20 -c conda-forge -y
npm install -g jsdoc
pip install -e .  # install emhub
pip install -r docs/requirements.txt  # install doc requirements

# Build the docs

python build_docs.py

# or just
sphinx-build -b html docs/ html/

# Rsync the generated html files to the emdocs repo

rsync -av html/ ~/work/documentation/emdocs/emhub/
cd ../emhub-docs/
git ci -am "Updated html files"

Metadata

Release files for emhub 1.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 emhub 1.0.2
File Size Uploaded
emhub-1.0.2.tar.gz 6.6 MB Details

Release files / emhub-1.0.2.tar.gz

Download URL emhub-1.0.2.tar.gz
Size 6.6 MB
Tags Source
SHA-256 checksum
How to use checksums
1d15a2dcc1f5d579d3fa2b2a10b92a6218fba9ce8112a67f3d94ec61d065ef25
BLAKE2b-256 checksum
How to use checksums
adfdbec222f9196a1b7a36ecbbb5825e7ade1b9df2349d2691a6bbe7bea8b02b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

1.0.2 This release

1 release file

0.6.2

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.5

1 release file

0.5.4

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.10

1 release file

0.2.9

1 release file

0.2.8

1 release file

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.18

1 release file

0.0.17

1 release file

0.0.16

1 release file

0.0.15

1 release file

0.0.14

1 release file

0.0.13

1 release file

0.0.12

1 release file

0.0.11

1 release file

0.0.10

1 release file

0.0.9

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

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